|
Thanks so much Steve - if only I'd posted this question 3 hours ago!
Multimedia programmer, trying to learn a grown-up language!
|
|
|
|
|
How to change the color and title of AfxmessageBox?
Deepak Samuel
|
|
|
|
|
Afaik you can change neither the color nor the title of a message box called by AfxMessageBox(...). You should use CWnd's MessageBox(...) instead, where the title is one of the arguments. But changing the color doesn't work, I'd say you need to write your own message window to do that.
We are men. We are different. We have only one word for soap. We do not own candles. We have never seen anything of any value in a craft shop. We do not own magazines full of photographs of celebrities with their clothes on. - Steve
|
|
|
|
|
AfxMessageBox looks for a string resource with an id of IDS_AFX_IDS_APP_TITLE and uses that for the title if it can be found, otherwise it uses the executable name otherwise. You can't change the colour - that's determined by the user's preferences.
|
|
|
|
|
Sorry, cut & paste error. The resource id should be AFX_IDS_APP_TITLE
|
|
|
|
|
I have a situation where I need to read values from the registry without knowing in advance what values might be there. Can anyone suggest example code to read every value under a particular key ?
Many thanks.
|
|
|
|
|
Hi,
Check out my Registry class.
You can find it on www.xfcpro.com under the "Free Stuff" section, the funtion you want is EnumerateValues().
Feel free to steal the function, use it as a basis for your own or whatever.
regards,
Jonathan
|
|
|
|
|
Not sure what the correct etiquette is here but thought I would post to say thanks, I appreciate the leg up.
|
|
|
|
|
no problem
|
|
|
|
|
|
How to call virtual method at CWnd derived class,
- with mutual inheritance?
that is:
I create commin class with virtual method,
make it parent of some CDialog derived class,
than when a Want to call I assign pointer to CDialog to
that common class, and call virtual method -
and
access violation ERROR !!
why so happens?
where I did error ?
code is
<br />
<br />
class CCustomUpdaterTrait<br />
{<br />
public:<br />
virtual void CustomUpdate()
{};<br />
};<br />
<br />
class CDialogDerived: public CDilogBitmap,public CCustomUpdaterTrait<br />
{<br />
<br />
<br />
};<br />
<br />
class CCustomUpdaterCaller: public CCustomUpdaterTrait<br />
{<br />
<br />
f(CWnd* pWnd)<br />
{<br />
<br />
CCustomUpdaterTrait pTrait = (CWnd*) pWnd;<br />
<br />
<br />
pTrait->CustomUpdate();
<br />
};<br />
};<br />
<br />
thanks
|
|
|
|
|
Dear all
Can anyone please tell me how to use the stretch command in cximage for printing??
Thankyou
|
|
|
|
|
howto do a splitter in mfc without using views?
example: Dialog App
Leftside Listctrl
Rightside Treectrl
Bottom Listbox
|
|
|
|
|
AFAIK, CSplitterWnd::CreateView() can be called with a pointer to any CWnd-derived class instead of only a CView-derived class.
And I seem to remember that somewhere on CP is an article describing how it works. Probably in the Splitter-Window section. I am just too lazy to search.
Who is 'General Failure'? And why is he reading my harddisk?!?
|
|
|
|
|
I'm experimenting with debug tool to report memory leaks. The idea is to create substitute for new and delete operators. I'm using a template function New, and a macro NEW (different for debug and release).
Example below:
<br />
#ifdef _DEBUG<br />
#define NEW(t) (t)*New<t>(__FILE__,__LINE__)<br />
#endif //#ifdef _DEBUG<br />
<br />
template<class T> T* New(char * File,int Line)<br />
{<br />
T* Pointer=NULL;<br />
Pointer=(T*)new T;<br />
... other code ...<br />
}<br />
This works perfectly for calls like:
<br />
int * a = NEW(int);<br />
int * b = NEW(int[10]);<br />
But the problem is dynamic size of arrays. In this case compiler cannot create template function for types not known at compile-time. So call like this one will not work:
<br />
int a = 10;<br />
int * b = NEW(int[a]);<br />
The error (in VC++ 6.0) is:
error C2540: non-constant expression as array bound
Any ideas of redefining the macro or the function to accept array size as a separate argument?
[ CoY0te ]
Railgun is like a Gilette Mach 3 - it does the job with one, easy stroke.
|
|
|
|
|
No HTML tags this time. The code again:
#define NEW(t) (t)*New<t>(__FILE__,__LINE__)
template<class T> T* New(char * File,int Line)
{
T* Pointer=NULL;
Pointer=(T*)new T;
.....
)
Hoping for any help...
<b>[ CoY0te ]</b>
<small>Railgun is like a Gilette Mach 3 - it does the job with one, easy stroke.</small>
|
|
|
|
|
Aside from sourceforge.net, there are two link to open source C/C++ resources, both are good stuff:
TLTOOLS
Data Analysis Framework
Enjoy programming C/C++!
|
|
|
|
|
thanks man.
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
Hi
I'm working on an MFC application, and I need to make changes to some of the menus.
I use the resource editor or edit directly in the resource file. When I for instance
change a menu name, I notice it is changed in the resource file, but it is not changed in the running exe file.
It is only menus that has this problem. When I change something in a dialog, in the same resource file, changes are immediately shown when running the build.
I find this very strange, any help will be greatly appreciated.
Best regards,
Oliver
|
|
|
|
|
Are all your resources in the same language?
We had "issues" at one point with strings in ENGUS and ENGUK blocks, and sometimes they would fail to load.
Steve S
|
|
|
|
|
Thanks,
But yes, they seem to be in ENGUS all of them.
Best regards,
Oliver
|
|
|
|
|
Where can it get the "old" strings from ?
I can't find the old menu names anywhere in the code,
and it must be using the resource file, since other changed parts of the file are being used.
How can I force it to update ?
I have tried rebuilding all and deleting the .res file...but it didn't help.
Regards,
Oliver
|
|
|
|
|
Is it cleanly compiling the RC file?
You could quit VC6, remove the .res and .aps files (the former will be in your Debug/ or Release/ folder, the latter in your source directory, then try building those.
The APS file is a hangover from the days of 'Application Studio', I think, when the IDE didn't include a resource editor in the same environment.
Steve S
|
|
|
|
|
Thanks.
I tried removing the .res and .aps files, but without success. All obj files seems to be up to date.
But now I've tried building the project on my home computer, and here there are no problems. Everything is working fine. So maybe it has something to do with the project not being set up correctly in VCC...
Best regards,
Oliver
|
|
|
|
|
hello , how can i set float precisoin in mfc ? I get like this format ex. 1.500000 what i want is to print just 3 number after the decimal point .
my code :
CString temp;
float price =20.570;
sprintf(temp,"%f",price);
i got this 20.570000 how can i make the decimal point print just 3 number like this
20.570 and thank you .
|
|
|
|