::GetModuleHandle("comctl32.dll") returns 0 when executed from a dll calling wxWidgets code on windows 7
|Reported by:||jgmdev||Owned by:|
Using the wxDatePickerCtrl using the wxPHP binding fails on windows 7, After doing some testing the culprit is ::GetModuleHandle("comctl32.dll"). This function is returning 0 on windows 7 when executed on a dll with wxWidgets code loaded by another executable which is the case of wxPHP.
php.exe loads php_wxwidgets.dll and this dll makes calls to wxWidgets class methods.
Here is the code that blocks wxDatePickerCtrl (msw\datecontrols.cpp) if comctl32 version is to old:
if ( wxApp::GetComCtl32Version() < 470 )
wxLogError(_("This system doesn't support date controls, please upgrade your version of comctl32.dll"));
GetComCtl32Version() tries to get the handle of already loaded comctl32.dll to get its version, but it fails by returning 0 if code is executed inside a dll on windows 7.
Works well on windows xp with same code but not on windows 7 and it seems is the same problem reported here:
I have applied the patch provided on mentioned previous ticket and now it works without an issue. I have adapted the patch for current wxwidgets trunk.
Also I tested the python wxDatePickerCtrl on win 7 but it is using generic one instead of native, maybe because of this issue.
Change History (8)
Changed 5 years ago by jgmdev
comment:3 follow-up: ↓ 4 Changed 5 years ago by vadz
- Resolution set to invalid
- Status changed from new to closed