|
How to nail down the problem. IS changing the settign to use Multi threaded debug dll from Multithreaded debug the solution?
|
|
|
|
|
Try it!
If that was the problem, the errors will go away.
Just be sure to rebuild all (and maybe do the extra clean step: clean seems to do more than rebuild all does).
Failure is not an option - it's built right in.
|
|
|
|
|
You are linking with both the debug DLL (msvcrtd.lib) and debug static LIB (libcmtd.lib) versions of the CRT. You can only use one of those.
|
|
|
|
|
I am working on a product.I have a problem with one window(dialog)
The window appears in a smaller size.it hides all it controls.But when I resize the windoe it displays all its contents.after i close the window and reopen it the same sizeof the window is displayed.I mean the prvious size is restored rather than the optimum size of the window.
I want to know how can i correst this problem and give the window the right size at the time of its first display.It is been sqeezed to a very small size at the first time of display and i have to strech it to fit its contents.I think there is some small mistake that i did.
please contact me at gladiatorharsh@yahoo.co.in
i really need some help now.
thanks
Pankaj
|
|
|
|
|
pankaj0dm wrote: I want to know how can i...give the window the right size at the time of its first display.
Use SetWindowPos() or MoveWindow() .
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
the window is being created dynamically.can u tell me how can i look where its being formed.and why the previous state of the window is kept the same when i close and reopen the window?the size remains same.
please help me.please
|
|
|
|
|
|
my ONINITDIALOG is a bool and does not do any setting.what do you think would be resizing the window so small that it hides all its contents.This is not a resolution problem.please reply
|
|
|
|
|
pankaj0dm wrote: the window is being created dynamically.
What size are you specifying when Create() is called?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
it is using setwindowpos but it setting the value internally.since it is a huge product so classes have been derived.can you provide me more information.
thanks
|
|
|
|
|
pankaj0dm wrote: it is using setwindowpos...
So why can you not set the size correctly using this function? How are you creating the window?
pankaj0dm wrote: ...but it setting the value internally.
What does this mean?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Not sure why this is happening in the first place, but I have had a similar problem when saving/restoring a window's or dialog's geometry after the user changed fonts/resolutions.
My solution was to find the corner-most control(s) and get their RECT s when WM_INITDIALOG is processed. That will allow you to determine the minimum dialog size required to completely show all of the controls. You can also use that information to prevent the user from sizing the dialog too small.
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
hello James.
Well this is not a font or resolution problem.and there is not WM_INITDIALOG in my code.I am just doing the sizing for my window.can you guess anything else which i sud look upon.Create() is also not getting called since its created dynamically.this is a part of a huge product code.infact one of the framework.
|
|
|
|
|
pankaj0dm wrote: Create() is also not getting called since its created dynamically.
How do you create a control dynamically then?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
how to kill ui thread. i have to kill the thread while cancelling the dialog how to do this
Arise Awake Stop Not Till ur Goal is Reached.
|
|
|
|
|
I would suggest that you avoid terminating a thread. Instead, have an event object shared between your dialog and the thread. When the user hits Cancel, signal the event indicating to the worker thread that it should exit. When the thread's handle becomes signaled, it has exited and you can continue (or you can wait with a timeout on the thread's handle, and terminate it if it does not exit normally within a certain amount of time).
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
For a UI thread a more proper way is to exit the thread via its message pump rather than using events. Post a WM_QUIT message to the UI thread and it will exit itself. [Of course inside its message loop,the thread should expect WM_QUIT message].
--
=====
Arman
|
|
|
|
|
Yeah, but this does not sound like a UI thread, otherwise there would not really be a reason to kill it from another GUI element. (Because it would have its own cancel button )
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
Really. Though the OP said it is;
how to kill ui thread.
--
=====
Arman
|
|
|
|
|
Doh! Missed it....!
That is what I get for applying the Reasonable Man Test...
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
A "UI thread" is actually a misnomer. It's simply a thread with a message pump, whereas a "worker thread" is a thread without a message pump.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
the other post cover important details, like you should close a thread by the means its ment to be closed to avoid memory leaks and other nasty stuff.
but if you really want to do it...
i used these function is a app that had to close other applications regardless of memory leaks.
here it is.. should still work i hope.
<br />
DWORD lpProcessID, lpThreadID, lpExitCodeThread, lpExitCodeProcess;<br />
HWND WndHandle;<br />
<br />
#ifdef _DEBUG_MSGBOXS_<br />
AfxMessageBox(_T("Checking for Class"),MB_OK);<br />
#endif<br />
<br />
if(NameIsOfClass == TRUE)<br />
{<br />
WndHandle = ::FindWindow(AppName,NULL);
}<br />
else<br />
{<br />
WndHandle = ::FindWindow(NULL,AppName);<br />
}<br />
if(WndHandle != NULL)<br />
{<br />
#ifdef _DEBUG_MSGBOXS_<br />
AfxMessageBox(_T("Class found"),MB_OK);<br />
#endif<br />
<br />
lpThreadID=GetWindowThreadProcessId(WndHandle,&lpProcessID);
HANDLE ThreadHandle = OpenThread(THREAD_ALL_ACCESS,TRUE,lpThreadID);
HANDLE ProcessHandle = OpenProcess(PROCESS_ALL_ACCESS,TRUE,lpProcessID);
<br />
if(GetExitCodeProcess(ProcessHandle,&lpExitCodeProcess) == 0 )
{<br />
AfxMessageBox(_T("GetExitCodeProcess function Failed with Error:"), MB_OK);<br />
return FALSE;<br />
}<br />
<br />
if(GetExitCodeThread(ThreadHandle,&lpExitCodeThread) == 0)<br />
{<br />
AfxMessageBox(_T("GetExitCodeThread function Failed with Error:"), MB_OK);<br />
return FALSE;<br />
}<br />
<br />
TerminateThread(ThreadHandle,lpExitCodeThread);
TerminateProcess(ProcessHandle,lpExitCodeProcess);
}<br />
else<br />
{<br />
#ifdef _DEBUG_MSGBOXS_<br />
AfxMessageBox(_T("Failed: Class may not be running"),MB_OK);<br />
#endif<br />
}<br />
that has the key functions in and works.
or atleast it did when i made it a few years back.
hope that helps
p.s i'd dont use this for threads i created, if you created the thread you need to kill it safely in the onclose event or ondestroy etc
|
|
|
|
|
when i move a tab key the static control does not show the tab key movement.How to do that please help me?
i have placed the image on static control.
|
|
|
|
|
prathuraj wrote: when i move a tab key the static control does not show the tab key movement.How to do that please help me?
Make sure the control has the WS_TABSTOP style (it's off by default). Then you'll need to call DrawFocusRect() when the control gains focus, and again when the control loses focus.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
prathuraj wrote: when i move a tab key the static control does not show the tab key movement.
By design. The static control does not take input, so tabbing through the controls will never stop on a static control.
(I assume you mean static control, not button control?)
|
|
|
|