![]() |
|
|||||||
|
|
Thread Tools | Search this Thread | Rate Thread |
|
#1
|
|||
|
|||
Problem with "#include <windows.h>" in Visual C++ 2005 Express EditionHi guys I'm in the process of attempting to write a small program that will capture an image of a window. I am writing a class CaptureScreen which will capture the images from the windows. The CaptureScreen header file "CaptureScreen.h" is as follows:
CPP / C++ / C Code:
Where should I put the #include <windows.h> statement? I presume that it needs to be somewhere in the header file otherwise the HWND class will not be recognized by the compiler as a valid identifier. Also, when I try to compile the above code, I get the following error message: Code:
I have the following directories in my Tools-Options-VC++ Directories-Show directories for: Include files: $(VCInstallDir)include $(VCInstallDir)atlmfc\include $(VCInstallDir)PlatformSDK\include\prerelease $(VCInstallDir)PlatformSDK\common\include\prerelea se $(VCInstallDir)PlatformSDK\include $(VCInstallDir)PlatformSDK\common\include $(FrameworkSDKDir)include Any advice as to why this won't compile would be greatly appreciated. Sincerely, Simon Pearson |
|
#2
|
|||
|
|||
Re: Problem with "#include <windows.h>" in Visual C++ 2005 Express EditionIf you can provide me the .cpp file, then may be I can help you.
|
|
#3
|
|||
|
|||
Re: Problem with "#include <windows.h>" in Visual C++ 2005 Express EditionQuote:
So: Is windows.h (or Windows.h or any other thing like windows.h) in any of these directories? The 2005 distribution did not include windows.h (or any of the windows API libraries required to actually create windows applications). PlatformSDK also did not include them, as I recall. There were some rather detailed instructions on the Microsoft site from which I downloaded the compiler package that showed how to obtain and install the SDK for Windows applications. I don't know whether it is still there or is still valid. (You might consider getting a later version of compiler from Microsoft. Still free.) Bottom line: If you have windows.h somewhere in the "Microsoft Visual Studio 8" directory tree, you must make sure that that directory is in the include path. (You must also put the lib directory with the .dll and .lib files on the path that the linker can find.) Regards, Dave |
|
#4
|
||||
|
||||
Re: Problem with "#include <windows.h>" in Visual C++ 2005 Express EditionQuote:
__________________
Use the force...read the source!! WYCIWYG -- what you code is what you get! |
|
#5
|
|||
|
|||
Re: Problem with "#include <windows.h>" in Visual C++ 2005 Express EditionThanks for all of the helpful replies, I fixed the problem by uninstalling Visual Studio Express Edition 2005,replacing it with Visual Studio Express Edition 2009 and then following the 5 steps in the post linked by TurboPT to install the PlatformSDK.
Is the include <windows.h> statement at the right place in the header file? This compiles but I didn't want to be following any poor coding practices. |
Recent GIDBlog
2nd Week of IA Training by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Experiencing a linking error with MS Visual C++ 2005 Express Edition | SimonP | CPP / C++ Forum | 3 | 20-Dec-2007 14:34 |
| Major newbie problem | cynack | MS Visual C++ / MFC Forum | 1 | 08-Apr-2007 11:25 |
| can i run visual 2005 mfc project in visual 6 or 2003? | spillover | MS Visual C++ / MFC Forum | 1 | 27-Dec-2006 18:09 |
| How Visual C++ only from Visual Studio .net | Picstudent | .NET Forum | 2 | 28-May-2006 20:52 |
| What is "Ambigious symbol" ??*( a compilation error) | small_ticket | CPP / C++ Forum | 2 | 07-Jan-2005 21:10 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The