excel的问题
/* for excel */
#define OPG OlePropertyGet
#define OPS OlePropertySet
#define OFN OleFunction
#define OPR OleProcedure
#define PR Procedure
代码如下:
Variant Axl,Workbook,AxSheet,nms,bef,aft;
try
{
Axl= Variant::CreateObject("Excel.Application");
}
catch(...)
{
ShowMessage("create object failed");
}
Axl.OPS("Visible",(Variant)true);
createobject成功了,但OPS那句就不行了,说是
.exe raised exception class eaccessviolation with message 'access violation at address 00454BB7 in module 'a.exe'. read of address 00000800'. .....
同样的代码在单独的程序里没事,放回我的项目里就不行了。项目里不能用什么东东吗??苦死了,大家帮忙啊