Have been using Visual Foxpro for more than 12 years and very sad have to switch to other languages as Visual Foxpro no longer supported by Microsoft. Even though I also programs using C now and then during the 12 years, I am never done any GUI programming with that. Most of the times, I only use it to make an interface to Visual Foxpro (as Visual Foxpro natively do not support thread and pointer).
And I just change my job recently (for two months now) and I have to switch to C/C++.
The first two weeks is very miserable as I do not really used to Windows Messages. But now I like it very much even though the programming time is not as short of using Visual Foxpro. (still like Visual Foxpro more..., able to finish few forms in 1 day).
On my first project, I being task to re-enhance the existing application to make it better looking and more friendly. As I am new in C/C++, I do not have ammunition at all. So I have to build all from scratch... Luckily there are sites offer tips and free source code (i.e. codeguru.com and codeproject.com) and also thanks to Win32++ (by David Nash) for his excellent works .
I slowly start building my own library and now after two months I am quite used to C/C++ GUI programming (without MFC).
In these two months, I have made a lot of newbie mistake but I also quite frustated with Microsoft Visual Studio 2008 environment. Start from disapearing line now and then, the not so Intelligent IntelliSense and and and.
And in this post I would like mention about the imfamous compile error: error C2065: 'GUID_NULL' : undeclared identifier.
Try to google it, as from today, there are 741 results found.
By the way, this error is not happen when you turn on the precompiled headers in the Compiler settings (/Yu). But I do not like the idea of having to include stdafx.h in all my source code. I like my source code to be portable as I would like to share it amongs projects. Having to include stadfx.h create a lot of trouble (from what I know currently).
From the 741 results found, here are two of suggested solutions:
1. define your own GUID_NULL in your program
2. includes initguid.h before any others includes
These solution are not working (at least in my project).
After try and error, I found the solution (for my project, not sure if it works for yours).
I include cguid.h before any atl*.h includes and the errors gone.....
Lets hope this will help some of you that having same problem as me.
Have a nice day....
Subscribe to:
Post Comments (Atom)
Very good and very useful. I have tried many. But your single line solved all the problem. Thanks
ReplyDelete""Include cguid.h before any atl*.h""
Done in stdafx.h file.
This resolved my problem when trying to use CComPtr in torque 3D when working on an MS windows only component
ReplyDeletetried it, worked like a charm. thanks a bunch.
ReplyDelete