|
|
Ah!
If you mean you want to set the range for the spin button control
use the
m_spinBtnCtrl.SetRange(short lowerValue,short upperValue);
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Hello
i have three project in single solution.
in one of the project there is a namespace called A.
and it has class with funciotn B and C Respectively.
i want to call this 'C' Function in other project.
how can i do it.
i want to add the header file in which the funcion is declared but i don't know how to write the statement.
plz tell me .
thanx
|
|
|
|
|
|
sorry i cann't do it.
first thing i don't know how to do it and the other thing is that My PM will not allow me to do it.
is there any other way to call that function.
Plz Tell me
thanx
|
|
|
|
|
Add the source files in (.h and .cpp) in your project and compile it.
SaRath.
"It is your attitude, not your aptitude, that determines your altitude - Zig Ziglar."
My Blog | Understanding State Pattern in C++
|
|
|
|
|
hi
i include the header file like that
#include "gloox/src/connection.h"
and call the member function on buttion click event like this
gloox::Connection::temp();
here gloox is a namespace,coonection is class and temp is function name.
when i call like this its giving me error illigal call of non static member function.
thanx
|
|
|
|
|
make sure that, the called function is static
SaRath.
"It is your attitude, not your aptitude, that determines your altitude - Zig Ziglar."
<blink>My Blog | Understanding State Pattern in C++
-- modified at 8:12 Wednesday 5th July, 2006
|
|
|
|
|
hello
i have declare the function like that
static void temp();
but it still giving the same error.
thanx
|
|
|
|
|
Before being able to call a function from a class, you first need to declare an instance of this class with which you'll be working. This is really basic C++ and I suggest you find some good book or tutorial that exmplains how classes work before going any further. As I said, this is really the basic and you should be able understand the concept first.
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
|
Sarath.<fon wrote:<="" div="">he's trying to call a static function
He's trying to call a function from a class. He never said that this was a static function, you guessed that.
If he really knew what he was doing (by calling a static function), then the error message is sufficient enough to provide an answer to his question (which seem not to be the case).
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
as i told in my post.
its not single project in which i'm calling a function i want to call a function from differnt Project which is in my current solution.
its mean i have two project in a single solution.
now i have to call a function from one project to another.
that's it.
what is the solution of it.
|
|
|
|
|
Hello
plz give me the solution if u hav.
i'm waiting for ur reply
thanx
|
|
|
|
|
"hello
i have declare the function like that
static void temp();
but it still giving the same error.
thanx"
this was one of his post... I thougt of he is trying to call static function. that's why i said
SaRath.
"It is your attitude, not your aptitude, that determines your altitude - Zig Ziglar."
<blink>My Blog | Understanding State Pattern in C++
|
|
|
|
|
hi thanx for replying
before doing this i did try like this
gloox::Connection x;
x.temp();
but its give me error
"d:\backup Swaraj\jabber\Kletsmajoor\KletsmajoorDlg.cpp(26): error C2512: 'gloox::Connection' : no appropriate default constructor available"
what is the solution of this.
thanx
|
|
|
|
|
Show the constructor of the class. Are you sure it doesn't have any argument and that you have a default constructor ?
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
hi
when i pass the argument then it gives the error that
"Error : object have struct/unioun tyoe"
what to do.
it there any clear way to call a other project function into our project (both of the project in the same solution).
thanx
|
|
|
|
|
Don't feel blue,
these are simple C++ errors. I think you haven't basics in C++.
In C++ default constructor and other stuffs are learning in the beginning.
If you give the compilation error code in MSDN. it will show the reason with example. First try for that.
SaRath.
"It is your attitude, not your aptitude, that determines your altitude - Zig Ziglar."
<blink>My Blog | Understanding State Pattern in C++
|
|
|
|
|
Sorry, but as you are missing the essential parts of C++, it is very difficult to help because we need much more information than you just gave us. And asking these information will require you to understand what we are speaking about (which seems not to be the case).
I suggest you take a look at these tutorials[^] and read that carefully before going any further. It is essential that you understand at least the basics of C++.
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
i think u people are misinterpreting me..
but that is ok.
i have made the deafult constructor but still its giving the same error.
but i think problem is some where else.
when i call the function making object then it give me error of default constructor.
and when i call the function by its name then it gives error
"illigal call of non-static member function".
thanx for ur support.
|
|
|
|
|
Let me say one thing.
For a properly written class ( source files) can be used with any C++ applications.
aavesh wrote: i think u people are misinterpreting me..
Is it our mistake? if yes, sorry for the same.
aavesh wrote: hi
i include the header file like that
#include "gloox/src/connection.h"
and call the member function on buttion click event like this
gloox::Connection::temp();
here gloox is a namespace,coonection is class and temp is function name.
when i call like this its giving me error illigal call of non static member function.
thanx
This was one of you post.
You know that the function is not static. you can call temp function without creating an object,only if it is static function.
Cedric asked you for the constrcutor right?
The Compiler will put a default constructor, if there's no constructor available in your class
for example
class CTest
{
public:
CTest(int i ){};
};
If you try to create
CTest t;
it will give the same error what u said eralier. In this case you can create an object in this way
CTest t(10);
we have tried to help you by spending our time... Just look at the forum... it's quite a big discussion right?
aavesh wrote:
hi
when i pass the argument then it gives the error that
"Error : object have struct/unioun tyoe"
what to do.
it there any clear way to call a other project function into our project (both of the project in the same solution).
thanx
Without provinding enough information how we could track your bug? even after asking you for the ctor, u didnt give anything.. don't blame us for your mistake.
C++ is not written for a single peron. there are alot of people using the same in this world.
99.99% it will be our mistake. don't blame the compiler.
Hope you will take this in positive sense.
SaRath.
"It is your attitude, not your aptitude, that determines your altitude - Zig Ziglar."
<blink>My Blog | Understanding State Pattern in C++
|
|
|
|
|
hi
plz don't take it other wise.
thanx for ur support people.even i appreciate ur patience that u people give me ur valuable time.
i know that there is my mistake and for my mistake how can i blame u.
i didn't mean it at any time.
i was getting little frusted and was making the stupid mistake.
event the problem is not yet solved.
but i will try to find out the solution once again thanx for ur support.
i hope u wouldn't mind anything....thanx
|
|
|
|
|
Hi,
I have a a singleton class with a private instance pointer (pInstance) that is initialized with a dynamically created instance (using "new"). I'm just wondering what I have to do to ensure there is no memory leak when the class is no longuer used.
Shall I create and call a "destroyInstance()" function in the class doing "delete pInstance; pInstance = NULL;" ?
|
|
|
|
|
If you prefer an STL solution, I think you could consider the auto_ptr class:
#include "stdafx.h"
#include <memory>
std::auto_ptr< MyClass > pInstance;
In this case the singleton object will be deleted automatically.
|
|
|
|