Click here to Skip to main content
15,891,529 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
AnswerRe: .NET cannot find mfc42.lib?? Pin
Wheatbread22-Mar-07 12:54
Wheatbread22-Mar-07 12:54 
QuestionPorting VS60 projects to .NET 2003 Pin
Wheatbread22-Mar-07 10:07
Wheatbread22-Mar-07 10:07 
AnswerRe: Porting VS60 projects to .NET 2003 Pin
Christian Graus22-Mar-07 10:21
protectorChristian Graus22-Mar-07 10:21 
AnswerRe: Porting VS60 projects to .NET 2003 Pin
Wheatbread22-Mar-07 10:27
Wheatbread22-Mar-07 10:27 
GeneralRe: Porting VS60 projects to .NET 2003 Pin
Dave Kreskowiak22-Mar-07 15:53
mveDave Kreskowiak22-Mar-07 15:53 
GeneralRe: Porting VS60 projects to .NET 2003 Pin
Kevin McFarlane25-Mar-07 3:00
Kevin McFarlane25-Mar-07 3:00 
AnswerRe: Porting VS60 projects to .NET 2003 Pin
Kevin McFarlane25-Mar-07 3:04
Kevin McFarlane25-Mar-07 3:04 
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:31
anumadhu21-Mar-07 21:31 
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

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
Adadurov22-Mar-07 5:57
Adadurov22-Mar-07 5:57 
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
Dave Kreskowiak22-Mar-07 6:50
mveDave Kreskowiak22-Mar-07 6:50 
QuestionFrames in HTML Pin
R.S Reddy21-Mar-07 18:48
R.S Reddy21-Mar-07 18:48 
AnswerRe: Frames in HTML Pin
KaineDunno21-Mar-07 22:01
KaineDunno21-Mar-07 22:01 
GeneralRe: Frames in HTML Pin
R.S Reddy21-Mar-07 22:30
R.S Reddy21-Mar-07 22:30 
QuestionPropertyGrid and Image Pin
Alan Seedhouse21-Mar-07 1:34
professionalAlan Seedhouse21-Mar-07 1:34 
Question.NET Logging & Exception Handling Guidelines Pin
K.P.Kannan21-Mar-07 1:24
K.P.Kannan21-Mar-07 1:24 
AnswerRe: .NET Logging & Exception Handling Guidelines Pin
Dave Kreskowiak21-Mar-07 3:32
mveDave Kreskowiak21-Mar-07 3:32 
GeneralTHEORY! Portable .net apps Pin
joejoeiscool20-Mar-07 21:28
joejoeiscool20-Mar-07 21:28 
GeneralRe: THEORY! Portable .net apps Pin
Adadurov21-Mar-07 1:42
Adadurov21-Mar-07 1:42 
QuestionGridview template column for password Pin
DarkByte.PoD20-Mar-07 6:53
DarkByte.PoD20-Mar-07 6:53 
AnswerRe: Gridview template column for password Pin
Dave Kreskowiak20-Mar-07 16:31
mveDave Kreskowiak20-Mar-07 16:31 
GeneralRe: Gridview template column for password Pin
DarkByte.PoD21-Mar-07 3:21
DarkByte.PoD21-Mar-07 3:21 
GeneralRe: Gridview template column for password Pin
Dave Kreskowiak21-Mar-07 3:29
mveDave Kreskowiak21-Mar-07 3:29 
GeneralRe: Gridview template column for password Pin
DarkByte.PoD21-Mar-07 3:35
DarkByte.PoD21-Mar-07 3:35 
GeneralRe: Gridview template column for password Pin
Dave Kreskowiak21-Mar-07 4:30
mveDave Kreskowiak21-Mar-07 4:30 
GeneralRe: Gridview template column for password Pin
DarkByte.PoD21-Mar-07 5:03
DarkByte.PoD21-Mar-07 5:03 

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.