how to solve the problem occured due to using setupapi.h and Dbt.h header files in my windows service application.. in windows XP and VC++.Net 2005
-
hello, I created a win32 project(precompiled headers, console application). This was created to create a service( for which i used SERVICE_TABLE_ENTRY, SERVICE_STATUS, SERVICE_STATUS_HANDLE, etc... required structures and methods). Environment used: Windows XP, VC++.Net2005. Should work on: I want to make this exe to run on windows 95,98, XP, 2000 and Vista. my stdafx.h file contains: #pragma once #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers #include #include // TODO: reference additional headers your program requires here #pragma warning (disable:4430)//... i added this, since i was getting this error. and in msdn this //was given as its solution. To this project, i have added two more files: 1) USBActivity.h 2) USBActivity.cpp In USBActivity.cpp the hierarchy of headers included is as follows: #include "stdafx.h" #include #include "stdio.h" #include #include #include "afxcmn.h" #include "cfgmgr32.h" #include "Blowfish_Data_FileEncrpt.h" #include "USBActivity.h" The project properties are set as: Use windows Standard libraries, WIN32;_DEBUG;_CONSOLE as preprocessor definitions, Basic Run-TimeChks: Both (/RTC1, equiv. to /RTCsu) , RunTime-Library --> Multi-threaded Debug (/MTd), Use Precompiled Header (/Yu), Linker+AdditionalDependencies-->setupapi.lib. I am getting following build errors: Compiling... stdafx.cpp Compiling... Blowfish_Data_FileEncrpt.cpp DataSentinelService.cpp d:\microsoft visual studio 8\vc\platformsdk\include\commctrl.h(29) : error C2146: syntax error : missing ';' before identifier 'HRESULT' d:\microsoft visual studio 8\vc\platformsdk\include\prsht.h(97) : error C2065: 'CALLBACK' : undeclared identifier d:\microsoft visual studio 8\vc\platformsdk\include\prsht.h(97) : error C2065: 'LPFNPSPCALLBACKA' : undeclared identifier d:\microsoft visual studio 8\vc\platformsdk\include\prsht.h(97) : fatal error C1903: unable to recover from previous error(s); stopping compilation DoubleBuffering.cpp SHA.cpp USBActivity.cpp d:\microsoft visual studio 8\vc\platformsdk\include\commctrl.h(29) : error C2146: syntax error : missing ';' before identifier 'HRESULT' d:\microsoft visual studio 8\vc\platformsdk\include\prsht.h(97) : error C2065: 'CALLBACK' : undeclared identifier d:\microsoft visual studio 8\vc\platformsdk\include\prsht.h(97) : error C2065: 'LPFNPSPCALLBACKA' : undeclared identifier d:\micr
-
hello, I created a win32 project(precompiled headers, console application). This was created to create a service( for which i used SERVICE_TABLE_ENTRY, SERVICE_STATUS, SERVICE_STATUS_HANDLE, etc... required structures and methods). Environment used: Windows XP, VC++.Net2005. Should work on: I want to make this exe to run on windows 95,98, XP, 2000 and Vista. my stdafx.h file contains: #pragma once #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers #include #include // TODO: reference additional headers your program requires here #pragma warning (disable:4430)//... i added this, since i was getting this error. and in msdn this //was given as its solution. To this project, i have added two more files: 1) USBActivity.h 2) USBActivity.cpp In USBActivity.cpp the hierarchy of headers included is as follows: #include "stdafx.h" #include #include "stdio.h" #include #include #include "afxcmn.h" #include "cfgmgr32.h" #include "Blowfish_Data_FileEncrpt.h" #include "USBActivity.h" The project properties are set as: Use windows Standard libraries, WIN32;_DEBUG;_CONSOLE as preprocessor definitions, Basic Run-TimeChks: Both (/RTC1, equiv. to /RTCsu) , RunTime-Library --> Multi-threaded Debug (/MTd), Use Precompiled Header (/Yu), Linker+AdditionalDependencies-->setupapi.lib. I am getting following build errors: Compiling... stdafx.cpp Compiling... Blowfish_Data_FileEncrpt.cpp DataSentinelService.cpp d:\microsoft visual studio 8\vc\platformsdk\include\commctrl.h(29) : error C2146: syntax error : missing ';' before identifier 'HRESULT' d:\microsoft visual studio 8\vc\platformsdk\include\prsht.h(97) : error C2065: 'CALLBACK' : undeclared identifier d:\microsoft visual studio 8\vc\platformsdk\include\prsht.h(97) : error C2065: 'LPFNPSPCALLBACKA' : undeclared identifier d:\microsoft visual studio 8\vc\platformsdk\include\prsht.h(97) : fatal error C1903: unable to recover from previous error(s); stopping compilation DoubleBuffering.cpp SHA.cpp USBActivity.cpp d:\microsoft visual studio 8\vc\platformsdk\include\commctrl.h(29) : error C2146: syntax error : missing ';' before identifier 'HRESULT' d:\microsoft visual studio 8\vc\platformsdk\include\prsht.h(97) : error C2065: 'CALLBACK' : undeclared identifier d:\microsoft visual studio 8\vc\platformsdk\include\prsht.h(97) : error C2065: 'LPFNPSPCALLBACKA' : undeclared identifier d:\micr
anumadhu wrote:
#pragma once #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers #include #include
Choose, ignore html tags option, so that file included will be visible. Modify your post for that. I feel its causing because of incorrect sequence of include headers.
Prasad Notifier using ATL | Operator new[],delete[][^]
-
hello, I created a win32 project(precompiled headers, console application). This was created to create a service( for which i used SERVICE_TABLE_ENTRY, SERVICE_STATUS, SERVICE_STATUS_HANDLE, etc... required structures and methods). Environment used: Windows XP, VC++.Net2005. Should work on: I want to make this exe to run on windows 95,98, XP, 2000 and Vista. my stdafx.h file contains: #pragma once #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers #include #include // TODO: reference additional headers your program requires here #pragma warning (disable:4430)//... i added this, since i was getting this error. and in msdn this //was given as its solution. To this project, i have added two more files: 1) USBActivity.h 2) USBActivity.cpp In USBActivity.cpp the hierarchy of headers included is as follows: #include "stdafx.h" #include #include "stdio.h" #include #include #include "afxcmn.h" #include "cfgmgr32.h" #include "Blowfish_Data_FileEncrpt.h" #include "USBActivity.h" The project properties are set as: Use windows Standard libraries, WIN32;_DEBUG;_CONSOLE as preprocessor definitions, Basic Run-TimeChks: Both (/RTC1, equiv. to /RTCsu) , RunTime-Library --> Multi-threaded Debug (/MTd), Use Precompiled Header (/Yu), Linker+AdditionalDependencies-->setupapi.lib. I am getting following build errors: Compiling... stdafx.cpp Compiling... Blowfish_Data_FileEncrpt.cpp DataSentinelService.cpp d:\microsoft visual studio 8\vc\platformsdk\include\commctrl.h(29) : error C2146: syntax error : missing ';' before identifier 'HRESULT' d:\microsoft visual studio 8\vc\platformsdk\include\prsht.h(97) : error C2065: 'CALLBACK' : undeclared identifier d:\microsoft visual studio 8\vc\platformsdk\include\prsht.h(97) : error C2065: 'LPFNPSPCALLBACKA' : undeclared identifier d:\microsoft visual studio 8\vc\platformsdk\include\prsht.h(97) : fatal error C1903: unable to recover from previous error(s); stopping compilation DoubleBuffering.cpp SHA.cpp USBActivity.cpp d:\microsoft visual studio 8\vc\platformsdk\include\commctrl.h(29) : error C2146: syntax error : missing ';' before identifier 'HRESULT' d:\microsoft visual studio 8\vc\platformsdk\include\prsht.h(97) : error C2065: 'CALLBACK' : undeclared identifier d:\microsoft visual studio 8\vc\platformsdk\include\prsht.h(97) : error C2065: 'LPFNPSPCALLBACKA' : undeclared identifier d:\micr
yeah, probing towards the cause of this problem, i got two causes: 1) What you said that, the wrong order of include headers. 2) Accessing the SDK files from a application(my application) which does not support current build environment. I am using VC++.Net2005 and Windows XP. I have tried lot many options of including the order of headers.. but none of them was much helpful. And coming to not supporting build environment, i don understand how to get into its solution. Do you have any clue or idea. Thanks Anee Anee