Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Tue Dec 12, 2017 1:34 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Really Basic Question
PostPosted: Sun Feb 24, 2008 10:00 pm 
Offline

Joined: Sun Oct 16, 2005 3:07 am
Posts: 267
Location: Canberra, Australia
Excuse me for a really basic question but I haven't touched C for years and C++ hardly at all.

What I am trying to do - as an experiment - is convert one of my simple RB Classes into a C++ class and call it from a plugin. I propose to do this by creating a new C++ class that will act as the super of the existing RB Class and then move a property or two etc. over to the new class and remove them from the RB Class. Eventually everything will be in the new C++ class and I'll delete the RB Class.

I've made and built a test plugin and I've created a new Class "MyBase" with one property, length. Created an .h and .cpp file and the lot compiles. The header file:

class MyBase{

double length;

void SetLength(double newLength);

};


My question is however - what next? Looking at some of the examples it looks like I really need to create a structure to hold the class data (like length) however what I would really like to do is keep the class as C++ like as possible (so it can be used in other C++ projects), keep it in its own file and just have a shim that allows RB to hook into its properties and methods.

Is this possible? I would really like a simple example if anyone has one.

thanks!

_________________
Peter
http://www.fracturedSoftware.com
Rondo - Midi made easy.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Feb 24, 2008 10:21 pm 
Offline

Joined: Sat Oct 01, 2005 12:18 pm
Posts: 1358
While I haven't read the current docs, it atleast used to be that you would define something like a RealObject or RealClass (I can't remember precisely) and you would basically provide a mapping between this class and your C++ class using RealMethod and RealProperty and such. But they did a major overhaul of the plugin API, so I can't say for sure anymore.

_________________
Image
Image


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 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:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group