home *** CD-ROM | disk | FTP | other *** search
- #include "SampleMMCHelper.h"
-
- // The following functions are located in MMC.lib. Since functions located in .lib files are
- // inaccessable to C#, we need to provide wrappers for them
- SAMPLEMMCHELPER_API HRESULT callMMCPropertyChangeNotify(long INotifyHandle, LPARAM param)
- {
- return MMCPropertyChangeNotify(INotifyHandle, param);
- }// callMMCPropertyChangeNotify
-
- SAMPLEMMCHELPER_API HRESULT callMMCFreeNotifyHandle(long lNotifyHandle)
- {
- return MMCFreeNotifyHandle(lNotifyHandle);
- }// callMMCFreeNotifyHandle
-
- //-------------------------------------------------------------------------
- // RegisterPropertyPage
- //
- // The runtime currently does not support the marshalling of delegates in structures.
- // Therefore, we need to provide a wrapper that will register our property pages for us
- //-------------------------------------------------------------------------
- SAMPLEMMCHELPER_API int RegisterPropertyPage(void *dlgProc, void *propProc, PROPSHEETPAGE *incoming)
- {
-
- PROPSHEETPAGE ppsg;
-
- ppsg.dwSize = sizeof(ppsg);
- ppsg.dwFlags = incoming->dwFlags;
- ppsg.hInstance = incoming->hInstance;
- ppsg.pszTemplate = incoming->pszTemplate;
- ppsg.pResource = incoming->pResource;
- ppsg.hIcon = incoming->hIcon;
- ppsg.pszIcon = incoming->pszIcon;
- ppsg.pszTitle = incoming->pszTitle;
- ppsg.lParam = incoming->lParam;
- ppsg.pcRefParent = incoming->pcRefParent;
- ppsg.pszHeaderTitle = incoming->pszHeaderTitle;
- ppsg.pszHeaderSubTitle = incoming->pszHeaderSubTitle;
-
- // Assign the function pointers in the structure
- ppsg.pfnDlgProc = (int (__stdcall *)(HWND, unsigned int, unsigned int, long))dlgProc;
- ppsg.pfnCallback = (unsigned int (CALLBACK *)(HWND, unsigned int, PROPSHEETPAGE*))propProc;
-
-
- // Now let's register this property page
- return (int)CreatePropertySheetPage(&ppsg);
- }// RegisterPropertyPage
-
-