[转]C++ builder 空格惹祸 E2208 can not access inactive sco

C++ builder 空格惹祸 E2208 can not access inactive sco
 
 

C++ builder 空格惹祸 E2208 can not access inactive scope

 

错误原因没有得到函数地址

错误前

ISO15693_Inventory =  (unsigned int (CALLBACK *)(unsigned int icdev,

                                                    unsigned char *pData,

                                                    unsigned char *pLen))GetProcAddress(hLib,"ISO15693_Inventory");

错误解决后

ISO15693_Inventory =  (unsigned int (CALLBACK *)(unsigned int icdev,

                                                    unsigned char *pData,

                                                    unsigned char *pLen))GetProcAddress(hLib,"ISO15693_Inventory");

在函数调用的过程中,函数名参数中不能有空格,消去空格,问题解决。

问题的出现时,访问了不对地址,实际上是函数指针没有得到,调用了一个不存在的函数指针,编译不报错,运行时报错。

你可能感兴趣的:(C++,c,Access,callback)