home *** CD-ROM | disk | FTP | other *** search
- //************************************************************************
- //*
- //* testlib.c
- //*
- //************************************************************************
-
- #define NOCOMM
- #define _WINDOWS
- #define _WINDLL
-
- #include <windows.h>
- #include <string.h>
- #include <stdio.h>
- #include <stdlib.h>
- #include "dlls.h"
- #include "consts.h"
-
- int FAR PASCAL LibMain(HANDLE hInstance, WORD wDataSeg, WORD wHeapSize,
- LPSTR lpszCmdLine)
- {
-
- if(wHeapSize != 0)
- UnlockData(0);
-
- return(1);
-
- } /* LibMain */
-
- //*************************************************************************>
-
- int FAR PASCAL WEP(int doNothing)
- {
- return(1);
-
- } /* WEP */
-
-
- //*************************************************************************>
-
- BOOL FAR PASCAL StepOne(HWND hWnd)
- {
- /* local variables */
- static char tmpBuffer[40];
-
- MessageBox(hWnd, "In DLL!", "Greetings", MB_OK);
-
- /* initialize the DLL variables with the global variables values */
- _asm mov ax, ss:[VARIABLEA]
- _asm mov [variableA], ax
-
- _asm mov ax, ss:[VARIABLEB]
- _asm mov [variableB], ax
-
- _asm mov ax, ss:[VARIABLEC]
- _asm mov [variableC], ax
-
- /* update global variables */
- variableA += (variableB + variableC);
- variableB= 255;
- variableC= 0;
-
- /* reassign DLL variables to global variables */
- _asm mov ax, [variableA]
- _asm mov ss:[VARIABLEA], ax
-
- _asm mov ax, [variableB]
- _asm mov ss:[VARIABLEB], ax
-
- _asm mov ax, [variableC]
- _asm mov ss:[VARIABLEC], ax
-
- return(TRUE);
-
- } /* StepOne */
-
- //*************************************************************************>
-
- BOOL FAR PASCAL About(HWND hDlg, unsigned message, WORD wParam, LONG lParam)
- {
- switch (message) {
-
- case WM_INITDIALOG:
-
- return(TRUE);
-
- case WM_COMMAND:
-
- if(wParam == IDOK || wParam == IDCANCEL) {
-
- EndDialog(hDlg, TRUE);
- return(TRUE);
-
- }
-
- break;
- }
-
- return(FALSE);
-
- } /* About */
-
-
-