Converting C# COM object to VB.NET

Rest

New member
Joined
Jun 12, 2004
Messages
4
I am trying to convert a C# COM object, which Ive ported from Pascal, to VB.NET but this time Im not as successful. I get very odd errors, like not getting any data passed in out-parameters of some of the methods. So if anyone, whom unlike me knows VB.NET, would care to give it a shot some people would be very grateful.

Interface
Implementation


Thanks
 
pelikan said:
aint no such animal as a C# COM object. even if there were, why would you want the poor thing to put on VB airs?
Ok ok, a regular C# assembly registered as a COM server. Im converting it to widen a plugin SDK example base.
 
Does the C# version work as it stands or are you also experiencing problems with that version?
When you say some of the functions are returning data through the out parameters is it any function(s) in particular?
DO you have any VB code so far? If not you may want to look here for a starting point.
 
Last edited by a moderator:
The C# version works just splendid.

As far as I can tell, the methods Name, Version and RequiredCoreVersion doesnt pass data well

These are the interface footprints Ive worked out:
Sub Name(<Out(), MarshalAs(UnmanagedType.LPStr)> ByRef Name As String)
Sub Version(<Out()> ByRef Version As Integer)
Sub RequiredCoreVersion(<Out()> ByRef RequiredCoreVersion As Integer)

All others seem to do well though, and Ive defined the out-parameters just the same.
 
Have you tried sending the strings back as UnmanagedType.BStr to see if that changes anything?
Also are these methods behaving consistently wrong or do they sometimes work (or fail in differernt ways?)
 
Actually, nevermind. I had earlier only tested with the tools using the plugins, however when trying to connect it and invoking the methods myself in C++ theres nothing wrong. Guess Ill have a word with the developer. Still odd that the C++ and C# versions would work and not the VB.NET though.

Thanks for the time anyway.
 
Back
Top