|
Yeah, you're right. Can you post the full code? Maybe that'll help.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
The simplified code of the base class
<br />
template <class T><br />
class IMultiThreaded : protected A, public B<T>, public C, public D<br />
{<br />
public:<br />
virtual ~CBase();<br />
<br />
vitual DWORD Stop(DWORD* pdwCode, DWORD dwWaitTimeOut = DEFAULT_TIMEOUT) = 0;<br />
};<br />
<br />
template <class T><br />
CBase<T>::~CBase()<br />
{<br />
if( m_bSomeConstant ) Stop(NULL); <br />
}<br />
The code of the derived class:
<br />
<class><br />
template <class T><br />
class CDerived : public CBase<T><br />
{<br />
public:<br />
virtual ~CDerived() { }<br />
virtual DWORD Stop(DWORD* pdwCode, DWORD dwWaitTimeOut = DEFAULT_TIMEOUT);<br />
}<br />
<br />
template <class T><br />
DWORD CDerived<T>::Stop(DWORD *pdwCode, DWORD dwWaitTimeOut)<br />
{<br />
}<br />
I also got the blogging virus..[^]
|
|
|
|
|
It looks like you are calling the virtual function from the destructor. That's a big no-no.
The order of destructor execution in C++ is such that by the time you're in the destructor of your base class, the derived part of your instance is already gone. The compiler is intelligent enough to figure that out and decides to call the base class function itself. In your case, it is pure virtual and so you are getting the unresolved external symbol error.
If you static cast it to Base explicitly, I guess the compiler assumes you know what you are doing and calls the virtual function anyway. But at runtime, it'll blow up badly.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
|
Just make the destructor virtual. That should solve your problem.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
As you can see in my code example, the destructor is alreay virtual. As you explained in your previous post, the function of the derived class won't be called, since the derived part is destroyed already...
[EDIT]
I already solved the problem, by putting the cleanup in a special cleanup routine, that the user has to call from the derived class's destructor. I would have loved a more nice solution, but I guess that's not going to happen..
[/EDIT]
I also got the blogging virus..[^]
|
|
|
|
|
struct
__declspec(uuid("F5748778-4F2F-4dd7-AB08-2616D76A1DA4"))// //why?
mystruct
{
...
};
|
|
|
|
|
HeartFriend wrote:
struct
__declspec(uuid("F5748778-4F2F-4dd7-AB08-2616D76A1DA4"))// //why?
mystruct
{
...
};
Are you reading any Com header file!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
u can say that, it's a snippet i get from our project written by other developer
|
|
|
|
|
For Uniquly Defined the Com Interface!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
HI all !
SO I'm discovering Visual studio C++, because I'm trying to put some C code in a GUI
what i'm trying to do: in a window the user set some parameters, these parameters mare needed by the C program.
the problem: I don't how to transfer the C code in the visual C++ code (don't know if i must create a new class ...)
If someone have some infos or tuto to do that kind of thing, i will be grateful !!!
|
|
|
|
|
I'm not quite clear on exactly what you are after. I understand that you are creating a GUI-based Windows application in C. Is that much correct? You want to display a window, most likely a dialog box, such that the user can enter some data. Right so far? From here is where your requirements get fuzzy.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Yes you're right, the user will enter some parameters which are use for the program in C (it's a population growth simulator) after the run of the program the user can choose to have a visualization of th distribution of the ppulation
|
|
|
|
|
I suspect the function you are looking for is GetWindowText() . Assuming you are using an edit control, it copies the text of the control into the buffer.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
ok thx!
But what I'm looking for at first (I'm reallya noob) is to put the C code in a mfc application for example .
|
|
|
|
|
Now you've really lost me. What C code are you referring to? Have you already created the MFC application? Is it an SDI, MDI, or dialog-based application? Have you created the dialog template that will be used to accept the user's information? Do you have a CDialog -derived class for this template?
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Sorry!
In fact I would like to have the general lines to create a MFC application where user set parameter for a code IN Clanguage( also how to integrate the code to a MFC application) and also have in the MFC application the possibility to view some graphics which are the results of the execution of the C code.
I hope It's clear, I'm sorry my english is quiet bad ...
|
|
|
|
|
guillaume.dauphin wrote:
I hope It's clear, I'm sorry my english is quiet bad
I can read your Enlish just fine. It's what you are trying to accomplish that's throwing me.
It sounds like you need to use AppWizard to create an MFC application. Once you have that done, we can then proceed to the next step.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
I've visual studio .net 2003 so there is no appwizard but I know (and I do it) how to create MFC applications, it's the way to call my program in c (to put in the MFC appli) that I don't know...
I'm sorry I won't reply before Tomorrow
Thx for your help
|
|
|
|
|
guillaume.dauphin wrote:
I've visual studio .net 2003...
It helps to state this type of information up front so we don't go chasing rabbits!
guillaume.dauphin wrote:
...it's the way to call my program in c (to put in the MFC appli) that I don't know...
Perhaps you are looking for CreateProcess() . It allows you to "run" an application based on its name.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Do you anybody know how to lock a folder that just can be opened by my own process?
It means if you want to open this folder it doesn't work.
And no compression. In command line , you can not open the folder either.
try again
|
|
|
|
|
You can try for folder not opening, use IShellExecuteHook interface.
Implement a class derived from IShellExecuteHook.
Then in your COM component, derive your class from this (your IShellExecuteHook-derived) class.
The Execute(LPSHELLEXECUTEINFO lpsei) method will inform you that the user has tried to open the folder by double-clicking.
But it will not handle the Explore command.
For that you can develop a BHO by implementing IObjectWithSiteImpl and in its Invoke method, catch DISPID_NAVIGATECOMPLETE2 event.
As for the Command prompt,
May someone else or GOD help you.
this is this.
|
|
|
|
|
|
Hello
I am working with MFC. When i insert a bitmap to dialog, the buttons and edit boxes behind that bitmap disappears. Can anyone tell me how can i make them visible.
Thanks
We Believe in Excellence
|
|
|
|
|
you should UPDATEDATA(FALSE)before insert.luck.
|
|
|
|