|
I don't have any problem with MFC dialogs. Maybe you need to look into the message pump in CWinThread::Run to see what happens when a main window of an MFC thread closes.
http://blog.joycode.com/jiangsheng
http://blog.csdn.net/jiangsheng
Command what is yours
Conquer what is not
---Kane
|
|
|
|
|
Thank you for the answer,
To try this, I must rewrite my code, because I don't use CWinThread now. I'm from "old school" like using _beginthread () with global Threadfunctions. And so a function should terminate intern via _endthread() (extern TerminateThread()).
I think, here is my problem, because the documentation describes, that _endthread() will clear up all objects from stack (and may be from heap too) they are created inside the thread.
I will try your sugestion with the message pump. May be I can see some mistakes.
Stephan
|
|
|
|
|
MFC thread state is needed by MFC objects. You need begin the thread with AfxBeginThread.
http://blog.joycode.com/jiangsheng
http://blog.csdn.net/jiangsheng
Command what is yours
Conquer what is not
---Kane
|
|
|
|
|
Yo baby yo baby yo
It works. The solution of HumanOsc was good. I had a mistake in the MessageMap.
Thanks to all for helping
Stephan
|
|
|
|
|
Hello again...
My solution is based on the great Articel from Joseph M. Newcomer:
http://www.codeproject.com/threads/usingworkerthreads.asp[^]
This is a very nice Introduction about worker threads.
Be carefull about SendMessage, it can also produce unexpected situations like a deadlock from your app...
Always prever the use of PostMessage to provide a safe gui access.
But Sometimes it's recommend (before or after the end of a worker thread) to get sure thats no (old) messages exists in the message queue.
In this situations use PeekMessage, GetMessage and DispatchMessage in main thread to remove (process) all old Message from Queue...
Best regards...
|
|
|
|
|
I am searching for the location of the strcmp function so that i may be able to dynamically load it.
In which dll does it reside?
In which dll's do c-runtime libraries reside in general?
|
|
|
|
|
|
If you are programming in C/C++, you would be hard pressed to not already have that DLL loaded (unless you link statically).
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Hello,
I need to provide a trial license for my application which should expire after a predefined expiry date. How should I go about doing the time comparison so that it can not be tampered by changing the system date.
Thanks in Advance.
|
|
|
|
|
|
Thanks, but this is a standalone application and can not rely on getting any information from anywhere outside the system.
|
|
|
|
|
You can write the current system time at application exit as Exit-Time. When the user opens application the next time, it should compare the current time with the Exit-Time. If the current time is less than the Exit-Time, just exit the application or whatever.
this is this.
|
|
|
|
|
But the user can reset the system time to an earlier time before exiting the application and use the application for ever.
|
|
|
|
|
I guess you can also write the current time down every five minutes etc, after comparing it with the stored time.
And I am about to logout for the day.
this is this.
|
|
|
|
|
how about instead of letting it run for a certain amount of time, you let them use it a certain number of times. I think that's easier.
My articles
www.stillwaterexpress.com
BlackDice
|
|
|
|
|
That would be easier. But the users require trial periods based on time.
|
|
|
|
|
See here.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
Thanks for the link. This works fine once the license expires. But, the user can work by changing the system date back to an allowed date before starting the application so that he never gets the license expired message. This way i think he can use the application for ever.
|
|
|
|
|
Check the article again. It works even if the user alters the system date. Read through the code and you'll quickly see how this is done.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
Hello,
You could poll a server for the date / time and compare with that. You have to get around the unavailable internet connection problem though.
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
Hi,
I would like to show animation in my dialog.
I have the GIF file but I don't know how to show it.
Can anyone help me?
BTW - Does anyone know where can i find the animation which
Microsoft shows when files are being transffered from one place to another?
Regards,
Eli
|
|
|
|
|
|
Hi,
I'm trying to do some offscreen drawing. The usual teqnique is to go
CreateCompatibleDC
CreateCompatibleBitmap
SelectObject
...
but today I'm trying to create a memdc in the absence of a screen dc - so nothing to be compatible with. I guess I need to use CreateDC, but I can't put CreateDC(_T("DISPLAY"), NULL, NULL, NULL) because I don't want the drawing to appear on the display. Ideally I'd like to make a DC that simply prints into system ram (not video). Does anyone know how to do this?
Joel Holdsworth
|
|
|
|
|
|
Joel Holdsworth wrote:
but I can't put CreateDC(_T("DISPLAY"), NULL, NULL, NULL) because I don't want the drawing to appear on the display
Why can't you use that? You would use it as a basis for your own memory DC:
<br />
CDC dcDisplay;<br />
dcDisplay.CreateDC(_T("DISPLAY"), NULL, NULL, NULL);<br />
CDC dcMem;<br />
dcMem.CreateCompatibleDC(&dcDisplay);<br />
Then you should be able to just draw into the new DC.
|
|
|
|