Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using Type as a parameter
Message
General information
Forum:
Visual Basic
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00564492
Message ID:
00564746
Views:
16
Another issue wasthat I had not compiled the dll it seems to matter. Also, I tried late binding as I wanted to allow plugins to use some funtionality here. This is no problem as I will include the type in another clas and both the exe and any end user dlls will have to early early bind to the structure. Thanks so much for your time.

>Hi!
>To pass a user-defined type as parameter of public method in a COM object, you must use early binding to COM object and declare UDT as Public in Public class module. UDT always passed by reference. You can look at sample of passing UDT in article "Q185700 - HOWTO: Remote User-Defined Types".
>
>>I want to use a type as a parameter in a dll function. I have scoured the MSDN and I have tried it several ways. I have made the function private, I have declared the type in a public object module...
>>
>>
*** In the dll I want to be able to do something like this:
>>
>>Public type tLocal ' or Private
>>  name as string
>>  x as integer
>>  y as integer
>>end type
>>
>>Public function GetLocation(byref LX as tLocal) ' or Private
>>    LX.Name = "Zone Two"
>>    LX.x = 12
>>    LX.y = 55
>>End Function
>>
>>*** in the app I want to do somthing like:
>>
>>' not sure if this needs to go here
>>Public type tLocal ' or Private
>>  name as string
>>  x as integer
>>  y as integer
>>end type
>>
>>
>>private sub foo
>>    dim MyType as tLocal
>>    set ox = mydllproj.mydllclass
>>
>>    ox.GetLocation MyType
>>
>>    debug.print MyType.Name
>>    debug.print MyType.x
>>    debug.print MyType.y
>>
>>end sub
Thanks in Advance.
~Joe Johnston USA

"If ye love wealth better than liberty, the tranquility of servitude better than the animated contest of freedom, go home from us in peace. We ask not your counsel or arms. Crouch down and lick the hands which feed you. May your chains set lightly upon you, and may posterity forget that ye were our countrymen."
~Samuel Adams

Previous
Reply
Map
View

Click here to load this message in the networking platform