home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c495 / 5.ddi / WATCM955.ARJ / DLL.SDK / DLL16.C next >
Encoding:
C/C++ Source or Header  |  1993-02-16  |  1002 b   |  45 lines

  1. /*
  2.  *  DLL16.C
  3.  *
  4.  *  Compile:    wcc dll16 /mc /zw /zu /zc /d2
  5.  *  Link:    wlink @dll16
  6.  *  DLL16.LNK:    debug all
  7.  *        system windows dll initinstance memory
  8.  *        file dll16
  9.  *        option oneautodata
  10.  *        option map
  11.  *        option heapsize=32K
  12.  *        export _Lib1.1
  13.  *        libfile libentry
  14.  */
  15. #include <stddef.h>
  16. #include <windows.h>
  17.  
  18. extern void BreakPoint( void );
  19. #pragma aux BreakPoint = 0xcc;
  20.  
  21. extern short GetSS( void );
  22. #pragma aux GetSS = 0x8C 0xD0 value[ax];
  23.  
  24. int PASCAL LibMain( HANDLE hmod, WORD dataseg, WORD heap, LPSTR cmdline )
  25. {
  26.   short i;
  27.   char buf[128];
  28.  
  29. //BreakPoint();
  30.   i = GetSS();
  31.   sprintf( buf, "DLL16 Started, SS=%hx", i );
  32.   MessageBox( NULL, buf, "DLL16", MB_OK | MB_TASKMODAL );
  33.   return( 1 );
  34. }
  35.  
  36. long cdecl FAR Lib1( WORD a, LONG b, WORD c, WORD d, LONG e )
  37. {
  38.   char buf[128];
  39.  
  40.   sprintf( buf, "Lib1: a=%hx, b=%lx, c=%hx, d=%hx, e=%lx",
  41.         a, b, c, d, e );
  42.   MessageBox( NULL, buf, "DLL16", MB_OK | MB_TASKMODAL );
  43.   return( a + b + c + d + e );
  44. }
  45.