On Aug 15, 2006, at 12: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?

Byref passes the structure as a pointer to the structure.

Also - how can I convert a pointer to a structure obtained from a Dylib call
into an RB structure reference ?

Depends on how it's given back to you. If it's returned to you from a function call, you'll need to go through a MemoryBlock like:

dim mb as MemoryBlock
dim aStruct as MyStructure
mb = MyCall()
aStruct.StringValue( TargetLittleEndian ) = mb.StringValue( 0, aStruct.Size )

Couldn't the AddressOf  keyword be extended in future to cover this ?

There's no technical reason why it couldn't, but there is a reason it's not already: Being able to get the address of items living on the stack is risky business, because it's then possible to mess with the internals of REALbasic far to easily, and could encourage some people to rely on implementation details of how certain things work. Beyond that, there is nothing you could do with this hypothetical feature that you can't already do with a temporary MemoryBlock.

HTH,
Jon


--
Jonathan Johnson
[EMAIL PROTECTED]
REAL Software, Inc.


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

Reply via email to