New topic: 

How do you access a memoryblock?

<http://forums.realsoftware.com/viewtopic.php?t=29257>

       Page 1 of 1
   [ 1 post ]                 Previous topic | Next topic         Author  
Message       JustSomeGuy           Post subject: How do you access a 
memoryblock?Posted: Mon Jul 27, 2009 8:31 pm                               
Joined: Fri May 11, 2007 11:35 am
Posts: 418              A memory block is passed into my C++ plugin.
The memory block is a property in a rb class object that is passed in.
How do I get access to the bytes of data in the memory block from within a C++ 
plugin?


Code:REALmemoryBlock mb;
REALobject o;
REALGetArrayValue(myArray, i, &o);
REALGetPropValue(o, "Data",  (void **) &mb);


This compiles but I had to cast the spell out of the mb variable to the point 
where I'm not even sure it's right.

Now I'm not sure how to access the raw data in the memoryBlock.
It must be something as simple as a cast but I'm just not sure.

Ideally I would be able to say:
char *data = (char *) mb;     
_________________
A picture paints a thousand words.
A thought paints a thousand pictures.  
                            Top           Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 1 post ]     
-- 
Over 1500 classes with 29000 functions in one REALbasic plug-in collection. 
The Monkeybread Software Realbasic Plugin v9.3. 
http://www.monkeybreadsoftware.de/realbasic/plugins.shtml

[email protected]

Reply via email to