How to use MFC in CLR Console Applications
-
Hi All, I am beginner to MFC programming. I created one CLR Console Applications project, here in this project I want to use MFC classes like CString,CArray,CFile....etc. In project settings I used "Use MFC in a shared DLL" And in project stdafx.h file I am adding
#include<afx.h>
I also used few classes from MFC in the application and complied, I am not getting any errors. But while running the application, I am facing crash in the application. and the error message is as follows An unhandled exception of type 'System.AccessViolationException' occurred in Unknown Module. Additional information:Attempted to read or write protected memory. This is often an indication that other memory is corrupt. Please provide some solution for this. Thanks in advance. Regards, Kumar
-
Hi All, I am beginner to MFC programming. I created one CLR Console Applications project, here in this project I want to use MFC classes like CString,CArray,CFile....etc. In project settings I used "Use MFC in a shared DLL" And in project stdafx.h file I am adding
#include<afx.h>
I also used few classes from MFC in the application and complied, I am not getting any errors. But while running the application, I am facing crash in the application. and the error message is as follows An unhandled exception of type 'System.AccessViolationException' occurred in Unknown Module. Additional information:Attempted to read or write protected memory. This is often an indication that other memory is corrupt. Please provide some solution for this. Thanks in advance. Regards, Kumar
You shouldn't need to use the MFC classes in the application. CLR provides several classes for the same like
String
,Array
,File
etc.«_Superman_» I love work. It gives me something to do between weekends.
Microsoft MVP (Visual C++) -
You shouldn't need to use the MFC classes in the application. CLR provides several classes for the same like
String
,Array
,File
etc.«_Superman_» I love work. It gives me something to do between weekends.
Microsoft MVP (Visual C++)Thanks for your reply Superman :) still is there any way to use MFC in CLR Console Application? Thanks in advance. Regards, Kumar
-
You shouldn't need to use the MFC classes in the application. CLR provides several classes for the same like
String
,Array
,File
etc.«_Superman_» I love work. It gives me something to do between weekends.
Microsoft MVP (Visual C++)HI, Along with strings and arrays i want to use CDilogs also, please provide the solution for adding the MFC stuff to CLR Console Application. Regards, Kumar