|
kuphryn wrote:
What MFC architecture is it? Is it SDI?
Hi Kuphryn,
Thanks u for ur information. It is SDI.
|
|
|
|
|
Just write your own messagebox.
There are even some articles in codeproject which do the things you want.
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
Hi,
I'm writing my first full VC++ application and am having problems forcing a redraw. I've added 2 Dialogbars to my app and want to be able to hide and unhide them. I'm doing this via ShowWindow(SW_HIDE) but the dialogbars only update when I resize the whole app window.
I know a little about Invalidate() and InvalidateRect() but I belive they're only for the Client area. RedrawWindow() with the RDW_FRAME|RDWERASENOW flags seems to offer a solution but I can't get this to work either.
Any help for a newbie?
Thanks,
Simon
Multimedia programmer, trying to learn a grown-up language!
|
|
|
|
|
Did you try calling ShowControlBar instead of ShowWindow?
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
|
|
|
|
|
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
|
|
|
|