Click here to Skip to main content
14,924,889 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
AnswerRe: How can I get /clr support it's giving errors Pin
Richard MacCutchan24-Jan-12 3:58
mveRichard MacCutchan24-Jan-12 3:58 
GeneralRe: How can I get /clr support it's giving errors Pin
appollosputnik24-Jan-12 20:00
Memberappollosputnik24-Jan-12 20:00 
GeneralRe: How can I get /clr support it's giving errors Pin
Richard MacCutchan24-Jan-12 22:01
mveRichard MacCutchan24-Jan-12 22:01 
JokeRe: How can I get /clr support it's giving errors Pin
Wes Aday25-Jan-12 3:06
professionalWes Aday25-Jan-12 3:06 
GeneralRe: How can I get /clr support it's giving errors Pin
appollosputnik26-Jan-12 17:31
Memberappollosputnik26-Jan-12 17:31 
GeneralRe: How can I get /clr support it's giving errors Pin
Richard MacCutchan26-Jan-12 22:09
mveRichard MacCutchan26-Jan-12 22:09 
GeneralRe: How can I get /clr support it's giving errors Pin
Wes Aday27-Jan-12 3:26
professionalWes Aday27-Jan-12 3:26 
GeneralRe: How can I get /clr support it's giving errors Pin
John Schroedl27-Jan-12 6:16
professionalJohn Schroedl27-Jan-12 6:16 
We have successfully used MFC and C++/CLI Managed code in the same project/executable so it's certainly possible.
We are creating WPF windows just fine from C++/CLI code and can also use much of the legacy MFC code alongside. We stopped using Doc/View architecture in favor of WPF so that will be much of the work to-do if you want to use WPF.

Here's some of my advice from what I recall of the early days:

1. Separate which files need to have managed code and which are native-only. For the managed files, only mark them as /clr. Do this on a .cpp file-by-file basis.
2. In your MFC applications' InitInstance, create an instance of a .NET application object (ex. gcnew MyNetApp(); ) and keep that in an accessible singleton.
3. In your MFC application class Run() function, call the .NET application's Run.
ex. return MyNetApp::Instance->Run();
4. Change project settings for Code Generation to Enable C++ Exceptions with /EHa on the managed files (may be fine to use that for all files).

John
GeneralRe: How can I get /clr support it's giving errors Pin
Philippe Mori19-Feb-12 2:42
MemberPhilippe Mori19-Feb-12 2:42 
QuestionWhere is this managed object stored? Pin
Frank__Q18-Jan-12 14:17
MemberFrank__Q18-Jan-12 14:17 
AnswerRe: Where is this managed object stored? Pin
George L. Jackson19-Jan-12 1:16
MemberGeorge L. Jackson19-Jan-12 1:16 
GeneralRe: Where is this managed object stored? Pin
Frank__Q19-Jan-12 10:34
MemberFrank__Q19-Jan-12 10:34 
AnswerRe: Where is this managed object stored? Pin
Luc Pattyn19-Jan-12 10:54
sitebuilderLuc Pattyn19-Jan-12 10:54 
GeneralRe: Where is this managed object stored? Pin
slawomir_orlowski28-Jan-12 22:51
Memberslawomir_orlowski28-Jan-12 22:51 
QuestionActiveX issue: ATL 8.0 text in IE Pin
birajendu5-Jan-12 19:32
Memberbirajendu5-Jan-12 19:32 
AnswerRe: ActiveX issue: ATL 8.0 text in IE Pin
John Schroedl6-Jan-12 4:48
professionalJohn Schroedl6-Jan-12 4:48 
GeneralRe: ActiveX issue: ATL 8.0 text in IE Pin
birajendu8-Jan-12 20:15
Memberbirajendu8-Jan-12 20:15 
QuestionUsing a webBrowser control to format process feedback. Pin
PapaGeek4-Jan-12 7:04
MemberPapaGeek4-Jan-12 7:04 
AnswerRe: Using a webBrowser control to format process feedback. Pin
Luc Pattyn4-Jan-12 7:33
sitebuilderLuc Pattyn4-Jan-12 7:33 
AnswerRe: Using a webBrowser control to format process feedback. Pin
John Schroedl6-Jan-12 4:40
professionalJohn Schroedl6-Jan-12 4:40 
AnswerRe: Using a webBrowser control to format process feedback. Pin
Sam Hobbs13-Feb-12 19:22
MemberSam Hobbs13-Feb-12 19:22 
QuestionHow to marshal following native C++ objects to C++/CLI? Pin
Alok Jadhav3-Jan-12 19:55
MemberAlok Jadhav3-Jan-12 19:55 
QuestionHow to define the Image in Headerfile like this? VC++2010 Pin
Paramu197330-Dec-11 23:28
MemberParamu197330-Dec-11 23:28 
AnswerRe: How to define the Image in Headerfile like this? VC++2010 Pin
Richard MacCutchan31-Dec-11 1:26
mveRichard MacCutchan31-Dec-11 1:26 
GeneralRe: How to define the Image in Headerfile like this? VC++2010 Pin
Paramu197331-Dec-11 1:57
MemberParamu197331-Dec-11 1:57 

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.