How to call windows form from native cpp
- by Jenuel
I have an existing project using c/c++ .NET. Currently I have been given a task to create a windows form from my existing code.
So i have add new project windows form application in the existing c/c++ projects.form.h, form.cpp has been automatically created.
Now I am having problem to call the window from my c files.
Even i could not call the form.h file from my c program.
Is there any solution for this problem.
Listed here is the coding....
login.c
int LoginMain(int id,int task)
{
LoginClear();
LoginEntry(id,task);
dp_in = 1;
Rep();
//I WOULD LIKE TO CALL THE FORM AT THIS STAGE
Cashier();
dp_in = 0;
Login();
return(0);
}
form.cpp
[STAThreadAttribute]
int main(array ^args)
{
// Enabling Windows XP visual effects before any controls are created
Application::EnableVisualStyles();
Application::SetCompatibleTextRenderingDefault(false);
// Create the main window and run it
Application::Run(gcnew Form1());
return 0;
}