|
In your thread, just post a message to your main dialog with (no data) and in that message handler in your main dialog you should be able to create your dialogs without problems. Watched code never compiles.
|
|
|
|
|
After doing a little checking, evidently you can do it with child windows on a 2nd UI thread. You do have to be careful about communications between the threads since there is a possibility of creating a deadlock between the threads. I would still tend to favor using OnIdle() instead of a 2nd thread to try and deal with your performance issue.
Apart from some quibbling over precise wording, I don't see the problem with what you are doing. As far as my quibbling goes, in the parent window code you call a setup function passing "this" as a parameter so that the thread class can save its value in a member variable called g_thisParent. g_thisParent is not a pointer to "this", it is a CWnd * to the parent window object. Also, in the second thread, you never, ever use "this" in an attempt to refer to the parent window, you use the variable you have named g_thisParent.
Other than that, my only thought would be some sort of synchronization issue - but I don't see what it would be.
Please do not read this signature.
|
|
|
|
|
bu7ch3r wrote: ...that on press of a button creates another 12 dialogs...
...the maindlg freezes for 1-3 seconds.
...what shall i do?
Do not press any button to create them,
just create them all in CMainDlg::OnInitDialog() virtual void BeHappy() = 0;
|
|
|
|
|
yes, but that makes the gui start slow .
|
|
|
|
|
Place a good splash window in another thread for your start virtual void BeHappy() = 0;
|
|
|
|
|
=))))) i am creating a serious application for my university degree:P I's a good ideea anyhow
|
|
|
|
|
How Could I Use a define macro identifier in an other define macro replacement list?
for example in the following example:
#define APP_TEST1 L"Test1"
#define APP_TEST2 L"Test2"
#define APP_TEST L"Test1 With Test2"
I want to represent the third define macro with 2 first macro?
|
|
|
|
|
#define APP_TEST APP_TEST1 " With " APP_TEST2
|
|
|
|
|
|
be really careful with macros, because it is hard to debug and in can lead to really bogouis errors.
=>
//const LPTCSTR APP_TEST1 = L"Test1";
const LPCTSTR APP_TEST1 = L"Test1";
...
Code quality is also an important issue
Press F1 for help or google it.
Greetings from Germany
modified on Friday, March 19, 2010 3:30 AM
|
|
|
|
|
KarstenK wrote: const LPTCSTR APP_TEST1 = L"Test1";
It should be LPCTSTR .
|
|
|
|
|
Good catch
|
|
|
|
|
Hi;
I am working on a project involving a PC onboard a robotic vehicle transceiving (say using Wifi 802.11 connection) sensors' info to another PC housed in another moving vehicle. There are data exhchanges in both directions in real-time. I am totally new to networking/comm between PCs. Please point me to sample code/tutorial on this topic.
Thanks.
Fun Wey
|
|
|
|
|
|
I have a function that will be called for all sorts of windows (it gets the HWND), and I want it to process only static icons, but not other types of controls like buttons, combos, etc. There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
|
can i convert unicode string to multibyte?
|
|
|
|
|
I like to use WideCharToMultiByte[^] Величие не Бога может быть недооценена.
|
|
|
|
|
or
WideCharToMultiByte[^] ... txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
|
|
or use like this:
#include "StringA.h"
#include "StringW.h"
CStringW sTestW( L"Test" );
CStringA sTestA( "Test" );
CStringW sConvertW = sTestA;
CStringA sConvertA = sTestW;
</pre>
|
|
|
|
|
I have displayed a bitmap on the screen.Now i want to save it in the harddisk after performing some painting operations on it.How do i achieve this?Please help.
Thanking you in advance,
Ashwath.
|
|
|
|
|
Try it :
CImage::Attach(HBITMAP);
CImage::Save(LPCTSTR);
CImage::Detach(); virtual void BeHappy() = 0;
|
|
|
|
|
Please let me know if we can use CImage code in VS2008.
Thanks,
Ashwath.
|
|
|
|