Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Using UWP visual c .Dll



  • Hello everybody,

    I create a visual c UWP Dll that change the system time, because I didnt know how to do it in Qt but it work from visual c application and not work from qt UWP application

    I need help how to run UWP Task on visual c Dll from qt application

    Thanks


  • Lifetime Qt Champion

    @RiLev said in Using UWP visual c .Dll:

    but it work from visual c application and not work from qt UWP application

    You forgot to mention what exact problem you have...


  • Moderators

    @RiLev

    so, why do you not use the c++ classes for that?

    #include "iostream"
    #include "windows.h"
    
    int main(int argc, char *argv[])
    {
        QApplication a(argc, argv);
    
        SYSTEMTIME st;
        GetSystemTime(&st);
    
        st.wDay = 1;
        st.wYear = 1988;
    
        bool timeSet = SetSystemTime(&st);
        if(!timeSet)
            qDebug() << "Last Error: " << GetLastError();
    
        return a.exec();
    }
    

    seems much easier than including a visual c dll into your project



  • @J-Hilk

    The function SetSystemTime() not work on qt UWP application
    So I try to create Dll on visual c that will do it
    The function on UWP visual c is

    Windows.System.DateTimeSettings.SetSystemDateTime(dto);
    

    This function not work for me


Log in to reply