Click here to Skip to main content
15,901,122 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionwriting a string to a text file Pin
moonraker92825-Jul-07 14:09
moonraker92825-Jul-07 14:09 
AnswerRe: writing a string to a text file Pin
Mark Salsbery25-Jul-07 14:23
Mark Salsbery25-Jul-07 14:23 
GeneralRe: writing a string to a text file Pin
Stephen Hewitt25-Jul-07 18:03
Stephen Hewitt25-Jul-07 18:03 
GeneralRe: writing a string to a text file Pin
Mark Salsbery25-Jul-07 18:41
Mark Salsbery25-Jul-07 18:41 
AnswerRe: writing a string to a text file Pin
User 58385225-Jul-07 19:00
User 58385225-Jul-07 19:00 
GeneralRe: writing a string to a text file Pin
cp987625-Jul-07 19:16
cp987625-Jul-07 19:16 
GeneralRe: writing a string to a text file Pin
User 58385225-Jul-07 19:37
User 58385225-Jul-07 19:37 
Questionpassing vars in PostMessage (wParam, lParam) Pin
john john mackey25-Jul-07 14:08
john john mackey25-Jul-07 14:08 
I am having a more-than-momentary lapse of reason... I want to use the PostMessage( ) function to pass a window handle (CWnd) from one app to another.

In the caller, i have something like this:
   CWnd   hWnd;
// assign hWnd to current window handle (dialog app/dialog-based app window)

   static CWnd *pWnd;
   pWnd = FindWindow("RecvApp",0);
   pWnd->PostMessage(WM_CONNECT_APP, hWnd, 1);

In the receiver application ("RecvApp"):
   // in a header definition file
   CWnd   *pWnd_Caller;

// in MainFrame.cpp - main frame for "RecvApp"

   ON_MESSAGE(WM_CONNECT_APP, OnMakeConnection)

   LRESULT CMainFrame::OnMakeConnect(WPARAM wParam, LPARAM lParam)
   {
      // wParam is the handle to the caller's window/dialog-window

      if (lParam == 1)
         m_View->PostMessage(WM_CONNECT_APP, wParam, lParam);

   }

// in "RecvAppView.cpp" - view frame for "RecvApp"
   // somewhere in a message mapped function, I want to use wParam (hWnd) as
         wParam->PostMessage(WM_ADD_ENTITY, 0, 0);


I want to use the window handle of the caller to post a message back to itself based upon parameters gathered in the receiver app...
(caller) PostMessage (to receiver)

(receiver) assign values, do its stuff...
(receiver) PostMessage (to caller - new values)


In short, I need to know how to pass and use/dereference (etc...) the CWnd handle I am passing around.

Thanks.
Johnny
AnswerRe: passing vars in PostMessage (wParam, lParam) Pin
Mark Salsbery25-Jul-07 14:20
Mark Salsbery25-Jul-07 14:20 
AnswerRe: passing vars in PostMessage (wParam, lParam) Pin
ThatsAlok25-Jul-07 20:07
ThatsAlok25-Jul-07 20:07 
Questionbuffer Pin
dellthinker25-Jul-07 13:51
dellthinker25-Jul-07 13:51 
QuestionRe: buffer Pin
Mark Salsbery25-Jul-07 14:09
Mark Salsbery25-Jul-07 14:09 
AnswerRe: buffer Pin
ThatsAlok25-Jul-07 20:09
ThatsAlok25-Jul-07 20:09 
AnswerRe: buffer Pin
Karismatic25-Jul-07 20:59
Karismatic25-Jul-07 20:59 
QuestionConversion to hexa Pin
AAKAra25-Jul-07 8:33
AAKAra25-Jul-07 8:33 
AnswerRe: Conversion to hexa Pin
Mark Salsbery25-Jul-07 9:47
Mark Salsbery25-Jul-07 9:47 
AnswerRe: Conversion to hexa Pin
Mark Salsbery25-Jul-07 19:02
Mark Salsbery25-Jul-07 19:02 
QuestionODBC connection going bad -- what to do? Pin
Robin Hilliard25-Jul-07 7:21
Robin Hilliard25-Jul-07 7:21 
AnswerRe: ODBC connection going bad -- what to do? Pin
cmk25-Jul-07 13:04
cmk25-Jul-07 13:04 
GeneralRe: ODBC connection going bad -- what to do? Pin
Robin Hilliard25-Jul-07 13:53
Robin Hilliard25-Jul-07 13:53 
QuestionWhy does not Command Prompt window have WndProc ? Pin
Ky Nam25-Jul-07 7:04
Ky Nam25-Jul-07 7:04 
AnswerRe: Why does not Command Prompt window have WndProc ? Pin
Jonathan [Darka]25-Jul-07 7:08
professionalJonathan [Darka]25-Jul-07 7:08 
GeneralRe: Why does not Command Prompt window have WndProc ? Pin
Ky Nam25-Jul-07 15:02
Ky Nam25-Jul-07 15:02 
QuestionVideo via Positional Data Pin
Andy20225-Jul-07 5:17
Andy20225-Jul-07 5:17 
QuestionIs there any built in separator control in MFC? Pin
Mushtaque Nizamani25-Jul-07 4:23
Mushtaque Nizamani25-Jul-07 4:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.