When using MFC VC++2008, you could launch Alibre automatically with the following Windows API.
( The following is the contents of function LanchAlibre() )
(Ref:http://www.codeguru.com/forum/showthread.php?t=302501)
I modified one of the example from VC++ named "GeometryAndTopologyQuery"
Ref: viewtopic.php?f=13&t=8186
I added try{} catch(){} at the top of ConnectToAlibre().
( The following is the contents of function LanchAlibre() )
Code:
STARTUPINFO siStartupInfo;
PROCESS_INFORMATION piProcessInfo;
memset(&siStartupInfo, 0, sizeof(siStartupInfo));
memset(&piProcessInfo, 0, sizeof(piProcessInfo));
siStartupInfo.cb = sizeof(siStartupInfo);
if(CreateProcess("C:\\Program Files\\Alibre Design\\Program\\Alibre Design.exe", // Application name
0, // Application arguments
0,
0,
FALSE,
CREATE_DEFAULT_ERROR_MODE,
0,
0, // Working directory
&siStartupInfo,
&piProcessInfo) == FALSE){
}
Sleep(3000);//Wait for Alibre to stabilize.
I modified one of the example from VC++ named "GeometryAndTopologyQuery"
Ref: viewtopic.php?f=13&t=8186
I added try{} catch(){} at the top of ConnectToAlibre().
Code:
HRESULT CGeometryAndTopologyQueryDlg::ConnectToAlibre()
{
HRESULT hr = E_UNEXPECTED;
try
{
if(m_pRoot == NULL)
{
LaunchAlibre();
}
}
catch(...)
{
AfxMessageBox ("Exception caught while lanuching Alibre!");
return E_UNEXPECTED;
}
try
{
// If m_pRoot is not NULL that means application is already connected to Alibre and this
..