Rest Posted June 12, 2004 Posted June 12, 2004 I am trying to convert a C# COM object, which I've ported from Pascal, to VB.NET but this time I'm 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 Quote
pelikan Posted June 13, 2004 Posted June 13, 2004 ain't no such animal as a C# COM object. even if there were, why would you want the poor thing to put on VB airs? Quote IN PARVUM MULTUM
Rest Posted June 13, 2004 Author Posted June 13, 2004 ain't no such animal as a C# COM object. even if there were' date=' why would you want the poor thing to put on VB airs?[/quote'] Ok ok, a regular C# assembly registered as a COM server. I'm converting it to widen a plugin SDK example base. Quote
Administrators PlausiblyDamp Posted June 13, 2004 Administrators Posted June 13, 2004 (edited) 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. Edited June 13, 2004 by PlausiblyDamp Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Rest Posted June 13, 2004 Author Posted June 13, 2004 The C# version works just splendid. As far as I can tell, the methods Name, Version and RequiredCoreVersion doesn't pass data well These are the interface footprints I've 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 I've defined the out-parameters just the same. Quote
Administrators PlausiblyDamp Posted June 15, 2004 Administrators Posted June 15, 2004 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?) Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Rest Posted June 15, 2004 Author Posted June 15, 2004 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++ there's nothing wrong. Guess I'll 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. Quote
Recommended Posts