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. Managed C++/CLI
  4. Running into issue of managed and unmanaged code

Running into issue of managed and unmanaged code

Scheduled Pinned Locked Moved Managed C++/CLI
helpcsharpvisual-studioquestion
2 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.
  • V Offline
    V Offline
    Vijay Rajanna
    wrote on last edited by
    #1

    Hi, I'm using VC ++ , Visual studio 2010 express edition. And trying to create simple form application, and a thread and some control classes in my application. 1) But whenever I try to crate a thread class which is derived from "CbaseThread" class, I always get an error .. " Unmanaged class can't derive from a managed Class " 2) If I try to make my thread class as managed, then I can't derived from "CbaseThread", since the class becomes sealed . 3) In one of the control class I need a reference to "FORM1", which is created inside Application.Run (gcnew Form1()).. Even getting this reference is also not possible. Can anyone please help me.. I can completely manage with "Unmanaged Code.." How can I have just unmanaged code throughout my application. If having only unmanaged code is not at all possible, how can i solve above mentioned problem. ie working with both managed and unmanaged code together. Thanks in advance. Regards, Vijay.

    M 1 Reply Last reply
    0
    • V Vijay Rajanna

      Hi, I'm using VC ++ , Visual studio 2010 express edition. And trying to create simple form application, and a thread and some control classes in my application. 1) But whenever I try to crate a thread class which is derived from "CbaseThread" class, I always get an error .. " Unmanaged class can't derive from a managed Class " 2) If I try to make my thread class as managed, then I can't derived from "CbaseThread", since the class becomes sealed . 3) In one of the control class I need a reference to "FORM1", which is created inside Application.Run (gcnew Form1()).. Even getting this reference is also not possible. Can anyone please help me.. I can completely manage with "Unmanaged Code.." How can I have just unmanaged code throughout my application. If having only unmanaged code is not at all possible, how can i solve above mentioned problem. ie working with both managed and unmanaged code together. Thanks in advance. Regards, Vijay.

      M Offline
      M Offline
      Mark Salsbery
      wrote on last edited by
      #2

      What is CBaseThread?

      Vijay Sringeri wrote:

      In one of the control class I need a reference to "FORM1", which is created inside Application.Run (gcnew Form1())..

      Move the definition from the Run method to a place where you have access to it.

      Vijay Sringeri wrote:

      How can I have just unmanaged code throughout my application.

      Don't use Windows Forms and make your project an unmanaged c++ project. Windows Forms is part of the .Net framework so has to use managed code.

      Mark Salsbery :java:

      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