OVH Cloud OVH Cloud

traduction code c++ -> Windev

2 réponses
Avatar
Raphaël Gasser
voila ce que jai trouvé chez microsoft...

EM_GETLINE
The EM_GETLINE message is sent by an application to an edit control to
retrieve a line of text from an edit control. The wParam parameter specifies
the line number to retrieve. The first line of the edit control is line 0.
Single-line edit controls always return the first line because that is all
they have. The lParam parameter points to where the line will be copied.
When an application sends this message, it must first place the maximum
number of bytes that the buffer can receive into the first WORD of the
buffer.

The edit control returns the number of bytes actually copied or zero if the
line number specified by the wParam parameter is greater than the number of
lines in the edit control.

The copied line does not contain a null-termination character.

For example:

unsigned char szBuf[128];
WORD cbText;

*(WORD *)szBuf = sizeof(szBuf); /* Sets the buffer size. */
cbText = (WORD) SendDlgItemMessage(hdlg, ID_MYEDITCONTROL,
EM_GETLINE,
0, /* Line number. */
(DWORD) (LPSTR) szBuf); /* Buffer address. */
szBuf[cbText] = '\0'; /* Null-terminates the line. */


mais je n'arrive pas à le traduire en windev

merci pour votre aide

2 réponses

Avatar
SP&B
> For example:

unsigned char szBuf[128];
WORD cbText;

*(WORD *)szBuf = sizeof(szBuf); /* Sets the buffer size. */
cbText = (WORD) SendDlgItemMessage(hdlg, ID_MYEDITCONTROL,
EM_GETLINE,
0, /* Line number. */
(DWORD) (LPSTR) szBuf); /* Buffer address. */
szBuf[cbText] = ''; /* Null-terminates the line. */


mais je n'arrive pas à le traduire en windev

merci pour votre aide





Bonjour,

Le code équivalent en WD
RetourFonction est un entier
hDlg est un entier
nIDDlgItem est un entier
Msg est un entier sans signe
wParam est un entier
lParam est un entier

RetourFonction=API("USER32","SendDlgItemMessageA",hDlg,nIDDlgItem,Msg,wParam
,lParam)

A vous d'affecter des valeurs aux variables.

Pour plus d'informations, voir :
http://search.microsoft.com/search/results.aspx?View=msdn&p=1&s=0&c=4&st=a&qu=SendDlgItemMessage&na0

Sincères salutations
--
Jean-Claude FLAJOULOT
Sécurité, Pointage & Biométrie


enlever _no.spam pour me contacter en PV.
Avatar
Raphaël Gasser
merci pour votre aide mais ca ne marche toujours pas...

unsigned char szBuf[128] je pense que ca doit etre = szBuf est une chaîne
ASCIIZ sur 128 ???
*(WORD *)szBuf = sizeof(szBuf); /* Sets the buffer size. */ ( LA
JE RAME )


hDlg désigne le numéro de la fenètre = handle(Nom_de_ma_fenetre)
nIDDlgItem désigne le numéro d'identifiant de l'objet (comment je le
trouve ???)
Msg désigne la numéro du message = em_getline = 0xC4
wParam désigne le numéro de la ligne de ma zone d'édition multiligne que je
veut lire (la pas de probl...)
lParam = (DWORD) (LPSTR) szBuf (la gros prob ????)


"SP&B" a écrit dans le message de
news:blq2vq$qte$

> For example:
>
> unsigned char szBuf[128];
> WORD cbText;
>
> *(WORD *)szBuf = sizeof(szBuf); /* Sets the buffer size. */
> cbText = (WORD) SendDlgItemMessage(hdlg, ID_MYEDITCONTROL,
> EM_GETLINE,
> 0, /* Line number. */
> (DWORD) (LPSTR) szBuf); /* Buffer address. */
> szBuf[cbText] = ''; /* Null-terminates the line. */
>
>
> mais je n'arrive pas à le traduire en windev
>
> merci pour votre aide
>
>

Bonjour,

Le code équivalent en WD
RetourFonction est un entier
hDlg est un entier
nIDDlgItem est un entier
Msg est un entier sans signe
wParam est un entier
lParam est un entier




RetourFonction=API("USER32","SendDlgItemMessageA",hDlg,nIDDlgItem,Msg,wParam
,lParam)

A vous d'affecter des valeurs aux variables.

Pour plus d'informations, voir :



http://search.microsoft.com/search/results.aspx?View=msdn&p=1&s=0&c=4&st=a&qu=SendDlgItemMessage&na0

Sincères salutations
--
Jean-Claude FLAJOULOT
Sécurité, Pointage & Biométrie


enlever _no.spam pour me contacter en PV.