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. System::String and top level handles???

System::String and top level handles???

Scheduled Pinned Locked Moved Managed C++/CLI
csharpvisual-studiohelpquestion
3 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.
  • J Offline
    J Offline
    John L DeVito
    wrote on last edited by
    #1

    hey folks, I'm trying to build my project and I get the following error message: Error 4 error C3149: 'System::String' : cannot use this type here without a top-level '^' c:\documents and settings\john\my documents\visual studio 2005\projects\rtdispatch\rtdispatch\DBConnection.h 11 Here is the entire file: #include "StdAfx.h" #include "DBConnection.h" using namespace System; DBConnection::DBConnection(void){} static void DBConnectToDataSource(String connectString){} // This is the culprit static void DBDisconnectFromDataSource(void){} Whenever I attempt to use a String, I get this error message. Do I need to instantiate an a String object or something. If so this is not what I'm looking for. I'm trying to simpl declare and define a C style char * Any info would be great. Thanks, John

    N 1 Reply Last reply
    0
    • J John L DeVito

      hey folks, I'm trying to build my project and I get the following error message: Error 4 error C3149: 'System::String' : cannot use this type here without a top-level '^' c:\documents and settings\john\my documents\visual studio 2005\projects\rtdispatch\rtdispatch\DBConnection.h 11 Here is the entire file: #include "StdAfx.h" #include "DBConnection.h" using namespace System; DBConnection::DBConnection(void){} static void DBConnectToDataSource(String connectString){} // This is the culprit static void DBDisconnectFromDataSource(void){} Whenever I attempt to use a String, I get this error message. Do I need to instantiate an a String object or something. If so this is not what I'm looking for. I'm trying to simpl declare and define a C style char * Any info would be great. Thanks, John

      N Offline
      N Offline
      Nish Nishant
      wrote on last edited by
      #2

      System::String does not support stack semantics, so you need to use a String^ instead of a String.

      J 1 Reply Last reply
      0
      • N Nish Nishant

        System::String does not support stack semantics, so you need to use a String^ instead of a String.

        J Offline
        J Offline
        John L DeVito
        wrote on last edited by
        #3

        Thanks so much Nish, works perfectly now, I appreciate it :-D Thanks, John

        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