wish2hate
January 28th, 2009, 07:53 PM
I have my program working fine on console right now and I would like to learn how to display them on visuals. I've learned some GUI but now I just don't know how to put them together into one file.
If someone is willing to show me an example of how to solve the following problem, then I can get started to outputing to GUI.
Here is a simple program that I hope it can display a visual.
#ifdef __BORLANDC__
#pragma hdrstop // borland specific
#include <condefs.h>
#pragma argsused
USEUNIT("Tserial_event.cpp");
#endif
/**************** this is what troubles me*****************/
#include "conio.h"
#include "Tserial_event.h"
/******************troubles ends***********************/
#using <mscorlib.dll>
#using <System.dll>
#using <System.Windows.Forms.dll>
using namespace System;
using namespace System::Windows::Forms;
int _stdcall WinMain() {
Char h = 'h';
MessageBox::Show(h.ToString(), S"testing if this works");
return 0;
}
I know I don't really have to attach any of the ifdef and includes in order to make my main work, but the problem is I have to have those to read data from serial port. My problem right now is that I am able to read from serial port, and I know how to display visuals, but I am unable to combine them together. (I'm quiet new in programming in C++). Can someone please provide me some info if this is not the correct way to do it?
If someone is willing to show me an example of how to solve the following problem, then I can get started to outputing to GUI.
Here is a simple program that I hope it can display a visual.
#ifdef __BORLANDC__
#pragma hdrstop // borland specific
#include <condefs.h>
#pragma argsused
USEUNIT("Tserial_event.cpp");
#endif
/**************** this is what troubles me*****************/
#include "conio.h"
#include "Tserial_event.h"
/******************troubles ends***********************/
#using <mscorlib.dll>
#using <System.dll>
#using <System.Windows.Forms.dll>
using namespace System;
using namespace System::Windows::Forms;
int _stdcall WinMain() {
Char h = 'h';
MessageBox::Show(h.ToString(), S"testing if this works");
return 0;
}
I know I don't really have to attach any of the ifdef and includes in order to make my main work, but the problem is I have to have those to read data from serial port. My problem right now is that I am able to read from serial port, and I know how to display visuals, but I am unable to combine them together. (I'm quiet new in programming in C++). Can someone please provide me some info if this is not the correct way to do it?