Skip to content

wxDatePickerCtrl error on x64 windows build #145

Description

@underdpt

Hi,

When trying to use a wxDatePickerCtrl with the windows x64 build, i get the next error:

....\src\msw\datetimectrl.cpp(95): asser "Assert failure" failed in wxDateTimePickerCtrl::SetValue(): Setting the calendar date unexpectedly failed.

The control shows correctly (including the date).

Same code works with x86 build.

Example code:

setlocale(LC_ALL, 'C');
class mainFrame extends wxFrame {
    function __construct( $parent=null ){
        parent::__construct ( $parent, wxID_ANY, wxEmptyString, wxDefaultPosition, new wxSize( 500,300 ), wxDEFAULT_FRAME_STYLE|wxTAB_TRAVERSAL );
        $this->SetSizeHints( wxDefaultSize, wxDefaultSize );
        $bSizer8 = new wxBoxSizer( wxVERTICAL );

        $this->m_datePicker1 = new wxDatePickerCtrl( $this, wxID_ANY , wxDefaultDateTime, wxDefaultPosition, wxDefaultSize, wxDP_DEFAULT );

        $bSizer8->Add( $this->m_datePicker1, 0, wxALL, 5 );
        $this->SetSizer( $bSizer8 );
        $this->Layout();
        $this->Centre( wxBOTH );
    }
}

$mf = new mainFrame();
$mf->Show();
wxEntry();

Activity

  1. cye060 commented on Jun 7, 2016

    @cye060

    I was not able to reproduce this with the code example you left. I tried this in both x64 and x86 with out the error message showing. Any more information you can give?

  2. underdpt commented on Jun 25, 2016

    @underdpt
    Author

    Hi,
    It only happens on x64 build, not on x86. If've repeated the tests, and mostly it fails but once on a while it shows the frame, with the date wrong:

    2016-06-25 09_43_48-

    When it fails, If i dismiss the error window, it shows the date correctly.
    I'm on Spain, and have tried changing the regional setup on windows with the same results.

    Any other test I can do, please tell me.

  3. cye060 commented on Jun 25, 2016

    @cye060

    I still am not able to reproduce, if you could answer my question's below i would like to build a debug build of wxPHP for you then have you rerun using that and then send me what it outputs, thanks.

    What version of windows are you using?
    What version of PHP are you using?
    What version of wxPHP are you using?

  4. underdpt commented on Jun 27, 2016

    @underdpt
    Author

    Hi cye060,
    I'm using windows 10 Pro 64bit.
    The php version is the one bundled with wxPHP:

    > .\php64\php --version
    PHP 5.6.9 (cli) (built: May 13 2015 19:28:46)
    

    wxPHP is version 3.0.2.0

    Any other thing, please tell me.

  5. cye060 commented on Jun 29, 2016

    @cye060

    underdpt, i will have to wait till around this weekend to get you that build as i was not aware express edition did not come with the x64 compiler till i tried to compile it on my pc sorry.

  6. cye060 commented on Jul 3, 2016

    @cye060

    The link is below, unzip and rename the 'php_wxwidgets-3.0.2-5.6.9-nts-x64-vc11-debug.dll' file to 'php_wxwidgets.dll'. Make a copy of your original 'php_wxwidgets.dll' file in your php extensions directory so you don't over write it, and replace the one in your php extensions directory. Open up a command window and if your 'wxphp.exe' or your 'php.exe' is not a registered environment variable then change your directory to where 'wxphp.exe' or your 'php.exe' is located. I would place wxphp/php script file in the same location as the current directory command prompt it in to make things easier. Then type 'wxphp example.php' or 'php example.php' where 'example.php' is your script file name. Then copy and paste the output on here for us to view, any questions let me know thanks.

    php_wxwidgets-3.0.2-5.6.9-nts-x64-vc11-debug.zip

  7. underdpt commented on Jul 3, 2016

    @underdpt
    Author

    Hi cye060
    I'm sorry it didn't work:

    PHP Warning: PHP Startup: Unable to load dynamic library 'ext\php_wxwidgets.dll' - No se puede encontrar el módulo especificado.
    in Unknown on line 0

    I made sure the name of the dll was correct and on ext subfolder of my php64 wxwidgets setup. If I put the original php_wxwidgets.dll it runs.

  8. cye060 commented on Jul 4, 2016

    @cye060

    That was my fault i forgot that the release you have is thread safe i compiled that other one non thread safe. New link is below and i tested it this time :), sorry.

    php_wxwidgets-3.0.2-5.6.9-ts-x64-vc11-debug.zip

  9. underdpt commented on Jul 4, 2016

    @underdpt
    Author

    Hi,

    This time it worked :-)

    I'm uploading two logs, one when launching the test from cmd or powershell, showing the issue:
    test_error.txt

    And this one is when launching it from atom, the code editor i'm using and doing all the tests with. This time, same configuration, no errors!
    test_ok.txt

    Maybe this has something to do with environment variables or setup? I think atom has different environment than cmd and with the debug build that makes a difference (I've retested with the normal dll and there's no difference between launching it from atom or from cmd).

  10. cye060 commented on Jul 5, 2016

    @cye060

    This is the section/function of code below that it is throwing the error in wxWidgets library. I find it weird that my build worked for your. I am taking a educated guess here but i think this is windows 10 specific and is related to wxWidgets library its self. I don't have windows 10 to test for my self at this point in time. I am going to rebuild you another version but with the wxWidgets 3.1.0 and see what happens with that as there were some changes made in that area.

    void wxDateTimePickerCtrl::SetValue(const wxDateTime& dt)
    {
        wxCHECK_RET( dt.IsValid() || MSWAllowsNone(),
                        wxT("this control requires a valid date") );
    
        SYSTEMTIME st;
        if ( dt.IsValid() )
            dt.GetAsMSWSysTime(&st);
    
        if ( !DateTime_SetSystemtime(GetHwnd(),
                                     dt.IsValid() ? GDT_VALID : GDT_NONE,
                                     &st) )
        {
            // The only expected failure is when the date is out of range but we
            // already checked for this above.
            wxFAIL_MSG( wxT("Setting the calendar date unexpectedly failed.") );
    
            // In any case, skip updating m_date below.
            return;
        }
    
        m_date = dt;
    }
    
    
  11. underdpt commented on Jul 5, 2016

    @underdpt
    Author

    Hi cye060,
    I have made a few tests on a VM with Windows 7 32bits, and the test code works perfectly, so it can be a windows 10 related issue.
    I'll try your version and keep you updated.
    Thanks!

  12. cye060 commented on Jul 6, 2016

    @cye060

    Give this version a try and see what happens. I cant find any mention of this issue on wxWidgets forums for windows 10 at this point in time yet.

    php_wxwidgets-3.1.0-5.6.9-ts-x64-vc11.zip

  13. underdpt commented on Jul 6, 2016

    @underdpt
    Author

    This is not a debug dll, true? It gives me no ouput.
    Anyway, It throws the next error when I run the test, and when clicking "No" the date shows correctly:

    2016-07-06 15_32_24-wxwidgets debug alert

  14. cye060 commented on Jul 6, 2016

    @cye060

    No it is not a wxPHP debug version as that debug only out puts information on wxPHP side and not wxWidgets side so i did not build it with that enabled as the previous logs you sent me there was not difference between them. I have been trying to build wxWidgets with debug enabled but have been unable to succeed so far due to issue a little bit beyond my current knowledge.

    I am going to rebuild you a version with debug databases, this will give us a much better call stack then what you have there and from there hope fully we can narrow down the exact cause and submit a case to wxWidgets if that's were the issue lies.

  15. cye060 commented on Jul 20, 2016

    @cye060

    Sorry took so long underdpt, link is below, had to use external site because zip file was to large. This is a full installation and also contains debug library's and its non thread safe also because thread safe seems to block some of the debug stack for some reason and I'm not smart enough to figure out why :). So extract and run using this from cmd and the debug stack in your last post should have a lot more information in it this time and from this data collected we should be able to finally tell if its wxWidgets issue or wxPHP issue. Thanks for your all your testing help also.

    http://www.filedropper.com/php-5623-nts-win32-vc11-x64

  16. underdpt commented on Jul 21, 2016

    @underdpt
    Author

    Hi,
    Don't worry. I'm happy to help you guys, this is a great effort from you and you deserve some help and patience :-)

    This time no errors, launching it from a windows cmd batch file or from the atom editor:

    test_cmd.txt
    test_atom.txt

  17. cye060 commented on Jul 21, 2016

    @cye060

    Interesting, well i believe the only differences are is this is using php version 5.6.23 and the other ones were using php version 5.6.9, and also this is a non thread safe build. This is a little beyond my skill set but I'm leaning towards building it non thread safe fixed the error. If you would like i can build you a non debug version of that build for your use, as long as you are not doing any thing that requires a thread safe build.

  18. underdpt commented on Jul 21, 2016

    @underdpt
    Author

    Don't worry, I don't need it on any project now, I just found it while doing some tests and made the report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions