summaryrefslogtreecommitdiffstats
path: root/src/winmain/qtmain_winrt.cpp
Commit message (Collapse)AuthorAgeFilesLines
* winrt: Use native threadingAndrew Knight2014-06-251-0/+4
| | | | | | | | | | | | | | | | | Instead of using std::thread, use the WinRT ThreadPool to manage threads. This allows for setting the scheduling priority, and provides a path to enable XAML integration (which requires Qt run on a background thread). QThread::terminate() is still unsupported, and only the winmain thread can be adopted due to the behavior of the thread pool when creating tasks from the GUI thread. The associated tests are now skipped, and all other QThread tests pass. Task-number: QTBUG-31397 Change-Id: Ib512a328412e1dffecdc836bc39de3ccd37afa13 Reviewed-by: Oliver Wolff <oliver.wolff@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* remove HSTRING instancesMaurice Kalinowski2014-06-031-4/+5
| | | | | | | | | | | HSTRING needs to be released or handles will be leaked. Instead use HString which takes care of resource management on its own. Task-Number: QTBUG-38115 Change-Id: I2c767776c1f22f45acd8dd77b693f30d63d894b9 Reviewed-by: Andrew Knight <andrew.knight@digia.com> Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
* WinRT winmain: Pass ImagePath as part of ImageParams in Xap packagesAndrew Knight2014-04-011-2/+17
| | | | | | | | | ImageParams is used to pass arguments to main(), but when used the original argv[0] is dropped. To remedy this, expect argv[1] to contain the same value found in the Xap's ImagePath. Change-Id: I2fb3b9956304fdcdeec4424ea56289d56ad4fe0b Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
* WinRT: Add debug message handler for winrtrunnerAndrew Knight2014-03-141-0/+25
| | | | | | | | | | By placing debug messages in shared memory, the application can share debug messages with winrtrunner (or any utility which passes -qdevel to the app and opens the corresponding shared memory area). Task-number: QTBUG-37308 Change-Id: Id0e04cfd5f0f701d552a448f780788c7cbf9b438 Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
* WinRT winmain: handle -qdevel parameter for additional debugging toolingAndrew Knight2014-01-301-5/+24
| | | | | | | | | | | This adds an additional command line argument, -qdevel, for tooling support. Since Windows Phone deployment APIs don't return the PID, this writes the PID to a lock file that can be read by deployment tools. Since arguments may be passed from one of several entry points, the special argument checks are now done in Run() instead of onActivated(). Change-Id: Ib3af157ccf687769d43d60adef9a0ab480e835b7 Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
* WinRT winmain: fix linker error on x86 compilersAndrew Knight2014-01-131-1/+1
| | | | | | | | The x86 PC and Phone emulator compilers choke on WinMain's signature not matching the stdcall exported version. This fixes the issue. Change-Id: I30d8a5dab67f3f1f15869abe2928326e3401dc43 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@digia.com>
* WinRT: Properly return exit codeAndrew Knight2014-01-071-2/+6
| | | | | | | | | Instead of returning the HRESULT of the Run method, return the actual exit code of the application. Change-Id: I1e3d654ecdb4c319d4a08fe8a11e8699d186f66b Reviewed-by: Oliver Wolff <oliver.wolff@digia.com> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@digia.com>
* Change entry point for WinRT apps to WinMainMaurice Kalinowski2014-01-061-15/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | Using wmain causes the problem that the linker seems to create some code around it, which calls ExitProcess. That function however is forbidden by the Windows Store Certification process and hence you cannot publish an application currently. This does not apply to Windows Phone, which links in such a way that this problem does not occur there. With WinMain as the entry point this does not happen and also is the default entry point. Testing locally shows that certification goes fine. Since it does not pass the full command line string, the C-runtime method __getmainargs is used instead. This also gives access to any environment strings which may be passed. Note that MSDN states that this function should only be used for desktop applications. For XAML/C++ scenarios there is no entry function at all, but rather the App object gets instantiated in the default template. But this only works for XAML itself and not for plain C++ applications, probably some other entry wrapper is created on the fly here. Done-with: Andrew Knight <andrew.knight@digia.com> Change-Id: I8a118eddf6cfeddeca7d676267e979af17123e02 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
* Avoid adding empty argumentsMaurice Kalinowski2013-11-011-5/+7
| | | | | | | | QByteArray split does create one item even if the string is empty. Hence check if the launch arguments string needs to be parsed at all. Change-Id: I0a355212aaa7254fe0f417c61a59c30223311915 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* WinRT winmain: enable debugger waitingAndrew Knight2013-10-041-1/+9
| | | | | | | | | | | | WinRT applications are not invoked directly, so a debugger may attach too late to be useful. While the application can be launched with a debugging server, attaching directly to the running process is simpler and less resource-intensive. For this reason, it is useful for applications to wait for the direct debugger to attach. If the existing -qdebug parameter is passed to the application, wait idly until the debugger attaches. Change-Id: I7b4957beb9728ab6311b459e4d809dc5f4767780 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* winmain for winrtAndrew Knight2013-09-141-0/+150
WinRT passes the executable and Appx server info to the CRT main, and supports several additional activation arguments as well. This handles the arguments passed to main as well as the case where a modern app is launched from an external application (e.g. Qt Creator). Task-number: QTBUG-30198 Change-Id: Ia843e98c7843d5705f5f6d1c809de0b6bcdb5d26 Done-with: Kamil Trzcinski Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>