Skip to Content
0
Former Member
Apr 05, 2016 at 09:20 PM

Returning a structure from a call to a .NET COM wrapped dll

46 Views

I've used COM wrapped ,NET dlls a lot, but up until now I've only returned simple datatypes like string and boolean. I now would like to return a class / structure, something like:

Class ConnectionInfo

Boolean IsConnected

String URL

ConnectionInfo IsConnected

{

.

.

return connectionInfo

}

Powerbuilder code is currently something like this:

str_sharepoint_site lstr_site

lany = iole_xml.IsConnected() <-- This works as I put a bunch of MessageBox.Shows in the C# code and it gets all the way to the end of the call

lstr_site = lany <-- Crashes here saying "Cannot convert oleobject in Any variable to str_sharepoint"

str_sharepoint is a boolean and a string

However, due to old age, long working hours, and a fear of early onset dementia I'm drawing a blank on to get the result from the call in Powerbuilder into a structure. I can get it into an OLEObject or an ANY variable, but can't think what to do with it then.

Any help much appreciated!

Thank you.