Hello Rooters,
I am trying to build a standalone Data Aquistion Program using only a GUI. But everytime I run my compiled program not only the gui pops up, also a console comes with it.
How do I get rid of the console for example for the little test program below? I am using Root ver.4.00/03 on a win2k machine with vc++6. I have tried to create a win32 Application, but then the program crashes when startet.
(I have used the WinMain() entry point and extracted the right argc, and argv from LpCmdLine)
Thank you
Lutz
////////////////////MyMainFrame.h//////////////////////////
#ifndef __MyMainFrame_H_
#define __MyMainFrame_H_
#include <TGFrame.h>
class MyMainFrame : public TGMainFrame
{
public:
MyMainFrame(const TGWindow *p, int w, int h);
virtual ~MyMainFrame();
ClassDef(MyMainFrame,1) //GUI example
};
#endif
/////////////////rootguitest.cpp///////////////////////////
#include <TGApplication.h>
#include <TGClient.h>
#include <TGButton.h>
#include "MyMainFrame.h"
MyMainFrame::MyMainFrame(const TGWindow *p, int w, int h)
:TGMainFrame(p,w,h)
{
TGTextButton *exit = new TGTextButton(this,"&Exit",
"gApplication->Terminate()");
this->AddFrame(exit, new TGLayoutHints(kLHintsCenterX|kLHintsCenterY,
20,20,20,20));
this->SetWindowName("Test");
this->MapSubwindows();
this->Resize(this->GetDefaultSize());
this->MapWindow();
}
MyMainFrame::~MyMainFrame()
{
this->Cleanup();
delete this;
}
int main(int argc,char *argv[])
{
TGApplication theApp("App",&argc,argv);
new MyMainFrame(gClient->GetRoot(),200,200);
theApp.Run();
return 0;
}