realbasic-nug
[Top] [All Lists]

VB to RB Help

To: Network Users Group REALbasic <realbasic-nug at lists dot realsoftware dot com>
Subject: VB to RB Help
From: Jim Meyer <jim_meyer at chartermi dot net>
Date: Mon, 31 Jan 2005 15:39:57 -0500
Delivered-to: realbasic-nug at lists dot realsoftware dot com
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,

Jim

_______________________________________________
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>

<Prev in Thread] Current Thread [Next in Thread>