Click here to Skip to main content
15,915,829 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Mail Id checking problem Pin
toxcct21-Mar-07 23:48
toxcct21-Mar-07 23:48 
AnswerRe: Mail Id checking problem Pin
James R. Twine22-Mar-07 1:55
James R. Twine22-Mar-07 1:55 
QuestionResize of the Frame Pin
Kiran Pinjala21-Mar-07 21:51
Kiran Pinjala21-Mar-07 21:51 
AnswerRe: Resize of the Frame Pin
prasad_som21-Mar-07 22:39
prasad_som21-Mar-07 22:39 
QuestionResource Error Pin
rushiraj.jhala21-Mar-07 21:36
rushiraj.jhala21-Mar-07 21:36 
QuestionRe: Resource Error Pin
prasad_som21-Mar-07 21:40
prasad_som21-Mar-07 21:40 
AnswerRe: Resource Error Pin
rushiraj.jhala21-Mar-07 23:31
rushiraj.jhala21-Mar-07 23:31 
Questionhow 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 Pin
anumadhu21-Mar-07 21:32
anumadhu21-Mar-07 21:32 
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 <stdio.h>
#include <tchar.h>

// 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 <initguid.h>
#include "stdio.h"
#include <setupapi.h>
#include <dbt.h>
#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:\microsoft visual studio 8\vc\platformsdk\include\prsht.h(97) : fatal error C1903: unable to recover from previous error(s); stopping compilation
Generating Code...
DataSentinelService - 8 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

I guess the error is because of :

--> calling a function in an SDK header file that is currently not supported in current build environment.

Could anybody help me out... in fixing this problem.
I have also seen the project given at the following link: http://www.codeproject.com/system/RemoveDriveByLetter.asp?df=100&forumid=294340&exp=0&select=1822184&tid=1815457#xx1822184xx

Here, it is given in vc++ 6. and when i compared the build environment everything was same.

In order to enumerate enumerate all the USB devices connected to PC, using a windows service... i have to use setupAPI in order to get setupDiGetDevClass etc methods.

I also tried with including windows.h file in stdafx.h. but it was also not helpful. since was included by-default. And on including it again i am getting the following error:

d:\microsoft visual studio 8\vc\atlmfc\include\afxv_w32.h(16) : fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include <windows.h>

Is there any other alternative?

Thanks
Anee



Anee

AnswerKeep title concise,too Pin
prasad_som21-Mar-07 21:38
prasad_som21-Mar-07 21:38 
AnswerRe: 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 Pin
anumadhu22-Mar-07 1:50
anumadhu22-Mar-07 1:50 
Questionretrieving an offset from an EXE Pin
SharatChandra21-Mar-07 21:14
SharatChandra21-Mar-07 21:14 
AnswerRe: retrieving an offset from an EXE Pin
toxcct21-Mar-07 23:46
toxcct21-Mar-07 23:46 
AnswerRe: retrieving an offset from an EXE Pin
James R. Twine22-Mar-07 1:57
James R. Twine22-Mar-07 1:57 
GeneralRe: retrieving an offset from an EXE Pin
David Crow22-Mar-07 3:33
David Crow22-Mar-07 3:33 
Questionregarding WAVE to MP3 conversion Pin
puneet_cha21-Mar-07 21:05
puneet_cha21-Mar-07 21:05 
AnswerRe: regarding WAVE to MP3 conversion Pin
Rajesh R Subramanian22-Mar-07 0:52
professionalRajesh R Subramanian22-Mar-07 0:52 
AnswerRe: regarding WAVE to MP3 conversion Pin
Mark Salsbery22-Mar-07 8:00
Mark Salsbery22-Mar-07 8:00 
Questionlistview remove item problem Pin
amitmistry_petlad 21-Mar-07 21:04
amitmistry_petlad 21-Mar-07 21:04 
AnswerRe: listview remove item problem Pin
Parthi_Appu21-Mar-07 21:13
Parthi_Appu21-Mar-07 21:13 
GeneralRe: listview remove item problem Pin
amitmistry_petlad 21-Mar-07 21:21
amitmistry_petlad 21-Mar-07 21:21 
GeneralRe: listview remove item problem Pin
prasad_som21-Mar-07 21:33
prasad_som21-Mar-07 21:33 
GeneralRe: listview remove item problem Pin
Parthi_Appu21-Mar-07 21:40
Parthi_Appu21-Mar-07 21:40 
QuestionRe: listview remove item problem Pin
David Crow22-Mar-07 3:38
David Crow22-Mar-07 3:38 
AnswerRe: listview remove item problem [modified] Pin
Parthi_Appu22-Mar-07 16:59
Parthi_Appu22-Mar-07 16:59 
GeneralRe: listview remove item problem Pin
David Crow23-Mar-07 8:15
David Crow23-Mar-07 8:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.