|
|
The MSDN sample is called DLGTEMPL, you can get it from msdn.microsoft.com if you don't have msdn on your PC. I'd post some code for you, but it's Saturday morning and it's all at work
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
Howdy all,
I've been stumped on something for a while now. I've got a CEdit subclass that I'm writing to change all sorts of nifty colors, but I can't seem to change the color (usually blue) that gets drawn as the background for text that gets highlighted. I've tried setting a breakpoint in the OnChildNotify function (which as I understand gets ALL messages) but it doesn't even trigger when I highlight text. Is changing the behavior something that I'm unable to do (maybe it's internal to windows)? Any ideas - if nothing else I'd just like to get to the bottom of it and satisfy my curious mind...
Thanks,
Dave
|
|
|
|
|
I think you want COLOR_HIGHLIGHT. This is a global setting so would have to be careful to reset it when finished. GetSysColor/SetSysColor
|
|
|
|
|
Hi Every one...
In debug Mode my application compiles properly and give
perfect out put.
But when i try to compile it in Relese Mode , It gives
Linking error.
Specified as below.
/////
error LNK2001: unresolved external symbol "char const *
const _afxPchNil" (?_afxPchNil@@3PBDB)
fatal error LNK1120: 1 unresolved externals
///
Can neone guide me for the same ..
Thanks in advance
Stago
|
|
|
|
|
Check your project settings, make sure your not missing a library or header in the release settings.
|
|
|
|
|
Hi,
i developped a class derived from static to represent real time data chart. To do this i used BitBlt.
I want to port this to an activeX control bun when I create an activeX with the wizard, i cannot accomplish Bit blitting.
Does someone have a solution ?
|
|
|
|
|
In classwizard generated code I find the following comment:
// Do not call CDialog::OnPaint() for painting messages
I don't really get it. What is the OnPaint function used for if not for painting? Is this the correct place to put my code for redrawing the window?
Do I update controls from here?
Could someone enlighten me on this?
Thanks
Josh
josh@that-guy.net
|
|
|
|
|
yes, you can use it for painting. just don't call it yourself (do an Invalidate, if you want to force a redraw)
if you update controls there, your controls will be VERY busy (it gets called a lot)
-c
------------------------------
Smaller Animals Software, Inc.
http://www.smalleranimals.com
|
|
|
|
|
I'm assuming I should delegate control updates into other message handlers. Is that a better way to do it?
Josh
josh@that-guy.net
|
|
|
|
|
That line just means that you can't call the base class implementation for a WM_PAINT message, because it won't work. If you really need it, you can call it, but change CPaintDC to CClientDC in the derived class (you will lose updated region info).
I can't remember if the base implementation of OnPaint actually does something. In case it doesn't, use Default().
Paolo
------
"airplane is cool, but space shuttle is even better" (J. Kaczorowski)
|
|
|
|
|
Where to download e-books about "COM"?
Thanks.
Maer
|
|
|
|
|
Now I want to handle the message of WM_MOUSEWHEEL. But while I add this handler in the message processing function, the VC++ compiler tell me that
error C2065: 'WM_MOUSEWHEEL' : undeclared identifier
but the WM_MOUSEWHEEL is identified while I check in the MSDN, and no other header file is requested in the help of MSDN.
|
|
|
|
|
WM_MOUSEWHEEL is declared in winuser.h; are you #including windows.h?
|
|
|
|
|
Use this line:
#define _WIN32_WINNT 0x0500
Should work,
Jerzy
|
|
|
|
|
Use this line:
#define _WIN32_WINNT 0x0500
Why?
The Platform SDK Doc. say that it should also work under Win9x...
With that define, the application might only wotk under Win2k.
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
You might need to install the Platform SDK.
It updates your headerfiles to newer versions...
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
How to check out whether a file is existing?
Thanks.
Maer
|
|
|
|
|
You'd use the FindFirstFile() Win32 API function. Assume pstrFile is a pointer to the string filename below:
WIN32_FIND_DATA findData;
HANDLE hFile = FindFirstFile(pstrFile, &findData);
bool bExists = (hFile != INVALID_HANDLE_VALUE);
If the handle returned by FindFirstFile() is INVALID_HANDLE_VALUE, the file doesn't exist.
|
|
|
|
|
Try this:
BOOL FileExists(CString* fn)
{
BOOL exists = FALSE;
if (!fn.IsEmpty())
{
int status = _access((const char*)fn,0);
if (status == 0)
{
exists = TRUE;
}
}
return exists;
}
|
|
|
|
|
Hi, Simmons.
Thanks for your codes pal.
Best regards.
Maer
|
|
|
|
|
Hello!
When You/I create an standard MFC application it will insert an icon for the app, the wellknown MFC icon. If I start the program then the icon will have the same background color as the 'Window banner' (if you are using the standard colors). If you change focus to an another program then the 'banner' will get 'grey' but the icon will still have the same background color (darkblue).
I see in other program, e.g. Visual Studio, that the background color of the icon changes not only when focus change but also when changing the Windows color scheme.
How do they do this??
// Anders
|
|
|
|
|
> How do they do this??
With trasparent background!
MFC Icon is not transparent at all...
Paolo
------
"airplane is cool, but space shuttle is even better" (J. Kaczorowski)
|
|
|
|
|
Don't you think that everything is easy when you know how
OK, then I need to get me an Image editor that can create transparant backgrounds
Thank you very much for the answer!
// Mike
|
|
|
|
|
Yep, but you can use VC++ resource editor too!
To select the transparent color, click on that dark-cyan little screen icon in the color palette. The magenta one is for inverted background.
Paolo
------
"airplane is cool, but space shuttle is even better" (J. Kaczorowski)
|
|
|
|