Click here to Skip to main content
15,906,645 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: call event of Activex in thread procedure! Pin
Roger Stoltz27-May-07 22:02
Roger Stoltz27-May-07 22:02 
QuestionI know that here is not the best place to ask that, but... Pin
Nelek23-May-07 20:52
protectorNelek23-May-07 20:52 
AnswerRe: I know that here is not the best place to ask that, but... Pin
Johpoke23-May-07 21:01
Johpoke23-May-07 21:01 
GeneralRe: I know that here is not the best place to ask that, but... Pin
Nelek23-May-07 21:21
protectorNelek23-May-07 21:21 
GeneralRe: I know that here is not the best place to ask that, but... Pin
Johpoke23-May-07 22:31
Johpoke23-May-07 22:31 
QuestionC# dll from MFC application... Pin
nzhuda23-May-07 20:47
nzhuda23-May-07 20:47 
AnswerRe: C# dll from MFC application... Pin
nzhuda24-May-07 15:22
nzhuda24-May-07 15:22 
GeneralRe: C# dll from MFC application... Pin
keancaptinh12-Apr-09 20:49
keancaptinh12-Apr-09 20:49 
You can use this way
you can make you C# classes accessible to C++ app by registering them as
COM components.
Go to project properties/build and Select the "Register For COM Interop"
option in the Output section.

or if you like command prompt follow these steps:

You can also select the class which will be com visible. use the
ComVisible attribute on the class too.

Please note that for making a class COM visible

-the classes must use a default constructor with no parameters.
-Any type that is to be exposed must be public.
-Any member that is to be exposed must be public.
-Abstract classes will not be able to be consumed.

these steps are from the command line.
Let say your code is in myDLL.cs, then first you need to compile it

csc /t:library myDLL.cs


then you need to use the Type Library Exporter Utility.

tlbexp myDLL.dll /out:myDLL.tlb

Next you need to create a resource script (myDLL.res) with the following
Interface Definition Language (IDL) definition:

IDR_TYPELIB1 typelib "myDLL.tlb"

Then you recompile the application with the new resource file added
csc /t:library myDLL.cs /win32res:myDLL.res

after this is done you can use the class in C# as a COM component in C++
applicaiton
QuestionMultilanguage Resource compilation options Pin
XtremDev23-May-07 20:47
XtremDev23-May-07 20:47 
AnswerRe: Multilanguage Resource compilation options Pin
Nelek23-May-07 20:56
protectorNelek23-May-07 20:56 
GeneralRe: Multilanguage Resource compilation options Pin
XtremDev23-May-07 21:21
XtremDev23-May-07 21:21 
GeneralRe: Multilanguage Resource compilation options Pin
Nelek23-May-07 21:26
protectorNelek23-May-07 21:26 
AnswerRe: Multilanguage Resource compilation options [modified] Pin
Naveen23-May-07 22:39
Naveen23-May-07 22:39 
GeneralRe: Multilanguage Resource compilation options Pin
tom groezer24-May-07 1:37
tom groezer24-May-07 1:37 
QuestionRun at .Net 2.0 (errors) Pin
Tal S.23-May-07 20:36
Tal S.23-May-07 20:36 
AnswerRe: Run at .Net 2.0 (errors) Pin
Hamid_RT24-May-07 0:50
Hamid_RT24-May-07 0:50 
GeneralRe: Run at .Net 2.0 (errors) Pin
Tal S.24-May-07 1:33
Tal S.24-May-07 1:33 
QuestionRe: Run at .Net 2.0 (errors) Pin
Hamid_RT24-May-07 10:53
Hamid_RT24-May-07 10:53 
AnswerRe: Run at .Net 2.0 (errors) Pin
Tal S.24-May-07 11:04
Tal S.24-May-07 11:04 
QuestionRe: Run at .Net 2.0 (errors) Pin
Hamid_RT24-May-07 11:14
Hamid_RT24-May-07 11:14 
AnswerRe: Run at .Net 2.0 (errors) Pin
Tal S.24-May-07 11:22
Tal S.24-May-07 11:22 
QuestionRe: Run at .Net 2.0 (errors) Pin
Hamid_RT24-May-07 11:28
Hamid_RT24-May-07 11:28 
AnswerRe: Run at .Net 2.0 (errors) Pin
Tal S.24-May-07 11:34
Tal S.24-May-07 11:34 
GeneralRe: Run at .Net 2.0 (errors) Pin
Hamid_RT24-May-07 11:50
Hamid_RT24-May-07 11:50 
QuestionRe: Run at .Net 2.0 (errors) Pin
Hamid_RT24-May-07 21:27
Hamid_RT24-May-07 21:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.