No, not really. The memoryBlock can have a size of "Unknown" and the  
plugin generates such memoryblocks by converting an opaque struct.  
This struct has only one field and can contain an integer or a c- 
string.  The normal accessors to the memoryblock are meaningless  
because the memblock has a size of -1.

Anyway, the Ptr can be an integer (the Ptr is then seen as a pointer  
representation of an integer) or a pointer to a c-string, and this in  
the context of the plugin. We solved the problem though by extending  
the memblock class with two methods (PtrToInt and PtrToString).

Alfred

On May 15, 2007, at 6:39 PM, Tim [EMAIL PROTECTED] wrote:

> Message: 13
> Date: Tue, 15 May 2007 14:14:42 -0700
> From: "Tim Hare" <[EMAIL PROTECTED]>
> Subject: RE: Ptr to string
> To: "REALbasic NUG" <[email protected]>
> Message-ID: <[EMAIL PROTECTED]>
> Content-Type: text/plain;     charset="windows-1250"
>
> Integer(x) returns the address that x points to, not the contents  
> of that
> address.  Trying to compare that address to a string is meaningless.
>
> Tim
>
>
> Alfred Van Hoek wrote:
>>
>> Given that the following is valid and gives a desirable result:
>>
>> A memoryblock instance (Identifier) passed from a plugin is being
>> treated as a Ptr like
>>
>>              dim x as Ptr = identifier
>>
>> and is then casted to an Integer and compared like
>>
>>              if Integer(x) = 1234 then
>>                      MSGBox "yippee"
>>              end if
>>
>> However, how does one cast a Ptr to a string like:
>>
>>              if string(x) = "myypppeestring" then
>> .....
>>
>> the compiler complains because string is not a class, yikes....

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to