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. gcroot constructor crash

gcroot constructor crash

Scheduled Pinned Locked Moved Managed C++/CLI
helpcsharpasp-netdotnetquestion
1 Posts 1 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.
  • X Offline
    X Offline
    Xen3h
    wrote on last edited by
    #1

    Hey there! I'm writing a DLL as a plugin for an unmanaged piece of software, the DLL exports a struct with basic information such as name etc. There is no problem with this, it works well, other than a couple of compiler warnings that I wont go into just yet. In my plugin, I want to use a managed class (__gc). I declare it as global like this: gcroot Omg; Here is the class definition: public __gc class COmg { public: COmg( void ) {} ~COmg( void ) {} }; This still compiles and loads fine, until I try and use my gcroot'ed class: Omg = new COmg; It dies at this line, as far as I know im linking with the .NET framework fine, because everything compiles and runs, and i've done similar projects to this in the past. I tried calling this in try/catch braces but it doesn't help. I'd appreciate any help! Thanks. P.S. Here are the compiler warnings that may be contributing to this? MSVCRT.lib(checkclr.obj) : warning LNK4210: .CRT section exists; there may be unhandled static initializers or terminators MSVCRT.lib(secchk.obj) : warning LNK4210: .CRT section exists; there may be unhandled static initializers or terminators Core.obj : warning LNK4210: .CRT section exists; there may be unhandled static initializers or terminators

    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