J'ai besoin d'aide
vince
-
baheric Messages postés 5 Statut Membre -
baheric Messages postés 5 Statut Membre -
salut
je cherche a savoir ce qu'il fo faire ou inclure dans un programme visual c++ pour contourner la securite sur le port serie sur un pc tournant sur un windows noyau nt
mon prg marche parfaitement sous 98 mais pas sous nt
on m'a dit qu'il etait question de dll a inclure mais je ne sais pas lesquelles
je suis preneur de toute idee sur le sujet
merci d'avance
je cherche a savoir ce qu'il fo faire ou inclure dans un programme visual c++ pour contourner la securite sur le port serie sur un pc tournant sur un windows noyau nt
mon prg marche parfaitement sous 98 mais pas sous nt
on m'a dit qu'il etait question de dll a inclure mais je ne sais pas lesquelles
je suis preneur de toute idee sur le sujet
merci d'avance
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
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 -