Hi,
> I have a .exe application which exposes several COM
> In VB 6.0 I can instantiate a class by using Set myClass = GetObject(path,
> ...
> Now I try to do the same in C#, but I cannot find out how.
Does Marshal.BindToMoniker help? Also
Microsoft.VisualBasic.Interaction.GetObject static function is available for
C#, internally it uses the same
Marshal.BindToMoniker/Marshal.GetActiveObject API.
..
Regards,
Vadim.
Magne Ryholt - 28 Aug 2003 13:17 GMT
Vadim
Thanks for your answer.
I must admit that I know very little about monikers.
I guess that if the file has extension e.g. .XLS it would not be any problem
(because there is an association between XLS extension and the excel
program.
In my case i would bind to a .INI file and I don't want to make this kind of
association, so I also need to give some info about the object (class id,
prog id etc.)
Note that the .exe file (hosting the object I try to instantiate) is not
running prior to my calls, therefore cannot use GetActiveObject I guess.
Also note that I tried with the Microsoft.VisualBasic.Interaction.GetObject
(from C#), but got exception as mentioned before
Are you able to give me more specific help on how to use the BindToMoniker
method etc. in my case ?
I forgot to inform that in my C# project I set up a wrapper (RCW) to the exe
file (the exe file is also actually a "full" application with GUI etc.) by
reference in Visual Studio
When I tried (successfully) with VB 6.0, I also referred to the same exe
file in project references.
> Hi,
>
[quoted text clipped - 11 lines]
> Regards,
> Vadim.