Declare the external function parameter as ByRef foo as SomeStruct.
A pointer to the structure will be passed.
To convert a pointer to a structure, wrap the pointer in a
MemoryBlock, then use StringValue to assign the result to your
structure.
Charles Yeomans
On Aug 15, 2006, at 1:33 PM, Daniel Stenning wrote:
But I specifically need to pass the pointer of my structure to an
external
DLL function which takes a pointer to a structure. Is there no way
to do
this?
Also - how can I convert a pointer to a structure obtained from a
Dylib call
into an RB structure reference ?
Couldn't the AddressOf keyword be extended in future to cover this ?
Dan
On 15/8/06 18:26, "Mars Saxman" <[EMAIL PROTECTED]> wrote:
On Aug 15, 2006, at 10:19 AM, Daniel Stenning wrote:
I particularly want to find the "correct" way of setting a Ptr
variable to
the address of a structure.
There is no correct way to get the address of a structure, or of any
other type of variable.
Also how to pass the address of a RB
structure as an argument to a method which takes a pointer ( Ptr) .
There is no way to do this. Try defining the parameter using ByRef
and the structure's type instead of Ptr. Using your sample code, the
technique might look like this:
Declare Sub mymethod( ByRef arg1 As myStructure )
....
Dim mystruct As myStructure
Call mymethod (mystruct)
Mars Saxman
REAL Software
_______________________________________________
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>
_______________________________________________
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>
_______________________________________________
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>