J'ai besoin d'aide
Fermé
vince
-
7 mars 2002 à 20:27
baheric Messages postés 5 Date d'inscription mardi 12 février 2002 Statut Membre Dernière intervention 30 décembre 2003 - 9 mars 2002 à 11:30
baheric Messages postés 5 Date d'inscription mardi 12 février 2002 Statut Membre Dernière intervention 30 décembre 2003 - 9 mars 2002 à 11:30
3 réponses
zebiloute
Messages postés
105
Date d'inscription
mardi 15 janvier 2002
Statut
Membre
Dernière intervention
14 avril 2005
4
7 mars 2002 à 22:38
7 mars 2002 à 22:38
Ben j'utilise depuis longtemps les port séries sous NT 4.0. Jamais eu de Pb, le passage de celui-ci sous Win 9X ne pose po non plus de Pb.
Donc je ne vois po ce qui cloche. Files ton code pour y jeter un cou p d'oeil si possible.
Quand ça veut Po ça veut po !!!
- Et ben y a plus qu'à attendre -
Donc je ne vois po ce qui cloche. Files ton code pour y jeter un cou p d'oeil si possible.
Quand ça veut Po ça veut po !!!
- Et ben y a plus qu'à attendre -
baheric
Messages postés
5
Date d'inscription
mardi 12 février 2002
Statut
Membre
Dernière intervention
30 décembre 2003
9 mars 2002 à 11:30
9 mars 2002 à 11:30
désolé vince je suis encore débutant en matière de programmation .mais je voudrais que tu puisse m'aider évoluer plus vite
8 mars 2002 à 22:06
je n'arrive pas a l'ouvrir sous windows nt
sous 98 ca marche
pour initialiser la communication j'utilise ca:
CString Config="2400,n,8,1";
BuildCommDCB(Config,&Block);
if (Port!=NULL) CloseHandle(Port);
Port=CreateFile("COM1",GENERIC_WRITE,0,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);
Block.ByteSize=8;
Block.Parity=NOPARITY;
Block.StopBits=ONESTOPBIT;
Block.DCBlength;
Block.fBinary=1;
Block.fParity=0;
Block.fOutxCtsFlow=0;
Block.fOutxDsrFlow=0;
Block.fDtrControl=0;
Block.fDsrSensitivity=0;
Block.fTXContinueOnXoff=0;
Block.fRtsControl=0;
SetCommState(Port,&Block);
alors si vous faites autrement et que ca marche ben je suis preneur
merci d'avance
9 mars 2002 à 11:03
Sinon je te file un petit bout de prog que j'ai retrouver chez moi (C'est un truc que g récupérer sur le net. Ca marche bien sous NT 4.0 avec le service pack 4, 5, 6 et visual 5.0 ou 6.0 pour info). Au boulout on fait ca avec des completions (Plus compliquer).
C'est une fonction utiliser dans une Dll donc te formalise po trop sur le dllAcces.
{
if ((hCom = CreateFile(TRIO2_COM,
GENERIC_READ | GENERIC_WRITE,
0,
NULL,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL,
NULL)) == INVALID_HANDLE_VALUE)
goto end;
if (GetCommState(hCom, &dcb) != TRUE)
{
goto end;
}
dcb.BaudRate = CBR_38400;
dcb.fBinary = TRUE;
dcb.fParity = FALSE;
dcb.fOutxCtsFlow = FALSE;
dcb.fOutxDsrFlow = FALSE;
dcb.fDsrSensitivity = FALSE;
dcb.fOutX = FALSE;
dcb.fInX = FALSE;
dcb.fNull = FALSE;
dcb.ByteSize = 7;
dcb.Parity = EVENPARITY;
dcb.StopBits = TWOSTOPBITS;
ctmo.ReadTotalTimeoutConstant=5;
SetCommTimeouts(hCom, &ctmo);
if ( (PurgeComm(hCom, PURGE_TXABORT | PURGE_RXABORT | PURGE_TXCLEAR | PURGE_RXCLEAR) != TRUE) ||
(SetCommTimeouts(hCom, &ctmo) != TRUE))
goto end;
if (SetCommState(hCom, &dcb) != TRUE)
{
goto end;
}
end:
if (PurgeComm(hCom, PURGE_RXCLEAR) == TRUE)
{
CtxStId[0]->Ctx->Machine.hCom2 = hCom;
ControleMotionTrio(CtxStId);
return(FALSE);
}
else
return(TRUE);
}
PS : Qu'est ce qui se passes exactement avec ton prog ?? Parceque là je vois po trop ce qui déconne !
Quand ça veut Po ça veut po !!!
- Et ben y a plus qu'à attendre -