#define MAKEADSENTRY(x) &IID_##x, _T(#x)
#define ADDADSERROR(x) x, _T(#x)
#define DECLAREADSPROC(x) void DlgProc##x(LPUNKNOWN, LPUNKNOWN *ppNew=NULL); \
void DlgProc##x(LPUNKNOWN pUnk, LPUNKNOWN *ppNew) { CDlg##x dlg( pUnk); dlg.DoModal(); }
里##的作用是什么呢?
#define ADDADSERROR(x) x, _T(#x)
#define DECLAREADSPROC(x) void DlgProc##x(LPUNKNOWN, LPUNKNOWN *ppNew=NULL); \
void DlgProc##x(LPUNKNOWN pUnk, LPUNKNOWN *ppNew) { CDlg##x dlg( pUnk); dlg.DoModal(); }
里##的作用是什么呢?
解决方案 »
- activex 不能读取系统目录下图片?
- 我这里有一段VC++写的用gsm猫做的短信品台的代码,不过不是很懂,这个是我的毕业设计,快来不及了,希望有哪位好心人能帮我看看!
- 求《Visual C++ 高级编程》附书盘(人邮出版,张力 编著)
- 高分!!如何得到某主机的操作系统类型?
- bluebohe和bcpl进来 每人100分 表示你们对我做DLL时的斑竹。
- 为什么我播放声音会非法操作?
- VC7.0是简体中文版还是创天中文版?
- 如何确定http同一端口下多个请求报文和响应报文的对应关系
- 关于接收字符串函数!急!急!急!
- 如何在DLL_PROCESS_DETACH时删除自己LoadLibrary的DLL?
- 关于数据源odbc的问题。
- 视图上如何初始化控件
例如:
#define paster( n ) printf( "token" #n " = %d", token##n )
则
paster( 9 );
等同于
printf( "token9 = %d", token9 );
The double-number-sign or “token-pasting” operator (##), which is sometimes called the “merging” operator, is used in both object-like and function-like macros. It permits separate tokens to be joined into a single token and therefore cannot be the first or last token in the macro definition.If a formal parameter in a macro definition is preceded or followed by the token-pasting operator, the formal parameter is immediately replaced by the unexpanded actual argument. Macro expansion is not performed on the argument prior to replacement. Then, each occurrence of the token-pasting operator in token-string is removed, and the tokens preceding and following it are concatenated. The resulting token must be a valid token. If it is, the token is scanned for possible replacement if it represents a macro name. The identifier represents the name by which the concatenated tokens will be known in the program before replacement. Each token represents a token defined elsewhere, either within the program or on the compiler command line. White space preceding or following the operator is optional.This example illustrates use of both the stringizing and token-pasting operators in specifying program output:#define paster( n ) printf( "token" #n " = %d", token##n )
int token9 = 9;If a macro is called with a numeric argument likepaster( 9 );the macro yieldsprintf( "token" "9" " = %d", token9 );which becomesprintf( "token9 = %d", token9 );
--------------------------------------------------------------------------------
Send feedback to MSDN.Look here for MSDN Online resources.
int ss(MYVar);
在程序中会产生这样一个变量
MyVar1,是int型的
注意##只能在宏中使用,否则会出错
如:print("%d",token##n); -----error!
两个是连接token
字符串!=token