Prev: Changing names in a directory from data contained within a spreadsheet.
Next: Can't find DLL in search path
From: qjpus on 4 Jan 2010 09:55 Hi, I would like to be able to create an object from one process (proc1.exe) and somehow pass instance os it to another process (proc2.exe). Obviously this has to be out-of-process object. Best approximation I have is 1) create instance in proc1.exe and make it active using RegisterActiveObject (proc1.exe is non-managed C++ application), 2) start proc2.exe from proc1.exe (CreateProcess WinAPI call) and obtain active object instance using GetObject from proc2.exe (proc2.exe is and MUST be vb6 app). That is not bad, but semmes to limit functionality to only single instance of a pair proc1.exe, proc2.exe: starting 1st instance of proc1.exe, proc1.exe creates object and registers it as active object, then starts 1st instance of proc2.exe and proc2.exe calling GetObject gets reference to the instance just created by proc1.exe. However on starting second instance of proc1.exe I think that may not work too well. That just does not look 'elegant' enough resetting systemwide active object instance, smells like ugly global variable solution. Ideally I would like to start either from proc1.exe or from command line proc2.exe and pass it some data that would let him properly identify particular instance of object created by particular proc1.exe, i.e. properly couple proc1.exe proc2.exe instances. Regards, Q |