bypassing confirmation window

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?
 
S

swati

Actually I want to convert .txt into a .vsd file. During the conversion it
pops up the dialog boxes for confirmation. I want to either supress the
windows so that they will not pop up at all and do the conversion forcefully
OR bypass the windows by giving input to the dialog boxes programatically.
I have tried using alertResponse but the dialog boxes that pop up don't
respond to it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top