Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Calling ASCII or Unicode version of Windows APIs

Calling ASCII or Unicode version of Windows APIs

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 603 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • X Offline
    X Offline
    xalam
    wrote on last edited by
    #1

    I am converting a Visual Studio C++ demo that works with USB devices. Now Windows has ANSII and UNICODE version of APIs, this is giving me a lot of trouble.

     C:\code\MyProject\USBDevices.cpp:374: error: C2664: 'USBDevices::EnumerateHostController' : cannot convert parameter 3 from  'WCHAR [1]' to 'PCHAR' Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
    

    My question is if I have a structure defined as:

    SP_DEVICE_INTERFACE_DATA         deviceInterfaceData;
    

    Can I set settings in Qt somewhere to use SP_DEVICE_INTERFACE_DATA_W rather than SP_DEVICE_INTERFACE_DATA_A like Visual Studio does?

    1 Reply Last reply
    0
    • hskoglundH Offline
      hskoglundH Offline
      hskoglund
      wrote on last edited by hskoglund
      #2

      Hi, actually I think there is only one SP_DEVICE_INTERFACE_DATA structure without _A and _W suffixes (normally A and W are appended for functions, not structures).
      Maybe instead there's a problem with your Unicode settings, usually Qt only defines UNICODE and not _UNICODE which sometimes Windows wants as well.

      Edit: Here's a good explanation about the UNICODE and _UNICODE defines.

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved