Calls from C code

  • Thread starter Thread starter Mike
  • Start date Start date
M

Mike

Hi,

Is it possible to call a VB/C# class' method (or module) from within a C application? If so, is there any resource I could look at to see how to make this work?

Thanks
Mike
 
Mike,

It is possible, but you will have to make the call through COM (set up
an apartment through a call to CoInitializeEx, then get a pointer to the
interface, etc, etc).

For more information on exposing your .NET components to COM, check out
the section of the .NET framework titled "Exposing .NET Framework Components
to COM", located at (watch for line wrap):

http://msdn.microsoft.com/library/d.../cpconExposingNETFrameworkComponentsToCOM.asp

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)



Hi,

Is it possible to call a VB/C# class' method (or module) from within a C
application? If so, is there any resource I could look at to see how to make
this work?

Thanks
Mike
 
Nicholas,

Thanks for the info. Do you have any link to information on how to program the call (set up an apartment through a call to CoInitializeEx, etc. etc.). This is something I am not particularly strong in.

Thanks
Mike



Mike,

It is possible, but you will have to make the call through COM (set up
an apartment through a call to CoInitializeEx, then get a pointer to the
interface, etc, etc).

For more information on exposing your .NET components to COM, check out
the section of the .NET framework titled "Exposing .NET Framework Components
to COM", located at (watch for line wrap):

http://msdn.microsoft.com/library/d.../cpconExposingNETFrameworkComponentsToCOM.asp

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)



Hi,

Is it possible to call a VB/C# class' method (or module) from within a C
application? If so, is there any resource I could look at to see how to make
this work?

Thanks
Mike
 
Back
Top