Evan Hansen
22nd August 2002, 09:59
Hi all

I would like to establish a "connection" from a C++ application to Baan. My code looks like this:

if (pBaanApp == NULL)
{
CoInitialize(NULL);

HRESULT hr = pBaanApp.CreateInstance("Baan4.Application");
....
....

This works fine when the Baan4 application is not allready started. If it is started, this will fail and hr=-2147467262. I then tried to use this line of code to "get hand on" Baan:

HRESULT hr = pBaanApp.GetActiveObject("Baan4.Application");

This fails and hr=-2147221021.

Can anybody help me ?

Thank you very much in advance.

With best wishes
Evan Hansen

jmdesai
22nd August 2002, 12:09
As far as my understanding goes, you can do the followinb thing:

Replace this code "Baan4.Application" with
"Baan4.Application.app3" code. Here app3 is a BaaN configuration file. In your case, since you have not provided any configuration file, it is taking default config file. Also it is not possible to run two instances of a same config file.

Evan Hansen
22nd August 2002, 15:37
Hi jmdesai

Thank you very much for your help. It works fine.

With best wishes

Evan