[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference pamsrc::objectbroker_dtc

Title:ObjectBroker Desktop Connection
Moderator:RECV::STORM
Created:Mon Jan 06 1997
Last Modified:Thu Jun 05 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:40
Total number of notes:125

39.0. "Using class factories" by HOUBA::BOUCHETF () Thu May 22 1997 17:16

Hello,

Could you clarify the way to define xxxFactory IDL interfaces in order to get 
the CoCreateInstance routine working. I have tried the following, but it does
not work:

1. CORBA IDL

   module DTC 
   {
	interface Component
	{
	    void initialize(in string aName);
	    void getName();
	};

	interface ComponentFactory
	{
	    Component CreateObject();
        };
    };

2. Implement OBB Client and Server. The server works well.

3. Generate code for DTC. Selected options: (a) Generate customer interface,
   (b) C++ Header file, (c) MIDL definition file and (d) replace interface(s).

4. Implement the COM client (here is an extract)

	#define INITGUID 
	#include <objbase.h>
	#include <IDTC_Component.h>
	...
	CLSID pIDTC_Clsid;
	hr = CLSIDFromProgID(
		L"CORBA.COM.DTC_Component",
		&pIDTC_Clsid);
	...
	IDTC_Component* pIDTC_Component = NULL;
	hr = ::CoCreateInstance(
		pIDTC_Clsid,
		NULL,
		CLSCTX_INPROC_SERVER | CLSCTX_LOCAL_SERVER,
		IID_IDTC_Component,
		(void**)&pIDTC_Component);
	...
	hr = pIDTC_Component->initialize("Fredo");
	...
	pIDTC_Component->Release();
	...

The error returned by CoCreateInstance is 

	Error(80004005): Unspecified error.

I use WNT 4.0 sp 2, Visual C++ V5.0, OBB T3.0-02, DTC BL6

Thanks for your help.

Cheers.

Frederic
T.RTitleUserPersonal
Name
DateLines
39.1There was a couple of problemsHOUBA::BOUCHETFFri May 23 1997 09:0817
After a couple of retries it seems to work now. There were a couple of 
problems:

1. The autostart of the naming service does not work on NT 4.0 but it 
   works on WIN95.

2. It could be good to make the documentation more clear (CreateObject
   vs. create_object, add an objref in the OBB advertising) and with 
   accurate examples (e.g. INITGUID must be defined before including
   objbase.h).

3. It could be good to define explicit error messages. "Unspecified 
   error" meesage seems to be returned for any error.

Cheers.

Frederic
39.2SEND::SLAVINFri May 23 1997 09:385
>1. The autostart of the naming service does not work on NT 4.0 but it 
>   works on WIN95.

The ObjectBroker NT V4.0 autostart problem is corrected in OBB V3.0
39.3LEMAN::DONALDSONFroggisattva! Froggisattva!Fri May 23 1997 11:275
> The ObjectBroker NT V4.0 autostart problem is corrected in OBB V3.0

But of course! Frederic is only using vT3.0 though. :-(

John D.