Menu

moving WTL projects from VS 2015 to VS 2022

Andrew_M
2023-05-26
2023-06-07
  • Andrew_M

    Andrew_M - 2023-05-26

    this process is always pain in ass. Two similar projects, one was succesfully modiied afteer such transaction, but the other is rejected by compiler. It is barking to CDCHandle, used in atlgdi.h file. "undeclared identifier", C2065. Moreover, I do not included this file to my include list. Can anyone give me some idea, what the issue might be here?

     
  • Nenad Stefanovic

    Hi Andrew,

    You should review your include files and also include file paths that you have in your project. It could be that some path is including files from wrong (or old) location.

    atlgdi.h is always included via atlapp.h

    Cheers,
    Nenad

     
  • Andrew_M

    Andrew_M - 2023-06-05

    Thank you. I did what you wrote here, of course. Zero result. Bu I resolved the situation. I had a simple WTL project, created with WTL for VS2014. I was able to recompile it under VS2022 (after changing pathes to WTL files, of course). Then I began to replace files of the project- one by one. Compiler accepted them. The only one thing was inconvenient- I had to change names. Well, I can live with it. What is the most important is the fact, that the project runs. And, BTW, thank you for WTL- it is much better than MFC for example.

     
  • Nenad Stefanovic

    I am glad that you solved the problem.

    Thank you!
    Nenad

     
  • Andrew_M

    Andrew_M - 2023-06-06

    Afraid, thee is a resaon. The instalaltion script is looking for string like "Microsoft Visual Studio 14", but there ane no such folders in my version of VS2022 (it is free Community version)

     
  • Nenad Stefanovic

    That part of the code is looking for older versions of Visual Studio. It is under section

    // Search for Visual Studio 2005-2015
    

    If you look further you will find the next section

    // Search for Visual Studio 2017/2019/2022
    

    which searches for newer versions. If the section does not mention Visual Studio 2022, that means that you don't have the updated file.

    Have you tried to run setup.js?

    Cheers,
    Nenad

     
  • Andrew_M

    Andrew_M - 2023-06-07

    Yes, I did and it failed. I placed that script in differnt folders- no matter. Error: cannot read tmp file (file not found). and finally "setup couldn't find Visual Studio installed"

     
  • Nenad Stefanovic

    You can run

    setup.js /debug
    

    and it will give you more info about steps that it is performing. It will also give you the full path of temporary files that it is creating, so you can check what is wrong with that.

    Don't move setup.js without also moving Files subfolder.

    Good luck,
    Nenad

     
  • Andrew_M

    Andrew_M - 2023-06-07

    ran it with "debug". It wanted to create tmp file, but failed. Maybe, administarative privileges are necessary?

     
  • Nenad Stefanovic

    Of course administrative priviledges are required. Setup.js should automatically ask for them. If it doesn't, something else is wrong.

     
  • Andrew_M

    Andrew_M - 2023-06-07

    but it didn't ask. I ran script an simultanseeously checked directory for tmp file- there was no such file- it wasn't written.

     

Log in to post a comment.