Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Sun Jun 25, 2017 2:14 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Return MemoryBlock from a pointer
PostPosted: Mon May 21, 2012 4:43 pm 
Offline

Joined: Wed Sep 10, 2008 3:22 pm
Posts: 27
Location: Italy
Hi everyone,

here another weird question from me... :)
As stated in the subject I need to return a MemoryBlock object from the plugin I'm writing, the point i that the returned MemoryBlock should wrap around a C pointer that a function returned. How can I accomplish something like that? How to create a MemoryBlock object from a C pointer within a plugin?

Thanks in advance

Marco


Top
 Profile  
Reply with quote  
 Post subject: Re: Return MemoryBlock from a pointer
PostPosted: Mon May 21, 2012 8:40 pm 
Offline
User avatar

Joined: Wed May 10, 2006 2:42 pm
Posts: 2985
Location: Germany
mistiko wrote:
How to create a MemoryBlock object from a C pointer within a plugin?


Read the SDK function list and search for functions with memoryblock in name...

Greetings
Christian

_________________
See you in Orlando, Florida for Real World 2013
More details and registration here:
http://www.realsoftware.com/community/realworld.php


Top
 Profile  
Reply with quote  
 Post subject: Re: Return MemoryBlock from a pointer
PostPosted: Tue May 22, 2012 12:25 am 
Offline
Real Software Engineer

Joined: Fri Jan 28, 2011 5:24 pm
Posts: 145
If you want to avoid deprecated functions:
- call REALGetClassRef("MemoryBlock") in PluginEntry and stash it somewhere
- use REALnewInstance(gMemoryblockClass)
- load the convert method via REALLoadObjectMethod(obj, "Operator_Convert(value As Ptr)")
- invoke that and return the object

Alternatively, you could just declare your function to return Ptr.

_________________
Joe Ranieri
Mac Frameworks & Compiler
REAL Software, Inc.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group