For BC31, if there are too many syntax errors, BC31 will crash!
#include <Symbol.h> // There is a syntax error here, crashing here
#include <MyFrame.h>
//-----------------------------------------
#include <Symbol.h> // It should be like this
#include <MyFrame.h>
//==========================================
//The following is an example
#include <Symbol.h>
#include <MyFrame.h>
//Stack's Size
unsigned int _stklen = 50u * 1024u; // Stack size
//Keyboard's Callback Function For All Default Window
int TransrateKey(CObject* pCurObj) // Callback function for virtual keyboard of all default windows
{
return(0);
}
void far VccFunction(CObject* pCurObj)
{
//Create a Dialog On the Center of Desktop
CDialog* pDialog = new CDialog; // Allocate instance
pDialog->CreateWindow(0, 0, 447, 364, "Radio Button Demo"); // Create window
pDialog->Center(); // Center window
//Register Callback Function for Window
pDialog->SetTimeFc(NULL); // Register timer callback function
pDialog->SetDrawFc(NULL); // Register drawing callback function
pDialog->SetHelpFc(NULL); // Register help callback function
pDialog->SetKeyboardFc(NULL); // Register virtual keyboard callback function
//Create Close's Button Control
CCloseButton* pCloseButton = new CCloseButton(pDialog); // Allocate and create close button
//Create a Button Control
CButton* pButton1 = new CButton(pDialog);
pButton1->CreateObject(225, 141, 192, 24, "OK(\x3\E\x3)");
pButton1->SetShortcutKey(VK_ALT_E);
pButton1->SetFc(ClickEnterButton);
pButton1->SetID(BUTTONBASE + 1 - 1);
//Create a Button Control
CButton* pButton2 = new CButton(pDialog);
pButton2->CreateObject(223, 183, 192, 24, "Cancel(\x3\C\x3)");
pButton2->SetShortcutKey(VK_ALT_C);
pButton2->SetFc(ClickCancelButton);
pButton2->SetID(BUTTONBASE + 2 - 1);
//Create Group Control
CStatic* pGroup1 = new CStatic(pDialog);
pGroup1->CreateObject(10, 32, 204, 94, "Week");
pGroup1->SetID(GROUPBASE + 1 - 1);
//Create Radio Control
CRadio* pRadio1 = new CRadio(pDialog);
pRadio1->CreateObject(22, 53, 73, 24, "Monday");
pRadio1->SetStatic(TRUE);
pRadio1->SetRadio(TRUE);
pRadio1->SetID(RADIOBASE + 1 - 1);
//Create Radio Control
CRadio* pRadio2 = new CRadio(pDialog);
pRadio2->CreateObject(22, 76, 73, 24, "Tuesday");
pRadio2->SetID(RADIOBASE + 2 - 1);
//Create Radio Control
CRadio* pRadio3 = new CRadio(pDialog);
pRadio3->CreateObject(22, 98, 73, 24, "Wednesday");
pRadio3->SetID(RADIOBASE + 3 - 1);
//Create Group Control
CStatic* pGroup2 = new CStatic(pDialog);
pGroup2->CreateObject(226, 32, 204, 94, "Gender");
pGroup2->SetID(GROUPBASE + 2 - 1);
//Create Radio Control
CRadio* pRadio4 = new CRadio(pDialog);
pRadio4->CreateObject(240, 53, 57, 24, "Male");
pRadio4->SetStatic(TRUE);
pRadio4->SetRadio(TRUE);
pRadio4->SetID(RADIOBASE + 4 - 1);
//Create Radio Control
CRadio* pRadio5 = new CRadio(pDialog);
pRadio5->CreateObject(240, 83, 57, 24, "Female");
pRadio5->SetID(RADIOBASE + 5 - 1);
//Create Check Control
CRadio* pCheck1 = new CRadio(pDialog);
pCheck1->CreateObject(22, 154, 57, 24, "Reading");
pCheck1->SetBox(TRUE);
pCheck1->SetID(CHECKBASE + 1 - 1);
pCheck1->SetID(CHECKBASE + 1 - 1);
//Create Check Control
CRadio* pCheck2 = new CRadio(pDialog);
pCheck2->CreateObject(22, 180, 57, 24, "Running");
pCheck2->SetBox(TRUE);
pCheck2->SetID(CHECKBASE + 2 - 1);
pCheck2->SetID(CHECKBASE + 2 - 1);
//Create Check Control
CRadio* pCheck3 = new CRadio(pDialog);
pCheck3->CreateObject(22, 202, 73, 24, "Playing Football");
pCheck3->SetBox(TRUE);
pCheck3->SetID(CHECKBASE + 3 - 1);
pCheck3->SetID(CHECKBASE + 3 - 1);
//Create Group Control
CStatic* pGroup3 = new CStatic(pDialog);
pGroup3->CreateObject(10, 133, 204, 96, "Week");
pGroup3->SetID(GROUPBASE + 3 - 1);
//Create Edit Control
CEdit* pEdit1 = new CEdit(pDialog);
pEdit1->CreateObject(97, 153, 106, 21, NULL);
pEdit1->SetID(EDITBASE + 1 - 1);
//Create Edit Control
CEdit* pEdit2 = new CEdit(pDialog);
pEdit2->CreateObject(99, 180, 106, 21, NULL);
pEdit2->SetID(EDITBASE + 2 - 1);
//Show Window
pDialog->ShowWindow(); // Show window
//go into Message Loop
pDialog->DoModal(); // Enter window message loop
//Destroy Window
delete pDialog; // Delete dialog box
return;
}
int main(int argc, char** argv)
{
//Initlize Sysem Kernel
if (!::InitSystem(argc, argv)) // Initialize system kernel
{
::CloseSystem(); // Close system kernel
printf("\nInit System Error!");
return(0);
}
//Callback Function
::VccFunction(NULL);
//Close Sysem Kernel
::CloseSystem(); // Close system kernel
return(1);
}