WaitForSingleObject doesn't work for waiting till the completion of the Thread
Yes, it does.
If you get stuck inside the call to ::WaitForSingleObject() it is due to the fact that the thread you're waiting for has not finished yet.
The presence of a call to AfxGetApp(), even though it's currently out-commented, suggests that you're using the MFC framework. If you're creating a thread that is supposed to work with the MFC framework you have to use AfxBeginThread(). The fact that you're not using AfxBeginThread() to start your thread could be what's causing the thread to not finish.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
I have created a dll which exports a factory function that returns an object
of the type of the dll class:
__declspec(dllexport) CMyDll* Factory();
The program that utilize the dll loads the dll calls the factory function and get the dll object. from that object i call the dll functions.
hmodule = AfxLoadLibrary(MyDll.dll);
typedef CMyDll* (*FACTORY )(void);
pFunc = (FACTORY)GetProcAddress(hmodule,"Factory");
CMyDll *dllObj = pFunc();
But there is a problem , the functions are not called right, if i call
functions X,Y and Z, it calls functions Z,Y and X in a certain order which i
If someone spotted the source of the error please let me know
Hi all, thanks for your answers.
The problem was that i declared a function in the interface as an int, but the implementing class declared the same function with an enum.
So when calling the function from the dll (which was the implementing class) the function was not found and another function was called.
I am not sure anyone here or anywhere else will help you. Can you give a good reason to want to do this? The implications of such a request is for nefarious purposes only. Unless you have a really good reason to want to do this, please post it, and then you might get help.
Somethings seem HARD to do, until we know how to do them. _AnShUmAn_
hi..because iam running NT service..For running NT service i called for this exe path..after that creating the service..after started the service.. when i started the service at that time one more exe is running in process manager...but i need only one ..