Skip navigation
1580 Views 8 Replies Latest reply: Dec 8, 2011 7:33 AM by A.Non RSS
ptc-4348743 Copper 3 posts since
Nov 30, 2011
Currently Being Moderated

Dec 7, 2011 7:46 AM

OLE to load a .MCD file

Our customer gave us an MCD file and wants us to be able to run it via a C++ interface. Running/Linking an automation interface is something we do a lot of, so no biggie there. BUT. This code throws an exception when trying to load the MCD file: (Sorry for he TABLE format. I cannot seem to get it to allow pasting code normally)

 


IMathcadApplication* McApp;

IMathcadWorksheets* McWorksheets;

IMathcadWorksheet* McWorksheet;

CoInitialize(NULL);// Initialize the COM library

HRESULT hr=CoCreateInstance(CLSID_App, NULL,








CLSCTX_LOCAL_SERVER,








IID_IMathcadApplication,








(LPVOID*)&McApp);

if (!SUCCEEDED(hr)) {


MessageDlg("Unable to create a MathCad Application object",mtError, TMsgDlgButtons() << mbOK, 0);


return ;

}

McApp->Visible=true;

McWorksheets=McApp->Worksheets;

McWorksheet=McWorksheets->Open(L"c:\\KVD_FILE.mcd");

McApp->Release();

 

 

Everything works fine until the Open command. Can someone point me to examples of VB, Java, or C++ code that shows how to load a MCD file? And if it is in the callaboratory, can some PLEASE tell me how to get to it. I have never found the callaboratory.

 

Thanks, Brian

More Like This

  • Retrieving data ...

Bookmarked By (0)

Legend

  • Correct Answers - 3 points
  • Helpful Answers - 1 points