mirror of
https://github.com/qmlnet/qmlnet.git
synced 2026-05-15 14:15:54 -06:00
[GH-ISSUE #155] Native Hosting sample compile error in Windows #94
Labels
No labels
bug
enhancement
help wanted
help wanted
pull-request
question
todo
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/qmlnet#94
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @geigertom on GitHub (Aug 3, 2019).
Original GitHub issue: https://github.com/qmlnet/qmlnet/issues/155
I tried to run the native hosting sample project in Windows 7. Could not compile it, because of this error:
I had to change line 26 in src\native\QmlNet\HostingCoreHost,cpp :
to
to get it working.
Seems to be related to the number of bytes used per character.
Is this a valid fix for the error?
@pauldotknopf commented on GitHub (Aug 3, 2019):
There are two methods,
GetModuleHandleA, andGetModuleHandleW. One uses wide chars (unicode), the other uses ansci chars. The methodGetModuleHandleis aliased to one of the two. I believe the header file on Windows has someifdefs to determine which alias should be used.I don't have my Windows machine with me, but my guess is that when I initially ran this on Windows, the
GetModuleHandleAwas being used. On your machine, it looks likeGetModuleHandleWis being used. I think the correct method would be to just useGetModuleHandleWdirectly, instead of theGetModuleHandlealias.