General information
Category:
Coding, syntax & commands
>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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only