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. Call proc inside namespace from outside the namespace

Call proc inside namespace from outside the namespace

Scheduled Pinned Locked Moved Managed C++/CLI
csharphelpquestion
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.
  • U Offline
    U Offline
    User 625201
    wrote on last edited by
    #1

    I have a Windows Form Application (.NET), I am having trouble calling a procedure within the namespace from outside the namespace. I have the procedure displaychar outside the namespace which is a wrapper to be called from another programming language. The procedure showchar is within the namespace. The code: void displaychar(int mychar) //outside the namespace { //showchar(mychar); formoutput::Form1::showchar(mychar); } --results in: error C2653: 'formoutput' : is not a class or namespace name Anyone have any ideas?? -Don

    K 1 Reply Last reply
    0
    • U User 625201

      I have a Windows Form Application (.NET), I am having trouble calling a procedure within the namespace from outside the namespace. I have the procedure displaychar outside the namespace which is a wrapper to be called from another programming language. The procedure showchar is within the namespace. The code: void displaychar(int mychar) //outside the namespace { //showchar(mychar); formoutput::Form1::showchar(mychar); } --results in: error C2653: 'formoutput' : is not a class or namespace name Anyone have any ideas?? -Don

      K Offline
      K Offline
      kmcguire
      wrote on last edited by
      #2

      Mabye, formoutput really is not a namespace. I am figuring it may well be. void displaychar(int mychar) //outside the namespace { //showchar(mychar); Form1::showchar(mychar); } OR, You may not be including the header file ".\form1.h" witch should define the namespace formoutput. Use #include ".\form1.h" at the top of the source. Then call it, however i bet you might get the error. c:\Documents and Settings\default user.JOSH\My Documents\Visual Studio Projects\Tmle\mlr.cpp(105): error C2352: 'System::Windows::Forms::Form::showchar' : illegal call of non-static member function or something. If so, it means you must first create the class Form1 or gain a pointer to it when it is created from Application::Run(new Form1());

      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