Uploaded image for project: 'Core ReactOS'
  1. Core ReactOS
  2. CORE-10320

Default values for BSTR function parameters (C++ prototypes) in .H files generated from .IDL should be UNICODE strings?

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • CRT, Wine
    • None

    Description

      A typical example of this problem is the following:
      a UNICODE-compiled win32 C++ app includes msxml2.h in order to use XML stuff. When it uses the standard MS PSDK, it compiles fine. When this app is integrated into the ROS trunk, MSVC generates error C2440 for the following function:

          virtual HRESULT STDMETHODCALLTYPE setStartMode(
              BSTR p,
              BSTR uri = "") = 0;

      The compiler expects the default string value to be UNICODE whereas it is not. In the (generated) standard MS PSDK msxml2.h header the default value is really a UNICODE one (I'm btw. wondering what's happening with an ANSI-compiled win32 app using MS PSDK msxml2.h file...). In our headers it is an ANSI string, therefore for UNICODE-compiled C++ apps using that header, you get the error (it doesn't show up currently in our trunk because the – few – modules using this header are compiled as ANSI (and are C projects).

      I think some investigation is needed.

      Attachments

        Activity

          People

            bug zilla Bug Zilla
            hbelusca hbelusca
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: