|
Thanks for your reply. I have tried above code but it is giving me following error
"fatal error C1083: Cannot open type library file: 'libid :00020813-0000-0000-C000-000000000046': No such file or directory" on VC++ 6.0. what needs to be done in order to compile this.
Thanks
SNI
|
|
|
|
|
VC 6.0...that doesn't support using a libid for #import. You'll have to find the Excel type library file yourself and import it.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
HI
i have given a path of cmd.exe while debugging a console application in "Executable debug session " dialog box.
Please tell me how to remove it .
Thanks
|
|
|
|
|
In the project properties, the path for cmd.exe will be available in Debugging -> Command.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Hello,
I have a window derived from CMDIChildWnd which when maximized doesnt merge with the main window.
class TableFrame : CMDIChildWnd
{
afx_msg void OnSize(UINT nType, int cx, int cy);
}
void TableFrame::OnSize(int nType, int cx, int cy)
{
switch(nType)
{
case SIZE_MAXIMIZED :
{
CRect ParentRect;
GetParent()->GetClientRect(ParentRect);
MoveWindow(ParentRect,true);
break;
}
}
Prithaa
|
|
|
|
|
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;
|
|
|
|