|
Did you also declare the paint handler in the header file?
// Generated message map functions
//{{AFX_MSG(CYourDialogClassNameHere)
...
afx_msg void OnPaint();
...
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
|
|
|
|
|
Sure did
|
|
|
|
|
I am baffled.
Just some ideas off top of my head here:
Does the erase background message get called? This at least lets you know the parent-child relationship is set up okay.
Can you call Invalidate() and UpdateWindow() on your control to FORCE a paint message to it? Just to be sure the 'regular' paint messages are not masked out by something else, like maybe child rectangle clipping or some other wierdness in the parent window?
|
|
|
|
|
Seems OnEraseBkgnd isn't being called either!
Calling Invalidate() and UpdateWindow() cause WM_PAINT messages to be show up in Spy++ they always have an hdc 00000000.
|
|
|
|
|
Do you have a static control or some other control on the resource dialog template that this 'custom control' will override?
If that is the case, then you need to also make sure you have 'subclassed' the instance of your MFC custom control so that it is 'attached' to the 'real window' of the control from the dialog template. If not, then in the OnInitDialog function you must 'create' the 'real' window for the custom control to use.
For example, suppose you already place a static frame control onto the dialog template with control identifier IDC_MYCSTMCTRL, and in the header file you have declared an instance of your custom control:
CMyCustomControl m_MyCustomControl1;
Then in the OnInitDialog you can call
m_MyCustomControl1.SubclassDlgItem(IDC_MYCSTMCTRL, this);
Which should attach the CWnd control instance to the 'real' window created from the dialog template.
If this were done by the ClassWizard, and placed into the DoDataExchange, it might look something like this:
DDX_Control(pDX, IDC_MYCSTMCTRL, m_MyCustomControl1);
|
|
|
|
|
That's it! There was a typo in my DDX_Control line, i.e. it was accessing a wrongly numbered IDC_CUSTOMx control, one which existed in resource.h but wasn't in my main dialog.
I'm now getting WM_PAINT etc. messages and I'm getting called at the right place.
Cheers!
|
|
|
|
|
phaderunner wrote:
My OnPaint method never gets entered.
How are you verifying this?
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
TRACE at the entry point to the function and Spy++ looking at the control. Seeing if WM_PAINT messages in Spy++ correspond with TRACE outputs in the debugger.
|
|
|
|
|
Hi,
I have an activeX control which is displayed in the Internet Explorer via the object tag. Now, as you probably know, you can pass parameters to the activeX control by using the param tag.
My question now is, how do I get these parameters in my activeX control.
I read about IPropertyBag, but didn't find a good example on how to implement that. I even don't know whether this is the right way to get the parameters.
Does anyone know how to realize that?
I hope so.
Thx in advance,
mimmi511
|
|
|
|
|
hiho@ll
is it possible to make a MFC bho which could use MFC controls?
|
|
|
|
|
Hi,
I'd like to create a popup menu with a titlebar to move the menu. For that I thought to create a toolbar in vertical order and with horizontal popup menus. Does anybody know how to create it with MFC?
thanks a lot
|
|
|
|
|
Does anyone know what the code is to generate LM hashes?
|
|
|
|
|
I'm having trouble opening a 3 GB file. I've never had to open a file so large before and I'm nost sure what to do. I've tried fopen and open functions but the program fails to open the file. Any suggestions?
|
|
|
|
|
How are you attempting to open it? The fopen() and open() functions should be limited to older C programs. For newer Windows programs, use CreateFile() instead.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
To use CreateFile() I must have the Coredll.lib. Where do I find this lib?
|
|
|
|
|
Oops..nevermind I was in the WindowsCE part of MSDN..
|
|
|
|
|
|
Thanks so much for your help...CreateFile worked..
|
|
|
|
|
hiho@ll
i try to do something like a newsticker on a browser helper object
the problem is that the helper object is made using ATL and i want to use CStatic (because there are some classes, which scroll text using a CStatic)
my problem is that CStatic is a MFC class and i need it for my ATL browser object!?
are there alternatives or other controls i could use for my problem?
btw, is it possible to convert my BHO to a MFC BHO?
or is MFC BHO not supported by IE?
if it's possible, how can i do it (easily, without troubles?)
I'm using Visual Studio .NET
thx
|
|
|
|
|
ThinkingPrometheus wrote:
my problem is that CStatic is a MFC class and i need it for my ATL browser object!?
You can not directly add a mfc class to ATL.
John
|
|
|
|
|
and how can i make just a simple static text control in ATL?
|
|
|
|
|
You already have one. A static control (STATIC ) is a regular Windows control, just like BUTTON , EDIT , etc.
You are still going to have to do some drawing yourself; the regular static control works by characters, and does not "smooth scroll" like a news/stock ticker.
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Tip for new SUV drivers: Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
How do i use the STATIC in my ATL projects i am new to ATL.
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
Using CreateWindow, you just specify the string _T( "STATIC" ) as the window class name, IIRC.
I think that ATL's window classes have a wrapper class for the static control.
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Tip for new SUV drivers: Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
hello all
can you please help me with one thing
i need to know about a very good security application on the internet which i can implement using VB.
sumthing like a digital signature/certificate and stuffs like that.
or maybe an email security thing.
i need it for a project,where i will compress a file,ecrypt it and then send it on the net.i need an amazing security application which is in VB.
plz help
hey there,v are sailing in the same boat
|
|
|
|