Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Passing a Variable that gets changed by a DLL
Message
From
19/12/2002 20:37:25
Gerry Schmitz
GHS Automation Inc.
Calgary, Alberta, Canada
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00734533
Message ID:
00734756
Views:
13
>Help! I'm having difficulty with the proper way to pass a variable to a VB dll subroutine that changes the variable: Here's my code:
>
>Public RetVal
>RetVal = 0
>LOGS = createobject("LogServer.ActivityLogServer")
>LOGS.Log("Root",101,14,RetVal)
>
>... The dll subroutine "Log" works perfectly receiving the first 3 parameters. The problem is that "RetVal" is not getting set by Log (RetVal always stays at 0). I've also tried:
>
>LOGS.Log("Root",101,14,@RetVal)
>
>In the VB declaration, "RevVal" is declared as Variant. A VB test application proves that RetVal, is getting set correctly.
>
>What do I need to do so RetVal picks up the change made by the dll?

A "variant" is basically a "structure". You'll have to pass a string (probably 16+ bytes) by reference and parse the result. The "type" would be in the first byte (I think), and the "data" in the 5th+ bytes. If the variant is a "string", it would be a pointer to a string.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform