|
Thanks for your suggestion!
I tried it before, but it didn't work. Anyway, I found it is better to fix this problem in the dll file which throw the exception using __try__catch.
|
|
|
|
|
I am writing a code to do a long time draw like:
void MyDialog::DoSlowDraw(DWORD tDelay){
while(notFinished){
DrawNextLine();
Sleep(tDelay);
}
}
And it's better to have a "cancel button" because it may take a long time according to tDelay.
---------------------
My try:
To handle "cancle button clicked Message" , Drawing must be done by another thread.
UINT DrawProc( LPVOID pParam )
{
CMyDialog* pform = (CMyDialog*)pParam;
int timeDelay = pform->timeD;
Line_list* pLines = pform->m_pLines;
CClientDC cdc(pform);
It's worked, but as far as I know
1. Work thread should not touch the GUI ---- (Do the drawing).
2. MFC object should not passed to another thread ---- (passing drawing data by CMyDialog*)
Is there a good way to cancle long time drawing.
|
|
|
|
|
fitatc wrote: Is there a good way to cancle long time drawing.
See here.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
|
fitatc wrote: May be You misunderstanding my qustion because of my poor english.
I understood you perfectly. If you are drawing in a worker thread and you need to cancel that thread, my advice is the way to go. Using a message pump is an antiquated and largely unused 16-bit Windows solution.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Sorry for my late response,(I am in a busy work now)
You are right, but before that,
Do you think it is OK to draw in the work thread?
I mean, a good design? because drawing is touching the GUI I thought, maybe I was wrong.
|
|
|
|
|
fitatc wrote: Do you think it is OK to draw in the work thread?
I would think not. Have the worker thread post a message to the main thread (that owns the UI).
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
I am writing a code to read the bits from the file. Starting from first bit, i can read the whole file, and can retrieve the whole data as well. But if i want to retrieve the bits from somewhere between the file, how should i do this? One more thing, i am doing a string comparision of a module(and that module repeats several times in the file) and then i am retrieving the bits hence i can,t apply character counting.
It was a woman who drove me to drink but I never got opportunity to thank her
|
|
|
|
|
dubeypankaj wrote: But if i want to retrieve the bits from somewhere between the file, how should i do this?
It depends on how you are reading your file. Are you using an ifstream, a FILE, a CFile, ... ? Typically, you can set the file pointer (e.g. CFile::Seek, ifstream::seekg, ...). You should look at the documentation for more information.
|
|
|
|
|
Read the file in binary mode completly in a buffer, and than you can do what you want.
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
Hi,
May i know how can read and write registry thru batch file.....
|
|
|
|
|
Link[^]
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
|
Hi,
I would like to build an win32 application which sould not inherit from explorer.exe. By default all MFC/Win 32 applications are loaded in explorer.exe. so any crash of application is causing crash to explorer and vice versa..
So i need to find out a way where my application wont be loaded in explorer.
Thanks in advance.
Birajendu
SonicWALL India.
Bangalore.
India
|
|
|
|
|
birajendu wrote: win32 application which sould not inherit from explorer.exe
I will tell you a trick, try to figure out where your application is crashing and why.
Fix the bug.
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
Obviosly i will do that. But that is not the only solution. It would be nice if we can luch programs with out inheriting from explorer.exe. I saw some apllication from some trusted venders used to do so.. they dont load their application on explorer.
birajendu
CyberG India
Delhi
India
|
|
|
|
|
birajendu wrote: It would be nice if we can luch programs with out inheriting from explorer.exe
Well, that's the case. I have no clue about what you mean by "inheriting explorer"... If your application crashes, explorer doesn't crash. They are two independant things, so why would they interfere ? Unless maybe you are talking about something specific like a shell extension ?
|
|
|
|
|
yeah.. not exactly inheriting.. but all the applications in window by default load on explorer, some thing like child process of explorer. And my application is also doing the same. But i saw some applications like MacAfee client are independent.
birajendu
CyberG India
Delhi
India
|
|
|
|
|
birajendu wrote: But i saw...
Using?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Hi,
I want to create resizable propetysheet with watermark bitmap background.
Or a Header bitmap with colored background.
I am able to resize the proprtysheet but not header bitmap and background bitmap.
Please suggest some artical to do so.
|
|
|
|
|
CPropertySheet(
LPCTSTR pszCaption,
CWnd* pParentWnd,
UINT iSelectPage,
HBITMAP hbmWatermark,
HPALETTE hpalWatermark = NULL,
HBITMAP hbmHeader = NULL
);
See the parameters in bold. For setting the background you can override OnPaint message of your property sheet class
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
I have resource DLLs for my application. I'm loading DLL in my application. I want to get text associated with all the IDs.Longer way I know but that is quite hectic and not a good programming style.
I just want to know the shortcut code for that which uses some APIs and loads the text.
Can anyone help me?
Thanks.......
|
|
|
|
|
Which method are you using to get id's from the resource dll?
LoadLibrary???
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
|
Hi Purish,
Have you tried SetDlgItemText[^] & GetDlgItemText[^]?
Do not trust a computer...
Always check what computer is doing
regards,
Divyang Mithaiwala
Software Engineer
|
|
|
|