Visual C++ Projects MFC Application , type your project’s ...+.net_with_activex.pdf · Select...
-
Upload
nguyenkhuong -
Category
Documents
-
view
232 -
download
1
Transcript of Visual C++ Projects MFC Application , type your project’s ...+.net_with_activex.pdf · Select...
![Page 1: Visual C++ Projects MFC Application , type your project’s ...+.net_with_activex.pdf · Select Visual C++ Projects, MFC Application, type your project ... Project Types: Visual Basic](https://reader031.fdocuments.net/reader031/viewer/2022020114/5b14a3127f8b9a347c8e2893/html5/thumbnails/1.jpg)
1. Open Microsoft Visual Studio .Net 2003. 2. Select Visual C++ Projects, MFC Application, type your project’s name and
then click “OK”
3. In the Application Type page, select “Dialog based” and click “Finish”.
![Page 2: Visual C++ Projects MFC Application , type your project’s ...+.net_with_activex.pdf · Select Visual C++ Projects, MFC Application, type your project ... Project Types: Visual Basic](https://reader031.fdocuments.net/reader031/viewer/2022020114/5b14a3127f8b9a347c8e2893/html5/thumbnails/2.jpg)
4. Mouse right click and select “Insert ActiveX Control”.
5.Select TMC12X Control and click “OK”.
6. Mouse right click and select “Add Variable”.
![Page 3: Visual C++ Projects MFC Application , type your project’s ...+.net_with_activex.pdf · Select Visual C++ Projects, MFC Application, type your project ... Project Types: Visual Basic](https://reader031.fdocuments.net/reader031/viewer/2022020114/5b14a3127f8b9a347c8e2893/html5/thumbnails/3.jpg)
7. Check “Control variable”, select the “IDC_TMC12XCTRL1” Control ID, enter a variable name for this control object, and then click “Finish”.
8.You can look CTmc12xctrl1 contained many members in Class View
![Page 4: Visual C++ Projects MFC Application , type your project’s ...+.net_with_activex.pdf · Select Visual C++ Projects, MFC Application, type your project ... Project Types: Visual Basic](https://reader031.fdocuments.net/reader031/viewer/2022020114/5b14a3127f8b9a347c8e2893/html5/thumbnails/4.jpg)
9.Move mouse to TMC12 ActiveX control and mouse right click, select “Add Event Handle”
10.Select CTMC12VCNet3Dlg then click “Add and Edit”
![Page 5: Visual C++ Projects MFC Application , type your project’s ...+.net_with_activex.pdf · Select Visual C++ Projects, MFC Application, type your project ... Project Types: Visual Basic](https://reader031.fdocuments.net/reader031/viewer/2022020114/5b14a3127f8b9a347c8e2893/html5/thumbnails/5.jpg)
11.Insert Botton1 on the dialog.
12. Insert code in the OnBnClickedButton1 function. Example code: short TotalBoard=0;
short J;
TotalBoard=TMC12Con.DriverInit() ;
if (TotalBoard==0) return;
TMC12Con.SetActiveBoard(0) ;
TMC12Con.DigitalOut(0x0f);
J=TMC12Con.DigitalIn();
if (J!=0x0f)
{
MessageBox("Output Error",NULL,MB_OK);
}
else
{
MessageBox("Output Right",NULL,MB_OK);
}
![Page 6: Visual C++ Projects MFC Application , type your project’s ...+.net_with_activex.pdf · Select Visual C++ Projects, MFC Application, type your project ... Project Types: Visual Basic](https://reader031.fdocuments.net/reader031/viewer/2022020114/5b14a3127f8b9a347c8e2893/html5/thumbnails/6.jpg)
13.Click the “Debug / Start” menu item.
![Page 7: Visual C++ Projects MFC Application , type your project’s ...+.net_with_activex.pdf · Select Visual C++ Projects, MFC Application, type your project ... Project Types: Visual Basic](https://reader031.fdocuments.net/reader031/viewer/2022020114/5b14a3127f8b9a347c8e2893/html5/thumbnails/7.jpg)
14.Click “Yes”.