Is is possible to call a C# user interface asociated to a lib file so as to be called by a C console

P

pableratz

I have programmed a multi thread C control application, and now I want
to add User interface functionality to my main thread. I would like to
know if i could generate a library from a C# Screen and call it from
my main thread.

Thanks for your attention
 
A

AvdP

pableratz said:
I have programmed a multi thread C control application, and now I want
to add User interface functionality to my main thread. I would like to
know if i could generate a library from a C# Screen and call it from
my main thread.

Thanks for your attention

I am not sure I understand your question, but probably CorBindToRuntimeEx
(MSCOREE.DLL) is what you are looking for. It enables an unmanged host (i.e.
your control application) to load the CLR into a process. At
http://msdn.microsoft.com you can search for "hosting the common language
runtime" for further explanation and details.

Regards,
Anne
 
L

Laura T.

Yes, in generally you can call C# library from C.
C# can expose the library objects as standard COM objects so no problem
there either
(see http://blogs.msdn.com/deeptanshuv/archive/2005/06/26/432870.aspx for
examples).
If you talking about console (text UI), this could be ok.
If you are thinking about C# GUI interface, the things can become more
complicated.
You can find a presentation of how to use C# WinForms from MFC app here
http://download.microsoft.com/download/e/2/1/e216b4ce-1417-41af-863d-ec15f2d31b59/DEV331.ppt.
It's not easy and it can create some side effects in your MT app.

The best thing I can think is to make a C# APP that uses some IPC mechanism
to talk with your existing app.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top