home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS - Coast to Coast / simteldosarchivecoasttocoast2.iso / wpj_mag / wpjv1n4.zip / ROD.ZIP / TESTLIB.C < prev    next >
C/C++ Source or Header  |  1993-02-22  |  2KB  |  103 lines

  1. //************************************************************************
  2. //*
  3. //* testlib.c
  4. //*
  5. //************************************************************************
  6.  
  7. #define    NOCOMM
  8. #define    _WINDOWS
  9. #define    _WINDLL
  10.  
  11. #include <windows.h>
  12. #include <string.h>
  13. #include <stdio.h>
  14. #include <stdlib.h>
  15. #include "dlls.h"
  16. #include "consts.h"
  17.  
  18. int FAR PASCAL LibMain(HANDLE hInstance, WORD wDataSeg, WORD wHeapSize,
  19.                                 LPSTR lpszCmdLine)
  20. {
  21.  
  22.     if(wHeapSize != 0)
  23.         UnlockData(0);
  24.  
  25.     return(1);
  26.  
  27. } /* LibMain */
  28.  
  29. //*************************************************************************>
  30.  
  31. int FAR PASCAL WEP(int doNothing)
  32. {
  33.     return(1);
  34.  
  35. }    /* WEP */
  36.  
  37.  
  38. //*************************************************************************>
  39.  
  40. BOOL FAR PASCAL StepOne(HWND hWnd)
  41. {
  42.     /* local variables */
  43.     static char    tmpBuffer[40];
  44.  
  45.     MessageBox(hWnd, "In DLL!", "Greetings", MB_OK);
  46.  
  47.     /* initialize the DLL variables with the global variables values */
  48.     _asm    mov    ax, ss:[VARIABLEA]
  49.     _asm    mov    [variableA], ax
  50.  
  51.     _asm    mov    ax, ss:[VARIABLEB]
  52.     _asm    mov    [variableB], ax
  53.  
  54.     _asm    mov    ax, ss:[VARIABLEC]
  55.     _asm    mov    [variableC], ax
  56.  
  57.     /* update global variables */
  58.     variableA += (variableB + variableC);
  59.     variableB= 255;
  60.     variableC= 0;
  61.  
  62.     /* reassign DLL variables to global variables */
  63.     _asm    mov    ax, [variableA]
  64.     _asm    mov    ss:[VARIABLEA], ax
  65.  
  66.     _asm    mov    ax, [variableB]
  67.     _asm    mov    ss:[VARIABLEB], ax
  68.  
  69.     _asm    mov    ax, [variableC]
  70.     _asm    mov    ss:[VARIABLEC], ax
  71.  
  72.     return(TRUE);
  73.  
  74. }    /* StepOne */
  75.  
  76. //*************************************************************************>
  77.  
  78. BOOL FAR PASCAL About(HWND hDlg, unsigned message, WORD wParam, LONG lParam)
  79. {
  80.     switch (message) {
  81.  
  82.         case WM_INITDIALOG:
  83.  
  84.             return(TRUE);
  85.  
  86.         case WM_COMMAND:
  87.  
  88.             if(wParam == IDOK || wParam == IDCANCEL) {
  89.  
  90.                 EndDialog(hDlg, TRUE);
  91.                 return(TRUE);
  92.  
  93.             }
  94.  
  95.             break;
  96.     }
  97.  
  98.     return(FALSE);
  99.  
  100. } /* About */
  101.  
  102.  
  103.