|
prithaa wrote: I have a window derived from CMDIChildWnd which when maximized doesnt merge with the main window.
That's nice.
Is that a problem or not? Difficult to say as you're not asking a question...
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
...and what is your question?
Codeproject MVP for C++, I can't believe it's for my lounge posts...
|
|
|
|
|
Thanks for your replies
My question is when the child window is maximized it doesn't merge with the main window.
How should I do it?
Prithaa
|
|
|
|
|
Why are you changing things in WM_SIZE? Just let windows do it's job, and it will do it by itself.
I think the reason that it's failing is that you're getting in the way! WM_SIZE is largely meant for information purposes, or changing scroll bar meanings, etc.
Create a brand new MDI project, don't add any code, and you'll see if I'm right or not.
Iain.
Codeproject MVP for C++, I can't believe it's for my lounge posts...
|
|
|
|
|
Thanks for answers
I ll do that and see.But I have done that earlier , what happened at that time was the child window merged with the main window but now the main window didn't get restore button , the main window has minimize,maximize and close buttons
Prithaa
|
|
|
|
|
If it's anything like any MDI program I've worked on, the main window keeps it's normal buttons, but gains a smaller set just below them for the MDIChild.
I feel pretty sure that the bare wizard generated MDI app will work that way. If yours does not, you'll have to tear away more of your software until you get back to basic behaviour, then build back up again.
Iain.
Codeproject MVP for C++, I can't believe it's for my lounge posts...
|
|
|
|
|
Thanks for your replies
I ll check up
|
|
|
|
|
I have a program that connects to a database in a local 2008 SQL server to create a couple of tables. On most machines the connection time is about a second but on mine it was taking several seconds. I've just discovered that if I change the connection protocol from shared memory to TCP/IP, the connection time drops back to around a second. The same problem occurs if I boot either Vista64 or Windows 7 beta (two separate SQL server installations). The main difference between my machine (HP xw4600) and others is the CPU, I have a quad core where as the others will be dual cores. Can anyone suggest what may be wrong?
|
|
|
|
|
I can imagine that it takes longer to create and open the file mapping for shared memory, than it takes to create a new socket and connect to the server socket.
But that's only a one time cost. Why not do some testing to see if the performance for using the database is faster or slower for one type of connection over the other?
|
|
|
|
|
There's no problem with speed once the connection has been established. I've also discovered that I only had to enable TCP/IP to speed up the connection. Previously I was disabling shared memory as well. The order of preference has shared memory before TCP/IP so I've no idea what's going on!
|
|
|
|
|
I am making a project depending on mfc. in this project ,i created a object(here named it xobj) ,which is defined by myself, in the cmainwnd object construction, and destructed it in the cmainwnd object destruction. but in one cmainwnd object member function,i created a thread and also pass the pointer of the xobj into the thread. When the application is closed, destruction of cmainwnd object is called so as the xobj destruction,but at some time the thread is not end ,it still has the pointer of the xobj which means nothing now.
How to solve this?
I have tried the event,I made the del xobj wait until the thread is end in the destruction of cmainwnd object.but it seems not work.why?
|
|
|
|
|
tyr2000 wrote: I have tried the event,I made the del xobj wait until the thread is end in the destruction of cmainwnd object.but i seems not work.why?
Post some relevant code of your destructor.
|
|
|
|
|
relevant code? can you give me some more details about the relevant code ?
i'd appreciate it very much.
|
|
|
|
|
Well, the code from your destructor but only things that are related to your problem (+ explanations of the variables if needed).
|
|
|
|
|
sorry ,i can't totally understand you. could you pls give some sample code? or just explain it clearly? do you mean i should do some thing in the destructor of cmainwnd object? if so ,what is the "some thing"?
sorry for my poor english
thank you again.
|
|
|
|
|
C'mon, it's not that difficult to understand is it? I asked YOU to post the code of your destructor so that WE can see YOUR code on this forum (by 'post' I mean that you just reply and you include the code in your reply message). Your explanation was not very clear, so looking at your code might help us to locate your problem. By relevant I meant that you shouldn't post all the code from your destructor but only the parts which are related to your problem.
And please use the code ("code block") tag (just above the emoticons) to format your code so that it is readable.
|
|
|
|
|
thank you for your patient. i will post the brief sample code tomorrow.pls help me then.
It is late night in my contry.
|
|
|
|
|
tyr2000 wrote: It is late night in my contry.
Your profile indicates you are in the USA. Is that not correct?
"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
|
|
|
|
|
my profile is not correct.Maybe i should make it right.
|
|
|
|
|
class CMainframe:: public CFrameWnd
{
cmainframe()
{
XOBJ* m_xobj= new XOBJ;
}
~cmainframe()
{
del m_xobj;
}
void xfunction()
{
ParaForThread =&m_xobj;
HANDLE handle = CreateThread(NULL, 0,ThreadProc, ParaForThread,0,NULL);
closehandle(handle );
}
XOBJ* m_xobj;
};
DWORD WINAPI ThreadProc(LPVOID lpParameter)
{
XOBJ* obj = (XOBJ*)lpParameter;
for(int i;i<1000;i++)
{
obj->somefunction;
}
}
my assumed simple sample,pls help;
|
|
|
|
|
you know about the code which is relevant to the problems you have.
This signature was proudly tested on animals.
|
|
|
|
|
tyr2000 wrote: relevant code? can you give me some more details about the relevant code ?
Relevant code.
"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
|
|
|
|
|
thank for english teaching
|
|
|
|
|
You need to synchronize the main thread (that's the one the CMainWnd is running in) with the other thread. In addition, have you at any point told the other thread to exit? If not, it won't, until the application exits.
Without seeing code, it's difficult to say much more.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
i think your answer lighten me up. after creating main thread creating the thread ,i used closehandle();do you me if i hold the handle of the thread, the problem will not hanppen? aslo there is no more synchronize work needed?
|
|
|
|