|
Any tips on optimizing serialization performance when you have a lot (300,000) of small objects contained in nested ob arrays? Seems to be pretty slow, despite the small overall data size (6MB file). Looks like the performance issue is caused by the sheer # of objects.
|
|
|
|
|
Is there a message I can send to a Dialog Box that allows me to change its Border from "resizing" to "Dialog Frame"?
|
|
|
|
|
Borders are defined with styles WS_??? and/or extended styles ES_???
led mike
|
|
|
|
|
Thanks you are correct, it is WS_THICK for a resizable border and WS_BORDER for a regular one. My question is this, I have already created a dialog box that has a resizable border, is it possible to send a message to the dialog box and change it from WS_THICK to WS_BORDER without destroying and recreating the dialog box?
|
|
|
|
|
Is it the window style you want to change or merely prevent resizing? If it's your own dialog (you coded it) you can define a WM_USER message, check for the message in your main loop at set up the MINMAXINFO accordingly. Changing the window style is a little more complicated, you would have to use the SetWindowLong() function (again after receiving a custom message). If the dialog is another process, you will have to register the window message with the OS first.
|
|
|
|
|
You could handle the WM_NCHITTEST message. First call the default handler and if the cursor is over a resizable border simply return HTBORDER to disable resizing with the mouse. To totally disable resizing you would also have to disable the Size command in the system menu.
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
|
LONG_PTR style = GetWindowLongPtr(hwndDlg, GWL_STYLE);
SetWindowLongPtr(hwndDlg, GWL_STYLE, (style & ~WS_THICKFRAME)|WS_BORDER);
|
|
|
|
|
TheDelChop wrote: is it possible to send a message to the dialog box and change it from WS_THICK to WS_BORDER without destroying and recreating the dialog box?
Yes but it is not a "Message". The style bits are contained in the "window long" member. If you have a MFC CDialog then use CDialog::ModifiyStyle(...) otherwise use GetWindowLong(...), SetWindowLong(...) API's.
led mike
|
|
|
|
|
What code or class can I use to get the IP address of the computer my software will be running on? I am using Visual C++ (MFC) 2003. (No .NET)
|
|
|
|
|
What's wrong with gethostname() followed by gethostbyname() ?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Nothing is wrong with them, I just didn't know about those functions.
Thanks, I'll be sure to look them up.
Peace,
BP
|
|
|
|
|
does anyone possibly know how i would get my c++ application (w MFC in vc6.0) to emulate a normal left click? (press, release)
(that works globably, so it can be inactive/minimized and click in my applications for me)
thanks!
/Johannes
|
|
|
|
|
It usually requires sending the appropriate message to the control you want to interact with.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
So you mean that mouse clicking can not be globaly emulated? But keyboard buttons can be..
there must be some way?
thanks.
/Johannes
|
|
|
|
|
Johpoke wrote: So you mean that mouse clicking can not be globaly emulated? But keyboard buttons can be..
Where in the world did you infer this from. Controls respond to both keyboard or mouse, and either can be emulated. One such way is via SendInput() . There are likely other solutions, but without more details as to what you are wanting to achieve...
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
i searched for that and sneaked around to microsoft, were i found mouse_event, then i found this:
mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,NULL);
and
mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,NULL);
which does exactly what i need!
thanks!!
/Johannes
|
|
|
|
|
SendInput() has superseded mouse_event() on Windows NT/2000/XP systems.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Yep!
For longevity's sake, SendInput() should be used instead. mouse_event() is deprecated.
Mark
|
|
|
|
|
I want to hide windows when open the program.
I try to use
CWnd::ShowWindow(SW_HIDE);
in OnInitDialog it still no work
but
CWnd::ShowWindow(SW_MINIMIZE);
It's work.
Please suggest me how to solve the problem.
|
|
|
|
|
you use CWnd::ShowWindow(SW_HIDE); or this->ShowWindow(SW_HIDE); ?
|
|
|
|
|
I also try both
the result still same.
|
|
|
|
|
You can't use ShowWindow() in this fashion because one of the last things that happens with a dialog is a call to ShowWindow(SW_SHOW) , effectively overiding your attempt to hide the window. The solution is to handle the WM_WINDOWPOSCHANGING message, and then remove the SWP_SHOWWINDOW flag.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
The Code Project Visual C++ Forum FAQ
7.6: I have a dialog-based application and want the dialog hidden on startup. How do I do this?
http://www.codeproject.com/cpp/cppforumfaq.asp#mfc_hidedlgstartup[^]
--EricDV Sig---------
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
- Laurence J. Peters
|
|
|
|
|
|
Max++ wrote: How to Hide windows
Install Lynux
led mike
|
|
|
|