![]() |
| | #1 |
| Registered User Join Date: Dec 2002
Posts: 162
| ![]() I am writing a program in Visual C++ 6.0 Service Pack 5 that uses the FlashWindowEx() function. But when I compile the program it says: error C2065: 'FlashWindowEx' : undeclared identifier I have included both the windows.h and winuser.h but neither declares this function, but according to MSDN the requirements are: Windows NT/2000/XP: Included in Windows 2000 and later. Windows 95/98/Me: Included in Windows 98 and later. Header: Declared in Winuser.h; include Windows.h. Library: Use User32.lib. I have even tried to declare it my self by writing: Code: #pragma comment(lib,"user32.lib") __declspec(dllimport) BOOL FlashWindowEx (FLASHWINFO *pfwi); Last edited by Aidman; 05-16-2003 at 10:43 AM. |
| Aidman is offline | |
| | #2 |
| erstwhile Join Date: Jan 2002
Posts: 2,223
| It's declared in winuser.h from oct 2002 psdk as: Code: #if(WINVER >= 0x0500)
typedef struct {
UINT cbSize;
HWND hwnd;
DWORD dwFlags;
UINT uCount;
DWORD dwTimeout;
} FLASHWINFO, *PFLASHWINFO;
WINUSERAPI
BOOL
WINAPI
FlashWindowEx(
PFLASHWINFO pfwi);
#define FLASHW_STOP 0
#define FLASHW_CAPTION 0x00000001
#define FLASHW_TRAY 0x00000002
#define FLASHW_ALL (FLASHW_CAPTION | FLASHW_TRAY)
#define FLASHW_TIMER 0x00000004
#define FLASHW_TIMERNOFG 0x0000000C
#endif /* WINVER >= 0x0500 */
In any event, you could use the above declares, ensuring you #define WINVER 0x0500 and link with user32.lib normally (the fn does appear in user32.lib with the default msvc6 psdk distribution). You should probably get and install the oct 2002 psdk from microsoft anyway. |
| Ken Fitlike is offline | |
| | #3 |
| Skunkmeister Join Date: Aug 2001
Posts: 2,572
| got help files? Using the SDK Headers This version of the Microsoft® Platform SDK targets applications for Microsoft Windows® 95, Microsoft Windows NT® 4.0, Microsoft Windows® 98, Microsoft Windows Millennium Edition (Windows Me), Microsoft Windows 2000, Microsoft Windows XP, and Microsoft Windows .NET Server using the header file conventions below. The makefiles generated by Microsoft Visual C++® 5.0 and 6.0 target Windows NT 3.51 by default. To use functions introduced in Windows NT 4.0 or later, which are protected by conditional code, you must define the appropriate macros. Otherwise, you will receive the following error message from the compiler: error C2065: undeclared identifier. You may also need to ensure that the INCLUDE environment variable has the path to the Platform SDK header files listed before the path to the Visual C++ header files. Otherwise, you will receive error C2065 for items that were introduced after Visual C++ was released. The following table indicates the macros you must define to target each system using the SDK headers. Minimum System Required Macros to Define Windows 95 and Windows NT 4.0 WINVER=0x0400 Windows 98 and Windows NT 4.0 _WIN32_WINDOWS=0x0410 and WINVER=0x0400 Windows NT 4.0 _WIN32_WINNT=0x0400 and WINVER=0x0400 Windows 98 _WIN32_WINDOWS=0x0410 Windows 2000 _WIN32_WINNT=0x0500 and WINVER=0x0500 Windows Me _WIN32_WINDOWS=0x0490 Windows XP and Windows .NET Server _WIN32_WINNT=0x0501 and WINVER=0x0501 Internet Explorer 3.0, 3.01, 3.02 _WIN32_IE=0x0300 Internet Explorer 4.0 _WIN32_IE=0x0400 Internet Explorer 4.01 _WIN32_IE=0x0401 Internet Explorer 5.0, 5.0a, 5.0b _WIN32_IE=0x0500 Internet Explorer 5.01, 5.5 _WIN32_IE=0x0501 Internet Explorer 6.0 _WIN32_IE=0x0560 or _WIN32_IE=0x0600 If you are writing your own makefile, the macros in Win32.mak can help you use the correct conventions. The value of _WIN32_WINNT is set in Win32.mak, depending on the platform you choose to target. For more information, see Building Applications Using Win32.mak. The Platform SDK headers use guard statements to determine the system on which each function is supported. The following table describes these statements. Guard Statement Meaning #if _WIN32_WINNT >= 0x0400 Windows NT 4.0 and later. It is not implemented in Windows 95. #if _WIN32_WINDOWS >= 0x0410 Windows 98. The image may not run on Windows 95. #if _WIN32_WINDOWS >= 0x0490 Windows Me. The image may not run on Windows 95/98, Windows NT, or Windows 2000. #if _WIN32_WINNT >= 0x0500 Windows 2000. The image may not run on Windows 95/98 or Windows NT. #if _WIN32_WINNT >= 0x0501 Windows XP. The image may not run on Windows 95/98, Windows NT, Windows Me, or Windows 2000. #if _WIN32_IE >= 0x0300 Internet Explorer 3.0 and later. #if _WIN32_IE >= 0x0400 Internet Explorer 4.0 and later. #if _WIN32_IE >= 0x0401 Internet Explorer 4.01 and later. #if _WIN32_IE >= 0x0500 Internet Explorer 5.0 and later. #if _WIN32_IE >= 0x0501 Internet Explorer 5.01 and later. #if _WIN32_IE >= 0x0560 Internet Explorer 6.0 and later #if _WIN32_IE >= 0x0600 Internet Explorer 6.0 and later For example, if you do not include Win32.mak in your makefile, you need to explicitly define _WIN32_WINNT as 0x0500 to use the Windows 2000-specific material in the header files. There are functions in Windows 95 OEM Service Release 2 that are guarded by (_WIN32_WINNT >= 0x0400), such as the Cryptographic Application Programming Interface (CryptoAPI). If you are writing an application specifically for Windows 95 OEM Service Release 2, and you want the header files to provide compile time access to these functions, it is necessary to define _WIN32_WINNT as 0x0400. Note that an application using these functions does not run correctly on the retail release of Windows 95. In general, applications expected to run on Windows 95 should be built without defining _WIN32_WINNT. This version of the Platform SDK can also be used to build applications for 64-bit Windows. The header files use new data types that allow you to build both 32- and 64-bit versions of your application from a single source code base. For more information, see Getting Ready for 64-bit Windows.
__________________ Free the weed!! Class B to class C is not good enough!! And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi |
| Stoned_Coder is offline | |
| | #4 |
| Registered User Join Date: Dec 2002
Posts: 162
| Ok Thanks!
__________________ We haven't inherited Earth from our parents; instead we have borrowed her from our children - old Indian saying. |
| Aidman is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Getting an error with OpenGL: collect2: ld returned 1 exit status | Lorgon Jortle | C++ Programming | 6 | 05-08-2009 08:18 PM |
| variables when declared inside or outside a function | jas_atwal | C Programming | 6 | 12-14-2007 02:42 PM |
| <Gulp> | kryptkat | Windows Programming | 7 | 01-14-2006 01:03 PM |
| Please Help - Problem with Compilers | toonlover | C++ Programming | 5 | 07-23-2005 10:03 AM |
| Nested loop frustration | caroundw5h | C Programming | 14 | 03-15-2004 09:45 PM |