Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using DLLs with modeless (non-modal) dialog

Status
Not open for further replies.

jpgarcia

Programmer
May 27, 2004
2
ES
I have made a DLL with creates a modeless dialog, I have to call it from a program made with LabView, but I think the matter is with any kind of "parent program". The matter is, when I create the modeless dialog, I think I have to create de modeless window with:

m_nonmodal->Create(CMyDlg::IDD,AfxGetMainWnd());

And I put to a edit control, to see if it gets something, with:

m_nonmodal->m_texto=(LPTSTR)AfxGetMainWnd();

But, how can I do to exchange data between the modeless and the parent?
 
with messages

Ion Filipski
1c.bmp
 
I have been trying to exchange data doing it with messages, *I've tried things as making a emitter and receiver program, both exes:

1.- Create my own window message using GUID in emiterDlg.cpp:
const UINT wm_Message =
RegisterWindowMessage(_T("CC667211-7CE9-40c5-809A-1DA48E4014C4"));

2.- And now with an event I send it to the window processor?

void CmemisorDlg::OnBnClickedButton1()
{
::postMessage(HWND_BROADCAST,wm_Message,(WPARAM)hwnd,0);
}

But I dont know if the messages are only possible for the same program, or can exchange data between diferent programs.

And I have to put in the receiver:

1.- the same of the wm_Message definition

2.- in the message map receiverDlg.h, add

afx_msg void MyReceiverFunction(I dont know what parameters)

3.- and in receiverDlg.cpp, I know I have to use or GetMessage or PeekMessage, and put something like:

void MyReceiverFunction(I dont know what parameters)
{
if(PeekMessage(wm_Message,NULL,0,0,PM_NOREMOVE))
{
//Do Something
}

}


 
you can use
1. files
2. shared memory
3. pipes
4. Unix or TCP sockets
5. DDE
6. COM
as well as any network protocols

Ion Filipski
1c.bmp
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top