instances

M

Michael Sgier

Hi
#include "demo.h"

in my plugin start function (main.cpp) I've:

// Create a demo instance
Demo* demo = new Demo();
/// Create our window, setup datarefs and register our hotkey.
demo->init();

but now I want to have:

demo->run();

in my main loop function (main.cpp) which gives me a undeclared error.
How/where shall I declare demo?
Many thanks
Michael
 
J

joseph cook

Hi
#include "demo.h"

in my plugin start function (main.cpp) I've:

        // Create a demo instance
        Demo* demo = new Demo();
        /// Create our window, setup datarefs and register our hotkey.
        demo->init();

but now I want to have:

demo->run();

in my main loop function (main.cpp) which gives me a undeclared error.
How/where shall I declare demo?
Many thanks
Michael

What does your demo.h look like? Have you defined a function run()
within class Demo ? Do you have a demo.cc that contains the
definitions that you are linking in?

It's hard to answer your question with the limited amount of
information you have provided.

Joe
 
M

mikethebike

Yes. It even works if i put all in the main function. But I want
to separate the init and loop only run() ( all within main.cpp )
Might be basic C++ somehow but I've mostly done only VB.NET so far.
Thanks
 
A

Alf P. Steinbach

* Michael Sgier:
Why? It makes no sense to post the whole, huge class. I've no compile
errors, but a basic design/instanciate question.

Read the FAQ.
 
M

Michael Sgier

Why? It makes no sense to post the whole, huge class. I've no compile
errors, but a basic design/instanciate question.
 
R

red floyd

Michael said:
Why? It makes no sense to post the whole, huge class. I've no compile
errors, but a basic design/instanciate question.

In that case, you have an error on line 42 of your program.
 
R

Rolf Magnus

Michael said:

Why what?
It makes no sense to post the whole, huge class.

Nobody told you to do that.
I've no compile errors, but a basic design/instanciate question.

Really? In your initial posting, you said something different.
People here don't like playing quiz games. It just hard to try and find out
what might be your problem by reading your description of what you think you
did. Reading the code or running it through a compiler just makes helping
you a thousand times easier.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,159
Messages
2,570,879
Members
47,417
Latest member
DarrenGaun

Latest Threads

Top