我使用了上面的办法,但是在其他类中调用出现这种错误,何解? left of '.m_lpDispatch' must have class/struct/union type left of '.CreateDispatch' must have class/struct/union type left of '.Connect' must have class/struct/union type left of '.Write' must have class/struct/union type 就是调用对象中的方法不行。
,因为,你的工程有一个theApp的全局变量,调用其成员就可以了
或者,你直接找一个cpp文件,里面定义一个全局变量
然后其他文件用的时候,用extern声明一下就可以了
left of '.m_lpDispatch' must have class/struct/union type
left of '.CreateDispatch' must have class/struct/union type
left of '.Connect' must have class/struct/union type
left of '.Write' must have class/struct/union type
就是调用对象中的方法不行。