DynDialogItemEx.cpp 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534
  1. // DynDialogItemEx.cpp: implementation of the CDynDialogItemEx class.
  2. //
  3. // Written by Marcel Scherpenisse
  4. // mailto:Marcel_Scherpenisse@insad.nl
  5. //
  6. // This code may be used in compiled form in any way you desire. This
  7. // file may be redistributed unmodified by any means PROVIDING it is
  8. // not sold for profit without the authors written consent, and
  9. // providing that this notice and the authors name and all copyright
  10. // notices remains intact. If the source code in this file is used in
  11. // any commercial application then a statement along the lines of
  12. // "Portions copyright (c) Marcel Scherpenisse, 2002" must be included in
  13. // the startup banner, "About" box or printed documentation. An email
  14. // letting me know that you are using it would be nice as well.
  15. //
  16. // This file is provided "as is" with no expressed or implied warranty.
  17. // The author accepts no liability for any damage/loss of business that
  18. // this product may cause.
  19. //
  20. // Expect bugs!
  21. //////////////////////////////////////////////////////////////////////
  22. #include "stdafx.h"
  23. #include "DynDialogItemEx.h"
  24. #ifdef _DEBUG
  25. #undef THIS_FILE
  26. static char THIS_FILE[]=__FILE__;
  27. #define new DEBUG_NEW
  28. #endif
  29. struct _RuntimeLicense {
  30. LPCTSTR lpszRegisteredControlName;
  31. WCHAR *wchLicenseKey;
  32. long lLicenseLength;
  33. }_TAGRUNTIMELICENSE;
  34. /*mgkgtgnnmnmninigthkgogggvmkhinjggnvm*/ //(MS Multimedia MCI Control - mci32.ocx)
  35. WCHAR pwchMCIMMControl1LicenseKey[] =
  36. {
  37. 0x006D, 0x0067, 0x006B, 0x0067, 0x0074, 0x0067,
  38. 0x006E, 0x006E, 0x006D, 0x006E, 0x006D, 0x006E,
  39. 0x0069, 0x006E, 0x0069, 0x0067, 0x0074, 0x0068,
  40. 0x006B, 0x0067, 0x006F, 0x0067, 0x0067, 0x0067,
  41. 0x0076, 0x006D, 0x006B, 0x0068, 0x0069, 0x006E,
  42. 0x006A, 0x0067, 0x0067, 0x006E, 0x0076, 0x006D
  43. };
  44. /*Copyright (c) 1994 */ //(MS Communications Control - mscomm32.ocx)
  45. WCHAR pwchMSCOMMLibMSComm1LicenseKey[] =
  46. {
  47. 0x0043, 0x006F, 0x0070, 0x0079, 0x0072, 0x0069,
  48. 0x0067, 0x0068, 0x0074, 0x0020, 0x0028, 0x0063,
  49. 0x0029, 0x0020, 0x0031, 0x0039, 0x0039, 0x0034,
  50. 0x0020
  51. };
  52. /*72E67120-5959-11cf-91F6-C2863C385E30*/ //(MS Flex Grid Control - msflxgrd.ocx)
  53. WCHAR pwchMSFlexGridLibMSFlexGrid1LicenseKey[] =
  54. {
  55. 0x0037, 0x0032, 0x0045, 0x0036, 0x0037, 0x0031,
  56. 0x0032, 0x0030, 0x002D, 0x0035, 0x0039, 0x0035,
  57. 0x0039, 0x002D, 0x0031, 0x0031, 0x0063, 0x0066,
  58. 0x002D, 0x0039, 0x0031, 0x0046, 0x0036, 0x002D,
  59. 0x0043, 0x0032, 0x0038, 0x0036, 0x0033, 0x0043,
  60. 0x0033, 0x0038, 0x0035, 0x0045, 0x0033, 0x0030
  61. };
  62. /*mgkgtgnnmnmninigthkgogggvmkhinjggnvm*/ //(MS Masked Edit - msmask32.ocx)
  63. WCHAR pwchMSMaskMaskEdBox1LicenseKey[] =
  64. {
  65. 0x006D, 0x0067, 0x006B, 0x0067, 0x0074, 0x0067,
  66. 0x006E, 0x006E, 0x006D, 0x006E, 0x006D, 0x006E,
  67. 0x0069, 0x006E, 0x0069, 0x0067, 0x0074, 0x0068,
  68. 0x006B, 0x0067, 0x006F, 0x0067, 0x0067, 0x0067,
  69. 0x0076, 0x006D, 0x006B, 0x0068, 0x0069, 0x006E,
  70. 0x006A, 0x0067, 0x0067, 0x006E, 0x0076, 0x006D
  71. };
  72. /*GL........*/ //(MS Grid Control - grid32.ocx)
  73. WCHAR pwchMSDBGridDBGridLicenseKey[] =
  74. {
  75. 0x0047, 0x004C, 0x0005, 0x0008, 0x0001, 0x0005,
  76. 0x0002, 0x0008, 0x0001, 0x0004
  77. };
  78. /*DB4C0D09-400B-101B-A3C9-08002B2F49FB*/ //(MS Picture Clip Control - picclp32.ocx)
  79. WCHAR pwchPicClipPictureClip1LicenseKey[] =
  80. {
  81. 0x0044, 0x0042, 0x0034, 0x0043, 0x0030, 0x0044,
  82. 0x0030, 0x0039, 0x002D, 0x0034, 0x0030, 0x0030,
  83. 0x0042, 0x002D, 0x0031, 0x0030, 0x0031, 0x0042,
  84. 0x002D, 0x0041, 0x0033, 0x0043, 0x0039, 0x002D,
  85. 0x0030, 0x0038, 0x0030, 0x0030, 0x0032, 0x0042,
  86. 0x0032, 0x0046, 0x0034, 0x0039, 0x0046, 0x0042
  87. };
  88. /*04746E60CE4F11CDB23C0000C076FE*/ //(MS Tab Control - tabctl32.ocx)
  89. static WCHAR pwchTabDlgSSTab1LicenseKey[] =
  90. {
  91. 0x0030, 0x0034, 0x0037, 0x0034, 0x0036, 0x0045,
  92. 0x0036, 0x0030, 0x0043, 0x0045, 0x0034, 0x0046,
  93. 0x0031, 0x0031, 0x0043, 0x0044, 0x0042, 0x0032,
  94. 0x0033, 0x0043, 0x0030, 0x0030, 0x0030, 0x0030,
  95. 0x0043, 0x0030, 0x0037, 0x0036, 0x0046, 0x0045
  96. };
  97. static _RuntimeLicense RuntimeLicenses[] =
  98. {
  99. {_T("MCI.MMControl.1"), pwchMCIMMControl1LicenseKey, sizeof(pwchMCIMMControl1LicenseKey)},
  100. {_T("MSCOMMLib.MSComm.1"), pwchMSCOMMLibMSComm1LicenseKey, sizeof(pwchMSCOMMLibMSComm1LicenseKey)},
  101. {_T("MSFlexGridLib.MSFlexGrid.1"), pwchMSFlexGridLibMSFlexGrid1LicenseKey, sizeof(pwchMSFlexGridLibMSFlexGrid1LicenseKey)},
  102. {_T("MSMask.MaskEdBox.1"), pwchMSMaskMaskEdBox1LicenseKey, sizeof(pwchMSMaskMaskEdBox1LicenseKey)},
  103. {_T("MSDBGrid.DBGrid"), pwchMSDBGridDBGridLicenseKey, sizeof(pwchMSDBGridDBGridLicenseKey)},
  104. {_T("PicClip.PictureClip.1"), pwchPicClipPictureClip1LicenseKey, sizeof(pwchPicClipPictureClip1LicenseKey)},
  105. {_T("TabDlg.SSTab.1"), pwchTabDlgSSTab1LicenseKey, sizeof(pwchTabDlgSSTab1LicenseKey)},
  106. {NULL, NULL, 0}
  107. };
  108. static UINT glb_nNextID = WM_USER; // We have to start somewhere...
  109. UINT GetNewUniqueID(void)
  110. {
  111. glb_nNextID++;
  112. return glb_nNextID - 1;
  113. }
  114. //////////////////////////////////////////////////////////////////////
  115. // Construction/Destruction
  116. //////////////////////////////////////////////////////////////////////
  117. CDynDialogItemEx::CDynDialogItemEx()
  118. : CWnd()
  119. {
  120. m_eTypeControl = NOCONTROL;
  121. m_strClassName = _T("");
  122. m_dwStyle = 0;
  123. m_dwStyleEx = 0;
  124. m_strCaption = _T("");
  125. m_ControlID = 0;
  126. m_pData = NULL;
  127. m_bSubclassed = FALSE;
  128. }
  129. void CDynDialogItemEx::DoDataExchange(CDataExchange *pDX)
  130. {
  131. if (m_pData != NULL) {
  132. switch(m_eTypeControl) {
  133. case BUTTON:
  134. if ((m_dwStyle & BS_AUTORADIOBUTTON) == BS_AUTORADIOBUTTON) {
  135. DDX_Radio(pDX, m_ControlID, *(int*)m_pData);
  136. }
  137. else if ((m_dwStyle & BS_AUTOCHECKBOX) == BS_AUTOCHECKBOX) {
  138. DDX_Check(pDX, m_ControlID, *(int*)m_pData);
  139. }
  140. else {
  141. DDX_Control(pDX, m_ControlID, *(CWnd*)m_pData);
  142. }
  143. break;
  144. case EDITCONTROL:
  145. DDX_Text(pDX, m_ControlID, *(CString*)m_pData);
  146. break;
  147. case STATICTEXT:
  148. DDX_Text(pDX, m_ControlID, *(CString*)m_pData);
  149. break;
  150. case LISTBOX:
  151. DDX_Control(pDX, m_ControlID, *(CWnd*)m_pData);
  152. break;
  153. case HSCROLL:
  154. DDX_Scroll(pDX, m_ControlID, *(int*)m_pData);
  155. break;
  156. case COMBOBOX:
  157. DDX_Control(pDX, m_ControlID, *(CWnd*)m_pData);
  158. break;
  159. case SPIN:
  160. DDX_Control(pDX, m_ControlID, *(CWnd*)m_pData);
  161. break;
  162. case PROGRES:
  163. DDX_Control(pDX, m_ControlID, *(CWnd*)m_pData);
  164. break;
  165. case SLIDER:
  166. DDX_Slider(pDX, m_ControlID, *(int*)m_pData);
  167. break;
  168. case HOTKEY:
  169. DDX_Control(pDX, m_ControlID, *(CWnd*)m_pData);
  170. break;
  171. case LISTCTRL:
  172. DDX_Control(pDX, m_ControlID, *(CWnd*)m_pData);
  173. break;
  174. case TREECTRL:
  175. DDX_Control(pDX, m_ControlID, *(CWnd*)m_pData);
  176. break;
  177. case TABCTRL:
  178. DDX_Control(pDX, m_ControlID, *(CWnd*)m_pData);
  179. break;
  180. case ANIMATE:
  181. DDX_Control(pDX, m_ControlID, *(CWnd*)m_pData);
  182. break;
  183. case RICHEDIT:
  184. DDX_Control(pDX, m_ControlID, *(CWnd*)m_pData);
  185. break;
  186. case DATETIMEPICKER:
  187. if ((m_dwStyle & DTS_TIMEFORMAT) == DTS_TIMEFORMAT) {
  188. DDX_DateTimeCtrl(pDX, m_ControlID, *(CTime*)m_pData);
  189. }
  190. else {
  191. DDX_DateTimeCtrl(pDX, m_ControlID, *(COleDateTime*)m_pData);
  192. }
  193. break;
  194. case MONTHCALENDER:
  195. DDX_MonthCalCtrl(pDX, m_ControlID, *(COleDateTime*)m_pData);
  196. break;
  197. case IPADRESS:
  198. DDX_Control(pDX, m_ControlID, *(CWnd*)m_pData);
  199. break;
  200. case COMBOBOXEX:
  201. DDX_Control(pDX, m_ControlID, *(CWnd*)m_pData);
  202. break;
  203. default:
  204. break;
  205. }
  206. }
  207. CWnd::DoDataExchange(pDX);
  208. }
  209. BEGIN_MESSAGE_MAP(CDynDialogItemEx, CWnd)
  210. //{{AFX_MSG_MAP(CDynDialogItemEx)
  211. //}}AFX_MSG_MAP
  212. END_MESSAGE_MAP()
  213. char* CDynDialogItemEx::GetClassNameByType(DLGITEMTEMPLATECONTROLS TypeControl)
  214. {
  215. switch(TypeControl) {
  216. case BUTTON:
  217. return _T("BUTTON");
  218. case EDITCONTROL:
  219. return _T("EDIT");
  220. case STATICTEXT:
  221. return _T("STATIC");
  222. case LISTBOX:
  223. return _T("LISTBOX");
  224. case HSCROLL:
  225. return _T("SCROLLBAR");
  226. case COMBOBOX:
  227. return _T("COMBOBOX");
  228. case SPIN:
  229. return _T("msctls_updown32");
  230. case PROGRES:
  231. return _T("msctls_progress32");
  232. case SLIDER:
  233. return _T("msctls_trackbar32");
  234. case HOTKEY:
  235. return _T("msctls_hotkey32");
  236. case LISTCTRL:
  237. return _T("SysListView32");
  238. case TREECTRL:
  239. return _T("SysTreeView32");
  240. case TABCTRL:
  241. return _T("SysTabControl32");
  242. case ANIMATE:
  243. return _T("SysAnimate32");
  244. case RICHEDIT:
  245. return _T("RICHEDIT");
  246. case DATETIMEPICKER:
  247. return _T("SysDateTimePick32");
  248. case MONTHCALENDER:
  249. return _T("SysMonthCal32");
  250. case IPADRESS:
  251. return _T("SysIPAddress32");
  252. case COMBOBOXEX:
  253. return _T("ComboBoxEx32");
  254. }
  255. return _T("");
  256. }
  257. DLGITEMTEMPLATECONTROLS CDynDialogItemEx::GetClassTypeByName(LPCSTR lpszClassName)
  258. {
  259. if (memcmp(lpszClassName, _T("BUTTON"), 6) == 0) {
  260. return BUTTON;
  261. }
  262. else if (memcmp(lpszClassName, _T("EDIT"), 4) == 0) {
  263. return EDITCONTROL;
  264. }
  265. else if (memcmp(lpszClassName, _T("STATIC"), 6) == 0) {
  266. return STATICTEXT;
  267. }
  268. else if (memcmp(lpszClassName, _T("LISTBOX"), 7) == 0) {
  269. return LISTBOX;
  270. }
  271. else if (memcmp(lpszClassName, _T("SCROLLBAR"), 9) == 0) {
  272. return HSCROLL;
  273. }
  274. else if (memcmp(lpszClassName, _T("COMBOBOX"), 8) == 0) {
  275. return COMBOBOX;
  276. }
  277. else if (memcmp(lpszClassName, _T("msctls_updown32"), 15) == 0) {
  278. return SPIN;
  279. }
  280. else if (memcmp(lpszClassName, _T("msctls_progress32"), 17) == 0) {
  281. return PROGRES;
  282. }
  283. else if (memcmp(lpszClassName, _T("msctls_trackbar32"), 17) == 0) {
  284. return SLIDER;
  285. }
  286. else if (memcmp(lpszClassName, _T("msctls_hotkey32"), 15) == 0) {
  287. return HOTKEY;
  288. }
  289. else if (memcmp(lpszClassName, _T("SysListView32"), 13) == 0) {
  290. return LISTCTRL;
  291. }
  292. else if (memcmp(lpszClassName, _T("SysTreeView32"), 13) == 0) {
  293. return TREECTRL;
  294. }
  295. else if (memcmp(lpszClassName, _T("SysTabControl32"), 15) == 0) {
  296. return TABCTRL;
  297. }
  298. else if (memcmp(lpszClassName, _T("SysAnimate32"), 12) == 0) {
  299. return ANIMATE;
  300. }
  301. else if (memcmp(lpszClassName, _T("RICHEDIT"), 8) == 0) {
  302. return RICHEDIT;
  303. }
  304. else if (memcmp(lpszClassName, _T("SysDateTimePick32"), 17) == 0) {
  305. return DATETIMEPICKER;
  306. }
  307. else if (memcmp(lpszClassName, _T("SysMonthCal32"), 13) == 0) {
  308. return MONTHCALENDER;
  309. }
  310. else if (memcmp(lpszClassName, _T("SysIPAddress32"), 14) == 0) {
  311. return IPADRESS;
  312. }
  313. else if (memcmp(lpszClassName, _T("ComboBoxEx32"), 12) == 0) {
  314. return COMBOBOXEX;
  315. }
  316. return NOCONTROL;
  317. }
  318. UINT CDynDialogItemEx::InitDialogItem(DLGITEMTEMPLATECONTROLS TypeControl,
  319. DWORD dwStyle,
  320. DWORD dwExtendedStyle,
  321. LPRECT pRect,
  322. LPCTSTR lpszCaption,
  323. UINT nID /*= 0*/,
  324. BOOL bSubclassed /*= FALSE*/,
  325. void *pData /*= NULL*/)
  326. {
  327. m_eTypeControl = TypeControl;
  328. m_strClassName = GetClassNameByType(m_eTypeControl);
  329. m_dwStyle = dwStyle;
  330. m_dwStyleEx = dwExtendedStyle;
  331. m_Rect = pRect;
  332. m_strCaption = lpszCaption;
  333. m_bSubclassed = bSubclassed;
  334. m_pData = pData;
  335. if (nID == 0) {
  336. m_ControlID = ::GetNewUniqueID();
  337. }
  338. else {
  339. m_ControlID = nID;
  340. }
  341. return m_ControlID;
  342. }
  343. UINT CDynDialogItemEx::InitDialogItem(LPCSTR lpszClassName,
  344. DWORD dwStyle,
  345. DWORD dwExtendedStyle,
  346. LPRECT pRect,
  347. LPCTSTR lpszCaption,
  348. UINT nID /*= 0*/,
  349. BOOL bSubclassed /*= FALSE*/,
  350. void *pData /*= NULL*/)
  351. {
  352. m_strClassName = lpszClassName;
  353. m_eTypeControl = GetClassTypeByName(lpszClassName);
  354. m_dwStyle = dwStyle;
  355. m_dwStyleEx = dwExtendedStyle;
  356. m_Rect = pRect;
  357. m_strCaption = lpszCaption;
  358. m_bSubclassed = bSubclassed;
  359. m_pData = pData;
  360. if (nID == 0) {
  361. m_ControlID = ::GetNewUniqueID();
  362. }
  363. else {
  364. m_ControlID = nID;
  365. }
  366. return m_ControlID;
  367. }
  368. BOOL CDynDialogItemEx::CreateEx(CWnd *pParent)
  369. {
  370. BOOL bRet = FALSE;
  371. if (m_eTypeControl == NOCONTROL) { //It will probably be an OCX...
  372. //
  373. // Create the control later....
  374. // if it's created here then the rectangle is not OK and SetWindowPos doesn't work on OCX's????
  375. //
  376. bRet = TRUE;
  377. }
  378. else if (m_pData != NULL && IsDataMemberPointerToWnd()) {
  379. bRet = ((CWnd*)m_pData)->CreateEx(m_dwStyleEx, m_strClassName, m_strCaption, m_dwStyle, m_Rect, pParent, m_ControlID);
  380. }
  381. else {
  382. bRet = CWnd::CreateEx(m_dwStyleEx, m_strClassName, m_strCaption, m_dwStyle, m_Rect, pParent, m_ControlID);
  383. }
  384. return bRet;
  385. }
  386. BOOL CDynDialogItemEx::SetWindowPos(CWnd *pParent)
  387. {
  388. BOOL bRet = FALSE;
  389. //Conversion of Dialog units to screenunits
  390. CRect rect(m_Rect);
  391. ((CDialog *)pParent)->MapDialogRect(&rect);
  392. ASSERT(rect.IsRectEmpty() == FALSE);
  393. if (m_eTypeControl == NOCONTROL) {
  394. BSTR bstrLicKey = GetRuntimeLicense(m_strClassName);
  395. bRet = CreateControl(m_strClassName, m_strCaption, m_dwStyle, rect, pParent, m_ControlID, NULL, FALSE, bstrLicKey);
  396. if (bstrLicKey != NULL) {
  397. ::SysFreeString(bstrLicKey);
  398. }
  399. }
  400. else if (m_pData != NULL && IsDataMemberPointerToWnd()) {
  401. bRet = ((CWnd*)m_pData)->SetWindowPos(NULL, rect.left, rect.top, rect.Width(), rect.Height(), SWP_NOZORDER);
  402. }
  403. else {
  404. bRet = CWnd::SetWindowPos(NULL, rect.left, rect.top, rect.Width(), rect.Height(), SWP_NOZORDER);
  405. }
  406. return bRet;
  407. }
  408. void CDynDialogItemEx::SetFont(CFont* pFont, BOOL bRedraw /*= TRUE*/)
  409. {
  410. if (m_pData != NULL && IsDataMemberPointerToWnd()) {
  411. ((CWnd*)m_pData)->SetFont(pFont, bRedraw);
  412. }
  413. else {
  414. CWnd::SetFont(pFont, bRedraw);
  415. }
  416. }
  417. PBYTE CDynDialogItemEx::FillBufferWithItemTemplate(BYTE *pdest)
  418. {
  419. pdest = (BYTE*)(((DWORD)pdest + 3) & ~3); // make the pointer DWORD aligned
  420. DLGITEMTEMPLATE dlgItemTemplate;
  421. dlgItemTemplate.x = (short)m_Rect.left;
  422. dlgItemTemplate.y = (short)m_Rect.top;
  423. dlgItemTemplate.cx = (short)m_Rect.Width();
  424. dlgItemTemplate.cy = (short)m_Rect.Height();
  425. dlgItemTemplate.style = m_dwStyle;
  426. dlgItemTemplate.dwExtendedStyle = m_dwStyleEx;
  427. dlgItemTemplate.id = (USHORT)m_ControlID;
  428. memcpy(pdest, (void *)&dlgItemTemplate, sizeof(DLGITEMTEMPLATE));
  429. pdest += sizeof(DLGITEMTEMPLATE);
  430. *(WORD*)pdest = 0xFFFF; // indicating atom value
  431. pdest += sizeof(WORD);
  432. *(WORD*)pdest = (USHORT)m_eTypeControl; // atom value for the control
  433. pdest += sizeof(WORD);
  434. // transfer the caption even when it is an empty string
  435. WCHAR* pchCaption;
  436. int nChars, nActualChars;
  437. nChars = m_strCaption.GetLength() + 1;
  438. pchCaption = new WCHAR[nChars];
  439. nActualChars = MultiByteToWideChar(CP_ACP, 0, m_strCaption, -1, pchCaption, nChars);
  440. ASSERT(nActualChars > 0);
  441. memcpy(pdest, pchCaption, nActualChars * sizeof(WCHAR));
  442. pdest += nActualChars * sizeof(WCHAR);
  443. delete pchCaption;
  444. *(WORD*)pdest = 0; // How many bytes in data for control
  445. pdest += sizeof(WORD);
  446. return pdest;
  447. }
  448. BSTR CDynDialogItemEx::GetRuntimeLicense(CString &strControlName)
  449. {
  450. BSTR bstrLicKey = NULL;
  451. int i = 0;
  452. while (RuntimeLicenses[i].lpszRegisteredControlName != NULL) {
  453. if (strControlName.Compare(RuntimeLicenses[i].lpszRegisteredControlName) == 0) {
  454. bstrLicKey = ::SysAllocStringLen(RuntimeLicenses[i].wchLicenseKey, RuntimeLicenses[i].lLicenseLength/sizeof(WCHAR));
  455. break;
  456. }
  457. i++;
  458. }
  459. return bstrLicKey;
  460. }
  461. BOOL CDynDialogItemEx::IsDataMemberPointerToWnd()
  462. {
  463. BOOL bRet = TRUE;
  464. switch(m_eTypeControl)
  465. {
  466. case BUTTON:
  467. if ((m_dwStyle & BS_AUTORADIOBUTTON) == BS_AUTORADIOBUTTON) {
  468. bRet = FALSE;
  469. }
  470. else if ((m_dwStyle & BS_AUTOCHECKBOX) == BS_AUTOCHECKBOX) {
  471. bRet = FALSE;
  472. }
  473. break;
  474. case EDITCONTROL:
  475. bRet = FALSE;
  476. break;
  477. case STATICTEXT:
  478. bRet = FALSE;
  479. break;
  480. case HSCROLL:
  481. bRet = FALSE;
  482. break;
  483. case SLIDER:
  484. bRet = FALSE;
  485. break;
  486. case DATETIMEPICKER:
  487. bRet = FALSE;
  488. break;
  489. case MONTHCALENDER:
  490. bRet = FALSE;
  491. break;
  492. default:
  493. break;
  494. }
  495. return bRet;
  496. }