home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 March / CMCD0304.ISO / Software / Freeware / Programare / nullsoft / nsis20.exe / Contrib / ExDLL / exdll.c < prev    next >
C/C++ Source or Header  |  2003-11-12  |  928b  |  38 lines

  1. #include <windows.h>
  2. #include "exdll.h"
  3.  
  4. HINSTANCE g_hInstance;
  5.  
  6. HWND g_hwndParent;
  7.  
  8. void __declspec(dllexport) myFunction(HWND hwndParent, int string_size, 
  9.                                       char *variables, stack_t **stacktop)
  10. {
  11.   g_hwndParent=hwndParent;
  12.  
  13.   EXDLL_INIT();
  14.  
  15.  
  16.   // note if you want parameters from the stack, pop them off in order.
  17.   // i.e. if you are called via exdll::myFunction file.dat poop.dat
  18.   // calling popstring() the first time would give you file.dat,
  19.   // and the second time would give you poop.dat. 
  20.   // you should empty the stack of your parameters, and ONLY your
  21.   // parameters.
  22.  
  23.   // do your stuff here
  24.   {
  25.     char buf[1024];
  26.     wsprintf(buf,"$0=%s\n",getuservariable(INST_0));
  27.     MessageBox(g_hwndParent,buf,0,MB_OK);
  28.   }
  29. }
  30.  
  31.  
  32.  
  33. BOOL WINAPI DllMain(HANDLE hInst, ULONG ul_reason_for_call, LPVOID lpReserved)
  34. {
  35.   g_hInstance=hInst;
  36.     return TRUE;
  37. }
  38.