S
swati
Hi,
I am trying to use Visio SDK 2002 through c++. I am able to launch a Visio
application through COM interfaces but when I try to open a document with it
the program crashes with the message "abnormal program termination".
The code segment is as follows:
HRESULT hr;
IVApplicationPtr app1;
IVDocumentPtr doc;
IVDocumentsPtr docs;
hr = CoInitialize(NULL);
if( FAILED(hr))
{
cout<< " Coinitialization failed" << endl;
return 0;
}
if( !app1.GetInterfacePtr())
hr = app1.CreateInstance(CLSID_Application);
hr = docs.CreateInstance(CLSID_Documents);
hr = app1->get_Documents(&docs);
if(hr != S_OK)
cout << "error in get_Documents" << hr;
hr = docs->Open(BSTR("F:\\Drawing2.vsd"));
if(hr != S_OK)
cout << "error in Open" << hr;
One more problem I am facing I want to do *something* through Visio,
programatically. In the process visio pops up confirmation windows asking to
click on OK button. Is there any method by which I can bypass this
confirmation dialog?
I am trying to use Visio SDK 2002 through c++. I am able to launch a Visio
application through COM interfaces but when I try to open a document with it
the program crashes with the message "abnormal program termination".
The code segment is as follows:
HRESULT hr;
IVApplicationPtr app1;
IVDocumentPtr doc;
IVDocumentsPtr docs;
hr = CoInitialize(NULL);
if( FAILED(hr))
{
cout<< " Coinitialization failed" << endl;
return 0;
}
if( !app1.GetInterfacePtr())
hr = app1.CreateInstance(CLSID_Application);
hr = docs.CreateInstance(CLSID_Documents);
hr = app1->get_Documents(&docs);
if(hr != S_OK)
cout << "error in get_Documents" << hr;
hr = docs->Open(BSTR("F:\\Drawing2.vsd"));
if(hr != S_OK)
cout << "error in Open" << hr;
One more problem I am facing I want to do *something* through Visio,
programatically. In the process visio pops up confirmation windows asking to
click on OK button. Is there any method by which I can bypass this
confirmation dialog?