|
A good place to start is current_function.hpp in the boost library. Boost tends to be a good place to start for information and patterns which work around differences in compilers.
#ifndef BOOST_CURRENT_FUNCTION_HPP_INCLUDED
#define BOOST_CURRENT_FUNCTION_HPP_INCLUDED
#if _MSC_VER >= 1020
#pragma once
#endif
namespace boost
{
namespace detail
{
inline void current_function_helper()
{
#if defined(__GNUC__) || (defined(__MWERKS__) && (__MWERKS__ >= 0x3000))
# define BOOST_CURRENT_FUNCTION __PRETTY_FUNCTION__
#elif defined(__FUNCSIG__)
# define BOOST_CURRENT_FUNCTION __FUNCSIG__
#elif defined(__BORLANDC__) && (__BORLANDC__ >= 0x550)
# define BOOST_CURRENT_FUNCTION __FUNC__
#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901)
# define BOOST_CURRENT_FUNCTION __func__
#else
# define BOOST_CURRENT_FUNCTION "(unknown)"
#endif
}
}
}
#endif // #ifndef BOOST_CURRENT_FUNCTION_HPP_INCLUDED
If you can keep you head when all about you
Are losing theirs and blaming it on you;
If you can dream - and not make dreams your master;
If you can think - and not make thoughts you aim;
Yours is the Earth and everything that's in it.
Rudyard Kipling
|
|
|
|
|
__FUNCTION__ is available in VS.NET; it returns the undecorated name of the function.
|
|
|
|
|
Hey everyone, I just wanted to inform you of a great great website that really helped me out with reading and writing to the registry using C++. It took me many hours to find a website with simple explanations and examples like this.
http://www4.ncsu.edu:8030/~jgbishop/codetips/general/registry_access_advanced.html
Check it out...
|
|
|
|
|
I have a book on C++, but it does not explain structures and classes very well. Could someone please tell me what they are, what they're used for, and the differences between them?
Thanks a lot.
|
|
|
|
|
Take a look here for structures and here for classes. At the most basic level, structures are an old C-concept and just contain data, whilst a class is C++ and contains both data and functions relevant to that data. Classes also provide for the whole object-oriented design, so go with them where possible.
|
|
|
|
|
i want to show a dialog in regular dll which is dynamicaly linked to mfc.
the exported func is :
//dynamicly
extern "C" __declspec( dllexport ) void Trade1()
{
AFX_MANAGE_STATE(AfxGetStaticModuleState())
CDlgLogon dlg;
dlg.DoModal ();
}
which does not work.
if i set the dll staticly linked to mfc .it works well
//staticly
extern "C" __declspec( dllexport ) void Trade1()
{
CDlgLogon dlg;
dlg.DoModal ();
}
is that means i can't use mfc in static library?
gucy
|
|
|
|
|
Where is your dialog template? In the DLL or in the application. The second one (which you said works) would load it from the application, but the first one (which you said doesn't work) would try to load it from the DLL, and should work if the dialog template was in the DLL.
If you want the first one to work, the dialog template must be in the DLL, not in the application.
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
hi,
The dialog template is in dll in both of the two funcion.
gucy
|
|
|
|
|
If you use AFX_MANAGE_STATE() in the bottom one, does it still work?
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
yes,if i add the macro to the second one,it still work.it does not depent on the macro.
gucy
|
|
|
|
|
Hmmm. I can't help much more - I'm not an expert on DLLs. Have a look at MFC technical note TN058 which explains module state switching in detail.
As far as I can see, the first one should work .
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
If I get an updated version on an ActiveX control...
What steps do I need to take in order to re-insert the control on a dialog, such that ClassWizard will generate updated wrapper classes of the SAME name as I'm currently using?
Thanks bunches!
There's no such thing as a bad beer... some are just better than others.
|
|
|
|
|
Create another project and add the ActiveX control to make wrapper class.
and overwrite old one.
that's all.
have a nice day~
|
|
|
|
|
If I already have a control added to the dialog and saved before updating hte version, after the update I got an error that the control could not be loaded in the same state when it was last saved. How to solve this issue?
|
|
|
|
|
I know with the following statement, I can open outlook with email address (abc@abc.com) already set up:
ShellExecute(
NULL,
"open",
"mailto:abc@abc.com",
NULL,
"",
SW_SHOWNORMAL
);
Is there any way to set up content just like email address prior to open outlook? Thank you.
|
|
|
|
|
"mailto:abc@abc.com?Subject=SomeSubject&Body=whatever..."
As far as I can remember
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
|
I have a CWnd derrived object that is a private member of an MDI's CWinApp object. I would like to have the CWnd obj handle messages from the menu but when I use the ClassWizard to set up a handler in the CWnd obj, it does not enable the menu item. How do I "connect" the menu item with this object?
Thanks!
Grailman
|
|
|
|
|
Does anyone know how to create two rows of header information using the MFC CListCtrl. i.e. something the following
-----------------------------------------------------------------
INPUT | OUTPUT
-----------------------------------------------------------------
Frame | Addr | Frame | Addr
-----------------------------------------------------------------
0 | 0x1000 | 0 | 0x20000
1 | 0x2000 | 1 | 0x30000
2 | 0x2000 | 2 | 0x30000
3 | 0x2000 | 3 | 0x30000
etc....
Thanks,
Suresh
|
|
|
|
|
You can't do this directly.
John
|
|
|
|
|
How can this be done indirectly. Any ideas John?.
|
|
|
|
|
I beleive you have to draw the header yourself but it may be possible to stack a list control on top of another such that the only visible part of the top one on is its header.
[EDIT]
When I think of my second idea for a little while I realize this is not going to be easy to get it to work.
[/EDIT]
John
|
|
|
|
|
that's too complicated for it to handle -- take a look at some of the grid controls here on CP, they are more flexible about this..
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
Santa Cruz Networks
|
|
|
|
|
|
If somebody could point me to them, that would be greatly appreciated. I appear to be having problems finding any on CP.
|
|
|
|