I am a total newbie at VC++ (I am a pathetic, lowly VB programmer). I am creating a program in VC++ to send some information via PostMessage to a program called MacroExpress (to tell it to run a specific macro, etc). When compiling, I get the postmessagea "function does not take 4 parameters" although postmessage does take 4.
Here's what I've got. If anyone could show me how this code would look when corrected, I would much appreciate it. Like I said, I'm a total newby, so explaining won't help as much as posting the same code in working order
There's probably a number of problems with it.
void CAboutDlg::OnButton1()
{
LPCTSTR S;
S = "TESTMACRO";
CWnd *pWnd = FindWindow( NULL , "Macro Express Player" );
HWND hWnd = pWnd->GetSafeHwnd();
int tt;
tt = WM_USER + 20;
int slen;
slen = strlen(S);
for (int x=0;x<slen;x++)
PostMessage(hWnd,tt,S[x],0);
PostMessage(hWnd,tt,0,0);
return;
}
That code causes compile errors for both postmessage lines:
error C2660: 'PostMessageA' : function does not take 4 parameters
error C2660: 'PostMessageA' : function does not take 4 parameters
Anyone who helps out will be much appreciated.
Here's what I've got. If anyone could show me how this code would look when corrected, I would much appreciate it. Like I said, I'm a total newby, so explaining won't help as much as posting the same code in working order
There's probably a number of problems with it.
void CAboutDlg::OnButton1()
{
LPCTSTR S;
S = "TESTMACRO";
CWnd *pWnd = FindWindow( NULL , "Macro Express Player" );
HWND hWnd = pWnd->GetSafeHwnd();
int tt;
tt = WM_USER + 20;
int slen;
slen = strlen(S);
for (int x=0;x<slen;x++)
PostMessage(hWnd,tt,S[x],0);
PostMessage(hWnd,tt,0,0);
return;
}
That code causes compile errors for both postmessage lines:
error C2660: 'PostMessageA' : function does not take 4 parameters
error C2660: 'PostMessageA' : function does not take 4 parameters
Anyone who helps out will be much appreciated.