Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
1.4 KiB

  1. // DialogBox.cpp -- DialogBox helper routines
  2. // (c) Copyright Schlumberger Technology Corp., unpublished work, created
  3. // 1998. This computer program includes Confidential, Proprietary
  4. // Information and is a Trade Secret of Schlumberger Technology Corp. All
  5. // use, disclosure, and/or reproduction is prohibited unless authorized
  6. // in writing. All Rights Reserved.
  7. #include "stdafx.h"
  8. #include "CspProfile.h"
  9. #include "DialogBox.h"
  10. using namespace std;
  11. using namespace ProviderProfile;
  12. DWORD
  13. InitDialogBox(CDialog *pCDlg, // The dialog reference
  14. UINT nTemplate, // identifies dialog box template
  15. CWnd* pWnd) // pointer to parent window
  16. {
  17. HRSRC hrsrc = NULL;
  18. HGLOBAL hgbl = NULL;
  19. LPDLGTEMPLATE pDlg = NULL;
  20. DWORD dwReturn;
  21. hrsrc = FindResource(CspProfile::Instance().Resources(),
  22. MAKEINTRESOURCE(nTemplate),
  23. RT_DIALOG);
  24. if (NULL == hrsrc)
  25. {
  26. dwReturn = GetLastError();
  27. goto ErrorExit;
  28. }
  29. hgbl = LoadResource(CspProfile::Instance().Resources(), hrsrc);
  30. if (NULL == hgbl)
  31. {
  32. dwReturn = GetLastError();
  33. goto ErrorExit;
  34. }
  35. pDlg = (LPDLGTEMPLATE)LockResource(hgbl);
  36. if (NULL == pDlg)
  37. {
  38. dwReturn = GetLastError();
  39. goto ErrorExit;
  40. }
  41. pCDlg->InitModalIndirect(pDlg, pWnd);
  42. dwReturn = ERROR_SUCCESS;
  43. ErrorExit:
  44. return dwReturn;
  45. }