Talking about the development of Embedded Visual C ++ 4.0 for Windows CE.NET

zhaozj2021-02-16  48

Talking about the development of Embedded Visual C 4.0 for Windows CE.NET

Summary: Description Using Embedded Visual C 4.0 to implement the development technology of embedded Windows CE.NET, introduce specific implementation ideas and programs.

Keywords: embedded system Windows CE.NET Embedded Visual C 4.0

This article mainly tells how to use Embwedded Visual C 4.0 for development of Windows CE.NET? If you are already able to apply the best development tools on Microsoft Visual C this Microsoft Windows platform, this development environment for embedded Windows CE.NET Embwedded Visual C 4.0 is relatively simple.

About Embedded Visual C 4.0 Wizard

Embedded Visual C 4.0 enables you to develop applications running on Windows CE.NET, in addition, including the help tools you develop for Windows CE platforms and devices for Windows CE platforms. . You have to figure out the specificity of the target environment, Windows CE.NET and the new wizard. Here we will focus on "WIZARDS".

The application wizard taken in Embedded Visual C 4.0 is a very useful tool. There are a total of seven types of new wizards, their usage methods and regular wizards in Visual C have no difference, just they are used for Windows CE.NET development. You can use them to quickly create a basic application, dynamic connection library (DLL), or component application shell. These seven new guides are: WCE applications; WCE MFC wizard (.dll); WCE dynamic connection library; WCE Static Library Wizard; WCE ATL COM App Wizard; WCE MFC ActiveX Control Wizard and WCE MFC Wizard (.exe ). Compared to desktop computer systems, Win32 APIs (including MFC) have great restrictions, for example, many behaviors in the Windows CE system are not very obvious, even if she also allows you to operate like a desktop PC. Of course, with the popularity of Windows CE.NET, there must be more Embedded Visual C 4.0 wizards.

Write the first CE application using Embedded Visual C 4.0

We will develop a CE application through a simple example to explain how the Embedded Visual C 4.0 WCE MFC Application Wizard (Exe) is developed. Embedded Visual C 4.0 provides a variety of options for the following CPU types: ARM, MIPS, SHX, and X86. Although as a compiler of Windows Ce.NET, she also supports many different object devices. The user enters two numbers in the edit box, click the "Calculating Result" button, the two results are displayed in the third editing box, which can be one of the four algorithms. Writing a small program name Y3.

1. Custom dialog template

Set the properties of the dialog guide; place the control to the dialog and set the control jump order.

(1) Set the properties of the dialog

(2) Add controls and set control properties. This item introduces seven graphics controls, static text controls, edit boxes, group boxes, buttons, check boxes, and radical boxes.

(3) Set the sequence of checks in the control, that is, give each control order number.

2. Define member variables

The variable can be valued or control. The latter indicates an object defined by the control class. The former indicates that the defined variable is a value associated with the control.

3. Increase the event handler

4. Add code

The functions that need to be implemented include: OnbuttonResult (), ONCHANGEDITADD1 (), ONCHANGEDITADD2 (), ONRA

DioAdd (), OnradioDiv (), Onradiomulti (), onradiosub ().

Void cy3dlg :: onchangeeditadd1 ()

{

// Todo: if this is a richedit control, The Control Will NOT

// send this notification unless :: OnInitdialog ()

// function and call cricheditctrl (). setEventmask ()

// with the enm_change flag Orad Into the mask.

// Todo: Add Your Control Notification Handler Code Here

IF (m_batonce)

{

OnbuttonResult ();

}

Void cy3dlg :: onchangeeditadd2 ()

{

// Todo: if this is a richedit control, The Control Will NOT

// send this notification unless :: OnInitdialog ()

// function and call cricheditctrl (). setEventmask ()

// with the enm_change flag Orad Into the mask.

// Todo: Add Your Control Notification Handler Code Here

Updatedata ();

IF (m_batonce)

{

OnbuttonResult ();

}

}

Void cy3dlg :: onradioAdd ()

{

// Todo: Add Your Control Notification Handler Code Here

Updatedata (TRUE);

m_stropr = " ";

Updatedata (FALSE);

}

Void cy3dlg :: onlineIodiv ()

{

// Todo: Add Your Control Notification Handler Code Here

Updatedata (TRUE);

m_stropr = "/";

Updatedata (FALSE);

}

Void cy3dlg :: online omulti ()

{

// Todo: Add Your Control Notification Handler Code Here

Updatedata (TRUE);

m_stropr = "*";

Updatedata (FALSE);

}

Void cy3dlg :: onradiosub ()

{

// Todo: Add Your Control Notification Handler Code Here

Updatedata (TRUE);

m_stropr = "-";

Updatedata (FALSE);

}

Void cy3dlg :: onbuttonResult ()

{

// Todo: Add Your Control Notification Handler Code Here

Updatedata (TRUE);

Switch (m_dopr)

{

Case 0: / * addition * /

m_fresult = m_fadd1 m_fadd2;

Break;

Case 1: / * subtraction * /

m_fresult = m_fadd1-m_fadd2;

Break;

Case 2: / * Multiplication * /

m_fresult = m_fadd1 * m_fadd2;

Break;

Case 3: / * division * /

m_fresult = m_fadd1 / m_fadd2;

Break;

}

Updatedata (FALSE);

}

Frequent function updatedata () in the above code, its format is as follows:

Bool UpdataData (Bool BsaveandValidate = true); Updatedata () is a member function of the MFC class CWnd, and the CWnd class is a very important MFC class. All window classes are directly or indirectly inherited. The initial value of each associated function is initialized in the function cy3dlg :: Cy3dlg.

Cy3dlg :: cy3dlg (cwnd * pparent / * = null * /)

: Cdialog (cy3dlg :: IDd, pparent)

{

// {{AFX_DATA_INIT (CY3DLG)

m_fresult = 0.0;

m_dopr = 0;

m_stropr = _t (" ");

m_batonce = false;

m_fadd1 = 0.0;

M_FADD2 = 0.0;

//}} AFX_DATA_INIT

// Note That Loadicon Does Not Require a Subsequent Destroyicon in Win32

m_hicon = AFXGetApp () -> loadicon (iDR_mainframe);

}

Programming, congratulations! You have completed the development of the first Windows CE application. Just as you see, use Visual C to develop Windows CE applications and develop a Win32 application is the same. Most steps are the same. At this point, this article has made a simple introduction to how to develop a Windows CE application on how to use Visual C . In the following chapters, you can get more knowledge about Windows CE and handheld computing.

转载请注明原文地址:https://www.9cbs.com/read-24584.html

New Post(0)