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

.NET (Core and Framework)

 
QuestionRemoting with a Windows Service as a component host Pin
pezi_pink26-Mar-07 4:20
pezi_pink26-Mar-07 4:20 
QuestionEncoding StreamReader in C# Compact Framework Pin
vonLochow26-Mar-07 2:34
vonLochow26-Mar-07 2:34 
QuestionGenerating MS Project File Pin
fulbright25-Mar-07 20:45
fulbright25-Mar-07 20:45 
QuestionBook on Plugin-Technology? Pin
Tomerland25-Mar-07 19:42
Tomerland25-Mar-07 19:42 
AnswerRe: Book on Plugin-Technology? Pin
Pete O'Hanlon27-Mar-07 1:14
mvePete O'Hanlon27-Mar-07 1:14 
QuestionStyle / customize the .NET Treeview Control (vertical spaces between nodes) Pin
jnkurz024-Mar-07 7:57
jnkurz024-Mar-07 7:57 
AnswerRe: Style / customize the .NET Treeview Control (vertical spaces between nodes) Pin
Christian Graus24-Mar-07 8:06
protectorChristian Graus24-Mar-07 8:06 
QuestionRe: Style / customize the .NET Treeview Control (vertical spaces between nodes) [modified] Pin
jnkurz025-Mar-07 1:32
jnkurz025-Mar-07 1:32 
QuestionNeed help with forms Pin
thesad24-Mar-07 1:01
thesad24-Mar-07 1:01 
AnswerRe: Need help with forms Pin
Christian Graus24-Mar-07 7:59
protectorChristian Graus24-Mar-07 7:59 
GeneralRe: Need help with forms Pin
thesad24-Mar-07 8:45
thesad24-Mar-07 8:45 
GeneralRe: Need help with forms Pin
Christian Graus24-Mar-07 13:19
protectorChristian Graus24-Mar-07 13:19 
Question.NET-BroadcastEventWindow - No Disk Pin
gmarian23-Mar-07 19:32
gmarian23-Mar-07 19:32 
AnswerRe: .NET-BroadcastEventWindow - No Disk Pin
Luc Pattyn24-Mar-07 2:20
sitebuilderLuc Pattyn24-Mar-07 2:20 
GeneralRe: .NET-BroadcastEventWindow - No Disk Pin
gmarian24-Mar-07 3:07
gmarian24-Mar-07 3:07 
Question.NET cannot find mfc42.lib?? Pin
Wheatbread22-Mar-07 11:35
Wheatbread22-Mar-07 11:35 
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 

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.