|
abiemann wrote: However, I keep getting an Assert error when I populate the CStatic with text.
Most likely because the control does not yet exist.
abiemann wrote: However, this code (within OnInitDialog) fails every time with the Assert error:
Does this code get called after CDialog::OnInitDialog() is called?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
this code:
#include "myDlg.h"
....
BOOL CSistemaPOSDlg::PreTranslateMessage(MSG* pMsg)
{
if(pMsg->message==WM_KEYDOWN
{
switch ( pMsg->wParam )
{
case 106: // '*' was pressed - Asterisc numeric keyboard
CallMyDlg();
break;
case VK_RETURN:
.........
break;
default:
break;
}
}
return CDialog::PreTranslateMessage(pMsg);
}
BOOL CSistemaPOSDlg::CallMyDlg()
{
CmyDlg pDlg;
pDlg.DoModal()
}
Pretranslate return me an Assertion failed when return from myDlg!! Way??
|
|
|
|
|
What is the reason for the assertion? Where does it occur?
Is there a reason you need to handle messages in PreTranslateMessage()
instead of handling them the usual MFC way?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Just try to call the CDialog::PreTranslateMessage(pMsg) before the CallMyDlg(). I think the problem is because the DoModal will initiate a different message loop, thus the current message may be handled by this second message loop. So when the CDialog::PreTranslateMessage is called, the current message will be different or none. (Only a guess ) )
- NS -
|
|
|
|
|
Does Exist a way to release, or kill the loop from myDlg before return to the parent?
|
|
|
|
|
You mean exit from the application?
Or simply skip the current loop of PreTranslateMsg?
- NS -
|
|
|
|
|
the current loop, may be only with return;
|
|
|
|
|
I think you need to skip the * key hit, right? If so you can just assign pMsg->message = WM_NULL. Then the allowing the current loop to continue.
- NS -
|
|
|
|
|
I have an application where we display the image from a framegrabber. Before it used to work fine, but last week I reinstalled XP since my RAID0 has failed. Now, whenever I run the SAME applicaiton it shows the video fine, but freezes briefly whenever I use any drop down menus on the application's interface and then runs fine again. THis happens only for drop down menus while it works fine when I use any other scroll bars and slide bars, buttons on the interface.
Has anyone came across such a problem before?? The only difference is new XP installation.
thanks
Pavan
|
|
|
|
|
HI,
I'M Studing a course to prevent SQL INJECTION
if anyone can help me with finding open source Code (of an app) in C++
That's doing Blind QSL Injection :
U Enter a URL, & it Checks :
1. if an SQL is availble
2. if ( *2 == TRUE ){DO a Blind SQL INjection Till u Secseed and gives INFO )
TNKS
kobkob
|
|
|
|
|
Greetings everyone,
Using MFC, I want to post a windows message which is same as a keyboard input. So that, another thread, which reads the keyboard inputs, will get the input as if it is from the keyboard.
Could someone please help? Thanks a lot.
Best regards,
zwl
|
|
|
|
|
What about keybd_event() ?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Thanks for the tip. I will try.
Regards,
|
|
|
|
|
|
I am very new to VC, I am trying to load a jpg and display it
I am trying to create from the class CImage m_Image; in the opendocument
section
when trying to build my project I get undeclared identifier
do I need to use the include with the name of the mfc
could you tell what this name is and where to putit in the file
Simon Smith
|
|
|
|
|
Does #include <atlimage.h> help?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Whats your compiler? and also you can use of GDI+ for show Jpg files.
|
|
|
|
|
Using MFC
Do you have any sample code for the gdi
email me at simonsmithtelford@blueyonder.co.uk
|
|
|
|
|
For CImage class see this code
CImage m_Image;
m_Image.Load("C:\\1.jpg");
m_Image.BitBlt(...);
and for GDI+
#include <gdiplus.h>
using namespace Gdiplus;
Graphics graphics(GetDC()->m_hDC);
Image m_image(L"c:\\1.jpg");
graphics.DrawImage(&m_image, 800, 600);
dont forget to import lib file.
and other way you can use of
OleLoadPicture .
|
|
|
|
|
i want to know how to use openCV beta 5 with mfc in VC6. Any tutorial or guidance for it, would be appreciated.
Thanks
|
|
|
|
|
Is there a way to fix(make it unmovable) a non-full-screen dialog's location or position on the screen?
|
|
|
|
|
Well, for moving via the caption, you could respond to the WM_NCHITTEST message, and instead of returning HTCAPTION , return something else like HTBORDER .
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Would I be better off trying to override the WM_WINDOWPOSCHANGING message?
|
|
|
|
|
Why not just try it and compare the two results?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
One problem regarding this is that we can move the window by taking the sys menu -> Move, and then using arrow keys.
- NS -
|
|
|
|