locked
Empty Desktop Application? RRS feed

  • Question

  • Hello Folks:

       Developing on Windows 10 Pro, Visual Studio Community. 

       TL;DR How do I make this error go away:

    4>c:\program files (x86)\microsoft visual studio\2017\community\sdk\scopecppsdk\sdk\include\um\combaseapi.h(234): error C2760: syntax error: unexpected token 'identifier', expected 'type specifier'

       Can I create empty projects where I define the main module and build my own dialogs instead of Visual Studio, like I was able to do until about six months ago?

       I'm having a frustrating week with Window development. 

       I have a project that uses the Botan crypto library.  I need to upgrade it to Botan's current version. 

       Late last year I built a little crypto playground application featuring a dialog with radio buttons and edit boxes to select encryption algorithms, and enter and display clear text, pass phrases, ciphertext, base 64 encodings, and other things. 

       Everything appeared to work fine, the last time I played with it in January. 

       Today I tried to build it and this error popped up:

    4>c:\program files (x86)\microsoft visual studio\2017\community\sdk\scopecppsdk\sdk\include\um\combaseapi.h(234):

    error C2760: syntax error: unexpected token 'identifier', expected 'type specifier'

       This is the offending code in combaseapi.h:

    //  IID_PPV_ARGS(ppType)
    //      ppType is the variable of type IType that will be filled
    //
    //      RESULTS in:  IID_IType, ppvType
    //      will create a compiler error if wrong level of indirection is used.
    //
    extern "C++"
    {
        template<typename T> _Post_equal_to_(pp) _Post_satisfies_(return == pp) void** IID_PPV_ARGS_Helper(T** pp) 
        {
    #pragma prefast(suppress: 6269, "Tool issue with unused static_cast")
            static_cast<IUnknown*>(*pp);    // make sure everyone derives from IUnknown
            return reinterpret_cast<void**>(pp);
        }    
    }

       The error messages identify the line with the comment "make sure everyone derives from IUnknown". 

       Let's refresh Visual Studio Community with an uninstall - install.  It's been a while since I did that. 

       Same error messages. 

       Ok, let's simplify and see if the problem can be identified.

       Create a new project and copy the application's main C++ module into it.  Then I'll reduce that C++ code to WinMain(), build it and then add features until I see a problem. 

       Here's something annoying.  New Project - Installed - Windows Desktop - Windows Desktop Application no longer offers "Empty Project". 

       I've used this in the past for all of my projects. 

       For an empty project, Visual Studio provided a rudimentary .rc and resource.h.  I could copy an existing WinMain() C++ file or create a new one. 

       I could then use the dialog editor and other resource editors to build what I needed. 

       Is there a way to regain this functionality?  Did I check something when I installed Visual Studio that disabled the empty project feature? 

    Anyway...

       I create the new project with its automatically generated files.  I then replace the application.h, application.cpp application.rc and resource.h files with the corresponding files in the crypto project. 

       I strip the new WinMain() to little more than a call to DialogBox(..., "IDD_BLOCK_CIPHER_DIALOG", ..., dialogproc);

       Yea, that isn't your Petzold style WinMain().  It allows me to define the application's main window in the Resource editor. 

       Anyway, an compile error pops up.  'IDD_BLOCK_CIPHER_DIALOG': undeclared identifier

       What's going on?  The .rc file has:

    /////////////////////////////////////////////////////////////////////////////
    //
    // Dialog
    //
    
    IDD_BLOCK_CIPHER_DIALOG DIALOGEX 0, 0, 523, 704

       When I open the new application's resource page the only dialog I see has the name "IDD_ABOUTBOX".  This is something Visual Studio automatically crated, with the .rc file.  But I've moved that .rc file to another directory, and Visual Studio refuses to get the dialog out of the .rc file that's actually in the folder where the source file is. 

       Suggestions? 

          Thanks
          Larry



    Friday, April 5, 2019 2:33 PM

Answers

  • As far as creating an Empty Windows desktop project goes, you need to use the Windows Desktop Wizard -

    And in the wizard you can make the selections you want -

    • Marked as answer by a_unique_name Friday, April 5, 2019 7:25 PM
    Friday, April 5, 2019 3:06 PM

All replies

  • As far as creating an Empty Windows desktop project goes, you need to use the Windows Desktop Wizard -

    And in the wizard you can make the selections you want -

    • Marked as answer by a_unique_name Friday, April 5, 2019 7:25 PM
    Friday, April 5, 2019 3:06 PM
  • Thanks RLWA32:

       That got me my empty build.  Microsoft changed the way to specify that and I had no idea. 

       The problem with that header was something toxic in one of my .props files.  I'll have to encode exactly what each property does in it's name. 

       As always, I appreciate your assistance. 

          Larry

    Friday, April 5, 2019 7:31 PM