(Msg. 1) Posted: Tue Nov 25, 2008 4:12 am
Post subject: Visio Automation Exception in GetStencilPaths() Archived from groups: microsoft>public>visio>troubleshoot (more info?)
Hi All!
I am developing a VC++ project for automating MS-Visio 2003, when i
am
trying to get stencil paths using function GetStencilPaths(), i have
following error:
COleException. SCODE: 800706ba.
I am working on Windows-XP (SP2), Visual Studio 6.0 and Visio-2003.
I am using following code to automate Visio:
//
***************************************************************************
***************************
CLSID
visio_clsid=
{ 0x00021a20, 0x0000, 0x0000, { 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x46 } };
IUnknown *pUnk=
NULL;
IVApplication
app;
GetActiveObject(visio_clsid, NULL,
&pUnk);
IDispatch *pDisp =
NULL;
if ( pUnk !=
NULL )
pUnk->QueryInterface(IID_IDispatch, (LPVOID *)
&pDisp);
if ( pDisp ==
NULL )
{
if ( !app.CreateDispatch
(visio_clsid) )
{
return -2;
}
}
else
{
app.AttachDispatch
(pDisp);
}
app.SetVisible(TRUE); //Visio invoked and
visible.
CString strStencilPaths = app.GetStencilPaths(); //Problem occurrs
on
this line.
CString strXaStencilFolder = "c:\
\My_Stencil_Folder";
//Check if path is already
there,
if (strstr(strStencilPaths, strXaStencilFolder) ==
NULL)
{
strStencilPaths +=
";";
strStencilPaths +=
strXaStencilFolder;
app.SetStencilPaths
(strStencilPaths);
}
//
***************************************************************************
***************************
What causes this problem? Thanks in anticipation.
Regards,
Vicky
All times are: Eastern Time (US & Canada) (change)
Page 1 of 1
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum