V
vicky
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
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