home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / sysmgmt / msi / custact1 / custact1.cpp next >
Encoding:
C/C++ Source or Header  |  1997-10-13  |  1.3 KB  |  35 lines

  1. #pragma message("Simple Custom Action DLL.  Copyright (c) 1997 Microsoft Corp.")
  2. #if 0  // makefile definitions, build with "nmake -f CustAct1.cpp"
  3. DESCRIPTION = Custom Action Test DLL
  4. MODULENAME = CustAct1
  5. FILEVERSION = 0.20
  6. ENTRY = Action1
  7. !include <MsiTool.Mak>
  8. !if 0  #nmake skips the rest of this file
  9. #endif // end of makefile definitions
  10.  
  11. // test of external database access
  12. #define WINDOWS_LEAN_AND_MEAN  // faster compile
  13. #include <windows.h>  // included for both CPP and RC passes
  14. #ifndef RC_INVOKED    // start of CPP source code
  15. #include <stdio.h>    // printf/wprintf
  16. #include <tchar.h>    // define UNICODE=1 on nmake command line to build UNICODE
  17. #include "MsiQuery.h" // must be in this directory or on INCLUDE path
  18.  
  19. UINT __stdcall Action1(MSIHANDLE hInstall)
  20. {
  21.     TCHAR szValue[200];
  22.     DWORD cchValue = sizeof(szValue)/sizeof(TCHAR);
  23.     if (MsiGetProperty(hInstall, "TESTACTION", szValue, &cchValue)
  24.         == ERROR_SUCCESS)
  25.         ::MessageBox(0, szValue, TEXT("Greetings from Action1"), MB_OK);
  26.     return ERROR_SUCCESS;
  27. }
  28.  
  29. #else // RC_INVOKED, end of CPP source code, start of resource definitions
  30. // resource definition go here
  31. #endif // RC_INVOKED
  32. #if 0  // required at end of source file, to hide makefile terminator
  33. !endif // makefile terminator
  34. #endif
  35.