I ran a further test and discovered that the resource compiler did not generate the correct output file. The resulting resource object was missing the dialog, so that was why your code immediately terminated. However, I cannot reproduce your environment as I do not have the old version of Visual Studio. So the corrections I made are to make use of the Visual Studio 2022 environment.
As I keep saying, stop wasting time with this out of date code (and book) and move on to the latest version of Visual Studio, and the associated documentation.
Don't laugh about me I am learning WINAPI from an old book . ( I have understand it that is no sense
to check if windows is less than 3.5 )
Until now, I had to compile code that was written with WindProc procedure, but the author has now been found to shoot me
in the knee with message crackers ( now I am google it for them to understand them ).
I hope to go with this code until the finish, because I have to handle and with those macro funcions now.
Honestly, I don't think it's that useful to learn Win32 API. World has moved over to other technologies in the last 20-25 years. Whatever books you find, they are old (not much money to be made by authors writing about a dead subject) and the skills you acquire they are not in high demand.
I am feeling too that I am not quite on the right path. I wanted to enter in the world of programming and I started to
learn C++. Then I said that C++ is a tool, and I realized that I have to do something with this tool and I have start
to learn WINAPI beacause I wanted to be capable to design some interfaces from scrap. This was the path that I choose to
walk through and I keept going, good or bad that was what I knew to do. Now I am at the finish of this WINAPI book and I am
planning to learn and some data bases.
I want to enter in the world of programming and to be able to work on my own, if you have advices for me I am more than
glad to count on them.
if you have advices for me I am more than
glad to count on them.
Well, I am sorry to say that you have probably wasted your time learning the Windows API. Especially so if you now want to learn database programming. You really need to move into the .NET field if you expect to make a career in programming. .NET Book Zero by Charles Petzold[^] is an excellent introduction. Beyond that there are plenty of free tutorials online, for advanced C# and database programming. A word of warning: stay clear of youtube tutorials as they tend to be less than good quality.
Thank you for your thoughts, I will end this WINAPI subject book because I have a few chapters until the end and I have to finish what I have started and I will start reading your sugested documentation about .NET because, honestly I don't have a clear image about what .NET it is and could de but I think that the fact that I had learned something about WINAPI apps will help me to beter understanding.
If you learn something for the intention of making yourself an income, then the Win32 API is not the right choice in the year 2025. On the other hand ...
I learned Windows programming before there was a WIN32 API, it was way back in the 16-bit days of the "WIN16 API" (it was never called that). My primary learning was not an API, but event driven programming: Taking your data structures from one consistent state to another consistent state in well defined, atomic steps. Always leaving your data so that it can be properly used by anyone else the next time something happens. No loose ends, no garbage on the floor. Looking upon each event cycle similar to a database transaction. A great philosophy for building robust software.
Often, programmers show me code: 'See, I am doing event driven programming too - here is the switch case on the input value!' But even driven is so much more than a switch statement. What I see is a lot of other logic that is not at all related to the state and event, lots of loose ends, lots of garbage variables affecting the state without being treated as state data. The Windows model put a strong pressure on you to do 'clean' event driven coding.
Today, working in C#, I still think in event/state terms, taking data structures through well defined, finite processing steps from on consistent state to another. I didn't learn that from any book published this millennium. I didn't learn it from younger coworkers. I didn't learn it from browsing programming forums on the Internet. I learned it from the Windows API.
I am really happy to have that background when programming in the year 2022, with the tools of year 2022. Learning the Windows API / event driven programming was certainly no waste of time. It has great value for me, even today.
Although I am not initiated in programming, I felt it when I started to learn C++ and MFC despite C#, that C++ is more closer to the hardware components, to the heart of the machine, I felt that with C++ I can put my hands and get dirty, and so on that with WINAPI I can comunicate more closer with WINDOWS system, through the windows API functions, I felt that those are the right and honest stpes to get started in programming, I felt that these are the basics that I have to know to start an healty way of programming. But my goal is as you expressed yourself " to make myself an income" and for that appears that I have to learn more tools to be able to deliver a stand alone product. I don't know if my path is the good one but I keep pushing until I will succed.
The problem with using that sort of macro is that they are a pain to debug when something goes wrong. All you need to do is copy and paste the actual lines of code into your OnInitDialog function. And remember to remove all those backslashes. You can then easily step through line by line in the debugger if necessary.
Yes, I had wondered myself if it is any method to see where is the error in this macro functions because compiler says generally that is an error in a macro function but you have to search through all lines of the code to see where the error could be.
And those backslash are very wierd, I don't know what is their role.