How to call windows form from native cpp

Posted by Jenuel on Stack Overflow See other posts from Stack Overflow or by Jenuel
Published on 2009-10-02T07:42:10Z Indexed on 2010/05/06 0:08 UTC
Read the original article Hit count: 168

Filed under:
|

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;
}

© Stack Overflow or respective owner

Related posts about Windows

Related posts about form