Call proc inside namespace from outside the namespace
-
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
-
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
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 fromApplication::Run(new Form1());