Home > Software engineering >  The SendMessage () parameter problem
The SendMessage () parameter problem

Time:09-30

I made a little practice, want to use SendMessage () a CArray Parameter of type, how to do ah, MFC WPARAM and LPARAM is not familiar with, I find that I do half the time things are struggling with MFC type conversion...
And feel the MFC message to no QT's signals and slots mechanism flexible, not particularly adapt to use,

CodePudding user response:

Pointer to SendMessage after two parameters can be sent

CodePudding user response:

reference 1st floor xuddk727 response:
SendMessage after two parameters can send pointer

Hair is a pointer, but various newspaper always convert, exactly how the two parameters with ah,

CodePudding user response:

Check the MSDN window message

CodePudding user response:

Try;
: : SendMessage (HWND, WM_SETTEXT, 0, (LPARAM) (LPCSTR) symbols. GetAt (I));//symbols is CArray types, I is loop variable

Ps: I'm a novice, had better not ask ha,

CodePudding user response:

To CArray pointer casting into WPARAM
When receiving and cast a pointer to CArray

CodePudding user response:

SendMessage () can be achieved by lparam wparam mass data or a pointer, your data can be defined as a structure, then put the structure pointer through wparam or out lapram,

CodePudding user response:

: : SendMessage (HWND WM_CHAR, 1, 0);
Using the WM_CHAR system messages,
Through static variables, variable content is ok?

CodePudding user response:

Please those who like to pass from hand to hand an array as a function parameter or as a function return value code farmers think about why not pass from hand to hand the whole Internet content as a function parameter or return value as a function?

CodePudding user response:

Is generally passed all address, such as an int variable
Int n=10;
The SendMessage (XXX, (WPARAM) & amp; n, 0);

The receiver is
Int * p=(int *) wl;

PostMessage can not pass the address of the local variable

CodePudding user response:

Message passing parameters can only make a pointer
  • Related