begin process at 2012 05 29 14:09:47
  Trouver un code source :
 
dans
 
Accueil > Forum > 

C++ & C++ .NET

 > 

Divers

 > 

Débutant(e)

 > 

problème classe winnt.h


Derniers messages déposésPoser une question dans le forum ou lancer une discussion

problème classe winnt.h

jeudi 24 mai 2007 à 17:28:10 | problème classe winnt.h

totoscill

Bonjour,
J'ai un problème avec la classe winnt.h de windows:

J'essais d'ouvrir mon port série avec des fonction qui utilise DWORD.
Lorsque je compile:

d:\ni\code\testgps2\testgps2\testGPS.h(34) : error C2061: syntax error : identifier 'DWORD'

d:\ni\code\testgps2\testgps2\testGPS.h(36) : error C2061: syntax error : identifier 'DWORD'

Donc j'inclue dans mes fichier .h le fichier windef.h ou se trouve la definition de DWORD et lors de la compilation:

TestGPS.cpp

C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winnt.h(3857) : error C2146: syntax error : missing ';' before identifier 'ContextRecord'

C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winnt.h(3857) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winnt.h(3857) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winnt.h(8319) : error C2065: 'PCONTEXT' : undeclared identifier

C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winnt.h(8320) : error C2146: syntax error : missing ')' before identifier 'ContextRecord'

C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winnt.h(8320) : warning C4229: anachronism used : modifiers on data are ignored

C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winnt.h(8320) : error C2182: 'RtlCaptureContext' : illegal use of type 'void'

C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winnt.h(8320) : error C2491: 'RtlCaptureContext' : definition of dllimport data not allowed

C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winnt.h(8320) : error C2059: syntax error : ')'

C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winnt.h(9594) : error C3861: '__readfsdword': identifier not found


Des erreur dans le dossier winnt!!!!

Quelqu'un pourrait il m'aider à comprendre ce qui se passe.

voici les .h de mes deux fonctions:


CLASSE LSERIE:

#ifndef

LSERIE_H

#define

LSERIE_H

#include

<string>

#include

<windef.h>

using

namespace std;

 

class

LSerie

{

public

:

//------ CONSTRUCTOR ------

LSerie();

virtual ~LSerie();

//------ OPEN AND CONFIGURE ------

bool open(int numPort, long speedInBaud); //Open the serial port COM "numPort" at the speed "speedInBaud".

// bauds with and this adjustement : 8 bit / 1 stop bit / no parity).

// Return: true if success.

bool open(int numPort, long speedInBaud, //Open the serial port COM "numPort" at the speed "speedInBaud".

int nbBit, int parity, float nbStopBit); // bauds with and this adjustement : "nbBit" bit / "nbStopBit" stop bit / "parity").

// Return: true if success.

void closeCom(); //Close the serial port.

bool setTimeOut(DWORD ms); //Set the time-out for receive data. Return: true if success.

bool setSpeed(DWORD baudrate); //Set the speed in bauds. Return: true if success.

//------ SEND AND RECEIVE DATA ------

int sendData(DWORD lg, LPBYTE data); //Send table "data" of "lg" bytes. Return: number of bytes really sent.

int sendData(string* data); //Send string "data". Return: number of bytes really sent.

int receiveData(DWORD lg, LPBYTE data); //Receive table "data" who is limit at "lg" bytes. Return: number of bytes received.

int receiveData(string* data); //Receive string "data". Return: number of bytes received.

//------ READ AND WRITE THE STATE OF THE CONTROL LINE ------

bool setRts(bool val); // Set the state of RTS. Return: true if success.

bool setDtr(bool val); // Set the state of DTR. Return: true if success.

bool setTxd(bool val); // Set the state of TXD. Return: true if success.

bool getCts(); // Return: The state of CTS.

bool getDtr(); // Return: The state of DTR.

bool getRi(); // Return: The state of RI.

bool getCd(); // Return: The state of CD.

string getErrorMsg();

// Return: The error message generated by the last function.

private

:

HANDLE hcom;

//Fichier de sortie sur le port COM | The file stream use for acces to the serial port.

_COMMTIMEOUTS ct;

//={0,0,0,0,0}; //Config du Time Out | This variable contain the delay of the time-out.

DCB dcb;

//Config du Port | This object is use in order to configure the serial port.

int bufferSize;

};

#endif



CLASSE TESTGPS:

#ifndef

_TESTGPS_H

#define

_TESTGPS_H

#include

<time.h>

#include

"LSerie.h"

#include

<windef.h>

struct

TestGPS_NmeaFrameStr // GGA NMEA frame parameters (GPS)

{

double latDeg; //!< Latitude WSG84 Coordinates in degrees - decimal

double lngDeg; //!< Longitude WSG84 coordinates in degrees -decimal

char lngDir; //!< Longitude direction (E or W)

char latDir; //!< Lat. dir (N or S)

long utms; //!< Time (UTC)

double alt; //!< Altitude in meters

double Hd; //!< Heading of direction change frame

double AngVar; //!< Angular change

char DirVar; //!< Direction change

};

class

TestGPS

{

protected

:

TestGPS_NmeaFrameStr _lastFrame;

LSerie * _serialPort;

public

:

 

void TestGPS::open(int numPort, long speedInBaud, int nbBit, int parity, float nbStopBit);

void TestGPS::closeCom();

void TestGPS::setTimeOut(DWORD ms);

void TestGPS::setSpeed(DWORD baudrate)

void TestGPS::sendData(DWORD lg, LPBYTE data);

void TestGPS::LSerie::receiveData(DWORD lg, LPBYTE data);

long getTime(void);

double getLatDeg(void);

char getLatDir(void);

double getLngDeg(void);

char getLngDir(void);

double getAlt(void);

double getHd(void);

double getAngVar(void);

char getDirVar(void);

}

#endif



Je vous remercie.

jeudi 24 mai 2007 à 17:56:03 | Re : problème classe winnt.h

THEwarrior333


Il te manque un point-virgule apres la derniere accolade (celle de la classe)


Cette discussion est classée dans : void, error, return, of, testgps


Répondre à ce message

Sujets en rapport avec ce message

PROBLEME DE THREAD (CreateThread -->ERROR) [ par neub ] Salut à tous, j'ecris un module de visionnement d'image etje souhaiterai pouvoir stopper ma fonction OnPlay au moment voulu mais j'ai un pb a la creat Comment declarée la matrice matrix[x][y] [ par pirate75000 ] Comment declarée la matrice matrix[x][y]Le but est de remplir la matirce avec le Tableau Tabpuis effectuer une inversion video par matricepuis réécrit Probleme de string! [ par frdestroyers27 ] Bonjours a tous!j'ai un probleme que je n'arrive pas a resoudre et je ne trouve pas d'aide nul part pour ca! je vais mettre mon code en gros ca cherch Erreur Buildage ? [ par 24Karas ] salut,ben j'ai un projet avec des classes. Quand je compile ça marche mais quand je build j'obtient ces erreurs :Linking...nafxcwd.lib(afxmem.obj) : e Abus de "protected" dans les classes ? [ par Galmiza ] Salut cher lecteur,Voici un exemple de ce qu'on voit assez souvent dans les codes, mais dont je ne saisi pas l'utilité:Dans une classe, protection des connexion database [ par callaghan1981 ] j ai un petit problemeje me connecte a la base de donnee acces..mais il n arrete pas de me retourner un error comme quoi ADOje sais pas quoi est peut base de donne [ par bigNB ] bjr je doi realiser une connection a une base de donness.etan donne que j avais tres peu de temps j ai repris une source dun programmeurelle va correc Build Error avec Dev-Cpp + SDL [ par Rouliann ] Salut tout le monde!Alors voila le probleme, g tapé un code tt simple en C++ avec la SDL et le compilateur me dit : C:\Dev-Cpp\...\Makefile.win [Build Erreur avec enum [ par goutbouyo ] SAlut,J'essaie de compiler un code trouver sur le net :enum FrustumSide{ RIGHT = 0,  // The RIGHT side of the frustum LEFT = 1,  // The LEFT  side of [Performance] Passage par valeur | Passage vers pointeur [ par BIG_BOSS_001 ] Bonjour,Je me pose une petite question sur les performances entre le passage par valeur et par pointeur.Je sais que le premier reçoit par la pile une


Nos sponsors


Sondage...

Comparez les prix

CalendriCode

Mai 2012
LMMJVSD
 123456
78910111213
14151617181920
21222324252627
28293031   

Consulter la suite du CalendriCode

A découvrir



 
Développement réalisé par Nicolas SOREL (Nix) avec l'aide de : Cyril DURAND et Emmanuel (EBArtSoft), Merci à Vincent pour ses précieux conseils.
CodeS-SourceS.com© Toute reproduction même partielle est interdite sauf accord écrit du Webmaster
CodeS-SourceS.com© est une marque déposée tous droits réservés

Google Coop CodeS-SourceS Google Coop CodeS-SourceS
Temps d'éxécution de la page : 0,437 sec (3)

Nous contacter | Annoncer sur CodeS-SourceS | Mentions légales