I initialize COM interface in entry function As follows:
if (!AfxOleInit())
{
AfxMessageBox(_T("COM interface Initialization failed"));
return (retCode);
}
Call COM interfaces As follows:
try
{
AutoCAD::IAcadApplicationPtr app=acedGetAcadWinApp()->GetIDispatch(FALSE);
if (app==NULL)
{
acutPrintf(_T("Get IAcadApplicationPtr Failed\n"));
return;
}
}
The above codes run successfully under XP 32-bit
When I use these codes under Win7 64-bit,they run Incorrectly and return "Get IAcadApplicationPtr Failed"
Grateful for any help on this problem!
Solved! Go to Solution.
Solved by xiaodong_liang. Go to Solution.
Are you importing the 64-bit type library when you build for x64?
I suggest to write step-by-step code to obtain an IDispatch and query it for IAcadApplication so you can determine exactly which step is failing.