Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How to use MFC in CLR Console Applications

How to use MFC in CLR Console Applications

Scheduled Pinned Locked Moved C / C++ / MFC
c++dotnetperformancehelptutorial
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    User 4396598
    wrote on last edited by
    #1

    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

    _ 1 Reply Last reply
    0
    • U User 4396598

      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

      _ Offline
      _ Offline
      _Superman_
      wrote on last edited by
      #2

      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++)

      U 2 Replies Last reply
      0
      • _ _Superman_

        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++)

        U Offline
        U Offline
        User 4396598
        wrote on last edited by
        #3

        Thanks for your reply Superman :) still is there any way to use MFC in CLR Console Application? Thanks in advance. Regards, Kumar

        1 Reply Last reply
        0
        • _ _Superman_

          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++)

          U Offline
          U Offline
          User 4396598
          wrote on last edited by
          #4

          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

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups