Measurement-computing Personal488 rev.3.0 For DOS & Windows 3.Xi Uživatelský manuál Strana 243

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 400
  • Tabulka s obsahem
  • ŘEŠENÍ PROBLÉMŮ
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 242
10E. C Languages II. SOFTWARE GUIDES - 10. Driver488/W31
II-228 Personal488 Users Manual, Rev. 3.0
/* Inform Windows painting is complete */
EndPaint(hWnd, &ps);
break; /* End of WM_PAINT */
case WM_CLOSE: /* close the window */
/* Destroy child windows, modeless dialogs, then, this window */
hDriver=FindWindow((LPSTR)"Driver488/W31 Loader",
(LPSTR)"Driver488/W31");
SendMessage(hDriver, WM_DESTROY, 0, 0L);
DestroyWindow(hWnd);
if (hWnd == hWndMain)
PostQuitMessage(0); /* Quit the application */
break;
default:
/* For any message for which you dont specifically provide a */
/* service routine, you should return the message to Windows */
/* for default message processing. */
return DefWindowProc(hWnd, Message, wParam, lParam);
}
return 0L;
} /* End of WndProc */
/*******************************************************************/
/* */
/* Dialog Window Procedure */
/* */
/* This procedure is associated with the dialog box that is */
/* included inthe function name of the procedure. It provides the */
/* service routines for the events (messages) that occur because */
/* the end user operates one of the dialog boxs buttons, entry */
/* fields, or controls. */
/*******************************************************************/
BOOL FAR PASCAL EX3DLGMsgProc(HWND hWndDlg, WORD Message, WORD wParam,
LONG lParam)
{
double sum, voltage;
int i, hundred[100];
TermT noterm;
switch(Message) {
case WM_INITDIALOG:
cwCenter(hWndDlg, 0);
/* initialize working variables */
/* open Driver488/W31 */
if ((ieee=OpenName(IEEE))<0) {
MessageBox(hWndDlg, (LPSTR)"Cannot initialize IEEE system", NULL,
MB_OK);
EndDialog(hWndDlg, TRUE);
return TRUE;
}
/* open device named ADC */
Error(ieee, OFF);
switch (adc=OpenName(ADC)) {
case -2:
MessageBox(hWndDlg, (LPSTR)"ADC device already open", NULL,
MB_OK);
EndDialog(hWndDlg, TRUE);
return TRUE;
case -1:
switch (devhandle=OpenName(WAVE)) {
case -2:
MessageBox(hWndDlg, (LPSTR)"WAVE device already open", NULL, MB_OK);
EndDialog(hWndDlg, TRUE);
Zobrazit stránku 242
1 2 ... 238 239 240 241 242 243 244 245 246 247 248 ... 399 400

Komentáře k této Příručce

Žádné komentáře