realbasic-nug
[Top] [All Lists]

Re: VB to RB Help

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: VB to RB Help
From: Charles Yeomans <yeomans at desuetude dot com>
Date: Mon, 31 Jan 2005 18:18:43 -0500
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <bdd3e59c73efe6b76583a5e07c1d4805 at chartermi dot net>

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>

<Prev in Thread] Current Thread [Next in Thread>
  • VB to RB Help, Jim Meyer
    • Re: VB to RB Help, Charles Yeomans <=