On Jan 31, 2005, at 3:39 PM, Jim Meyer wrote:
Hi VB experts.....
I am trying to implement a Win32 declare working from a VB
example..... I think I have most of it but not sure what to do with
the following VB code...... in particular the StrPtr() and VarPrt()
functions:
' Convert the Unicode strings to null terminated ANSI byte arrays
' then get pointers to the byte arrays.
intElementCount = UBound(astrGSArgs)
ReDim aAnsiArgs(intElementCount)
ReDim aPtrArgs(intElementCount)
For intCounter = 0 To intElementCount
aAnsiArgs(intCounter) = StrConv(astrGSArgs(intCounter),
vbFromUnicode)
aPtrArgs(intCounter) = StrPtr(aAnsiArgs(intCounter))
Next
ptrArgs = VarPtr(aPtrArgs(0))
The VB declare looks like:
Private Declare Function gsapi_init_with_args Lib "gsdll32.dll" (ByVal
lngGSInstance As Long, ByVal lngArgumentCount As Long, ByVal
lngArguments As Long) As Long
.... and the example passes "ptrArgs" into "lngArguments"
Any help is appreciated..... thank you,
I think that a correct Rb declaration is
Declare Function gsapi_init_with_args Lib "gsdll32.dll" (instance as
Ptr, argc as Integer, argv as Ptr) as Integer
To say more, I'd need to have a look at the header file iapi.h.
Charles Yeomans
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
|