одно из решений что я нешел писать все аргументы в скобке
Have you tried:
#define MyErrorBox(params) (line = __LINE__, file = __FILE__,
MyErrorBoxInternal(params))
The problem is of course that you have to write:
MyErrorBox((hWnd,text,caption,­flags))
instead of
MyErrorBox(hWnd,text,caption,f­lags)
Another way is to wait for Visual C++ to catch up with C9X and allow for
VA_ARGS in macros:
#define MyErrorBox(...) (line = __LINE__, file = __FILE__, \
MyErrorBoxInternal(__VA_ARGS__­))
Unfortunately we all have to wait a bit for that...Visual C++ 7.x may have it
though.... Until then, try the way above.
Another idea.... Just keep MyErrorBox as a regular function and have a small
simple macro to just set those __LINE__ and __FILE__ values...
int MyErrorBox(int line, const char * file, ...other params...);
#define LF __LINE__, __FILE__
if (MyErrorBox( LF, .... ) == IDYES)....
int answer = MyErrorBox( LF, ... );
Alf