|
You could try checking with your debugger that your window class fulfils the requirements specified here[^]. Other than that, lots of breakpoints and single stepping through code seems to be the path you must follow.
|
|
|
|
|
The client area consists of the view.
That's the reason why the control flow does not enter the OnLButtonDblClk handler of the frame class.
You will need to create a handler for OnLButtonDblClk in the view class.
However, you can create a handler for OnNcLButtonDblClk in the frame class where the double click on an area outside the view will be handled like the edges of the window, title bar, menu bar etc.
|
|
|
|
|
I try that, and does function where you said : menu area, etc. ... I need to know if the user fire double-click between those areas ... right near client area, I mean in dark area of CMainFrame ...
|
|
|
|
|
I don't think you will get double click messeages in the dark area.
You will however be able to trap the WM_LBUTTONDOWN message in the PreTranslateMessage override in the main frame class.
|
|
|
|
|
Good ideea, I will try tomorow ... thank you.
|
|
|
|
|
I try in follow way :
BOOL CMainFrame::PreTranslateMessage(MSG* pMsg)
{
if(pMsg->message == WM_LBUTTONDBLCLK)TRACE("OnDblClick - PreTranslateMessage\n");
return CMDIFrameWnd::PreTranslateMessage(pMsg);
}
but I don't see any traces when I double-click on darrk area of mainframe ... only in CView client area ...
|
|
|
|
|
As I said in my previous message, you will only be able to get WM_LBUTTONDOWN messages.
|
|
|
|
|
// client zone of CMainFrame
Please let the Spy++ Tool to confirm your assumption
(it could be another window)
They sought it with thimbles, they sought it with care;
They pursued it with forks and hope;
They threatened its life with a railway-share;
They charmed it with smiles and soap.
|
|
|
|
|
Hi All,
After reading about parallel programming by multicore processor,I have some doubts.
1>Its undoubtedly best idea for play stations,X-Box [as they have soo... many cores]
But will it prove to be effective for core i7 running 8 parallel process then running 100 thread in Windows 7 64 bit?
2> If some how its managed to make all the process running parallel with less critical resource to then will it give better performance over 100 thread?
3>If not then in which case I can see multicore programming[I am trying VC++ with Opem MP] winning over multi thread in my i7,win 7[64 bit] ,4GB ram?
[it will be great If I can get a code in C++ or JAVA to run in my machine to compare same task running 1>parallel,2>sequence,3>thread]
Eagerly Waiting for the response.
Thanks in advance.
|
|
|
|
|
See here[^]; please post your question in one forum only.
|
|
|
|
|
I am facing problems in launching my dll application. which is launching correctly for some PCS but it is not launching for some other PCS. Pls check the 2 attachments.
one is working.jpeg which is working fine. it is expected that when clicking on launch button from client this should show the screen with the CAD model. for some pcs this is working.
Check the other attachment which not-working-screen-shot.png which on launching the application it's not displaying the model. it is a grey color screen whethe there's no opengl window even.
I have developed this dll application in dialog based window. Pls help resolve this problem. Thanks a lot in advance Sujan
Check the attachements in codeguru. thread name as this thread name "dll application is not launching for some PCS" under VC++ programming.
|
|
|
|
|
What do you mean by "dll application"? You cannot launch a DLL, it can only be loaded from a running executable file. As to your links, if you cannot post them here I do not think anyone is going to go searching for them. Also without some further information than "doesn't work", it's anybody's guess what is happening.
|
|
|
|
|
Richard MacCutchan wrote: . Also without some further information than "doesn't work", it's anybody's guess what is happening.
Come on, Richard. This is exactly why you should stop using Windows 95. It just doesn't have the guessing capability that newer OSs do.
"One man's wage rise is another man's price increase." - Harold Wilson
"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
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
|
I have a Delphi application which Creates a shared memory uses CreateFileMapping, OpenFileMapping, MapViewOfFile functions.
Now I wanted to share the same memory for my MFC application. I used the OpenFileMapping, MapViewOfFile functions.
I created a structure exactly same in size as the Delphi application and mapped the structure object.
sample code:
HANDLE hMapObject2;
hMapObject2 = OpenFileMapping( FILE_MAP_ALL_ACCESS, FALSE, "PP101U3_SHARED");
if( !hMapObject2 )
{
AfxMessageBox("Failed to open Simpack DataBase");
return( 0 );
}
Simpack = ( struct SIMPACKDB *) MapViewOfFile( hMapObject2, FILE_MAP_ALL_ACCESS, 0, 0, 0 );
if( !Simpack )
{
AfxMessageBox("Failed to create Simpack File Map View");
return(0);
}
Esim->SPV1 = Simpack->SP_Z;I am able to read the values exactly correct for all the member variables in the structure.
But when I try to write value in the shared memory, its not changing. It shows the previous value immediately in the debugger watch window.
The value of Simpack->SP_Z[15] is 0.5010 as read from the shared memory which is got from the Delphi application. i.e., value set by the Delphi application
When I set or write the value of the same variable to the shared memory in my MFC Application using the code:
Simpack->SP_Z[15] = 0.6123;
or
float test = 0.6123;
memcpy( Simpack->SP_Z + 16, &test, sizeof(float));it still shows the previous value 0.5010 which is got from the Delphi Application. But When I change the same variable's value in the Delphi applicationit changes and the changed value can be read here in the MFC application.
Please help me to find why I am unable to write or set value in the shared memory from my MFC Application and suggest me with any code how to write the values in the shared memory from my MFC Application.
Is there anything wrong in the code?
Is this happening because I am sharing the memory that is created by a Delphi Application from a MFC Application? i.e., Sharing memory between Delphi and MFC Application is not allowed.
|
|
|
|
|
You may need to use #pragma pack compiler option round your structure, as C++ (in Windows) tends to align structures at word boundaries by default. As to your second problem, you may like to check this sample[^] to see if you are missing something.
|
|
|
|
|
Hi Guy,
I am trying to add checkboxes to the multiple columns of a MFC List ctrl.
Can you please help me in this. If possible please share me some snippet for the same.
Thanks.
asdasdadadasd
|
|
|
|
|
|
You can also look here[^], these list control can have any control in any column ...
modified 16-Jun-12 5:16am.
|
|
|
|
|
Hi all,
I'll try to explain my question as much as quickly. Actually its not a question, but a clarification I am looking for.
Say I have a two code blocks which is doing two different things. I can implement those two blocks in two functions and call as I need from a third function. Or else, I can implement those two blocks in the third function and used goto jump between blocks. So what is the difference between two?
Thanks for all the comments in advance.
If you've never failed... You've never lived...
|
|
|
|
|
// So what is the difference between two?
I would say
- stack
- accountability for the heap (de-)allocations
- perfomance
- re-usage of the functions
- readability
What thesis does stay misty for you ?
They sought it with thimbles, they sought it with care;
They pursued it with forks and hope;
They threatened its life with a railway-share;
They charmed it with smiles and soap.
|
|
|
|
|
A goto wont add stuff to the stack like a function call will.
But the problem is that the code that you goto has to get back somehow, which means embedding a label in your code, which means you goto code would be better just put in your calling code. So really, you should use a func, it will be easier.
Gotos are useful for exiting funcs in error conditions. (Often replaced by a do{}while(0) these days).
==============================
Nothing to say.
|
|
|
|
|
People will hate you if you use goto , it makes the code more difficult to test, debug and maintain; stick with functions.
|
|
|
|
|
This is pure dogma. Any code can be crap and hard to maintain and goto when used judiciously is perfectly OK.
For example:
myfunc()
{
do{
if(!somefunc())
continue;
if(!someotherfunc())
continue;
}while(0);
}
Is heavy when compared to:
myfunc()
{
if(!somefunc())
goto end;
if(!someotherfunc())
goto end;
end:
}
==============================
Nothing to say.
|
|
|
|
|
Erudite_Eric wrote: This is pure dogma.
Not at all. And what's wrong with:
myfunc()
{
if(somefunc() &&
someotherfunc())
{
}
}
|
|
|
|