Click here to Skip to main content
16,010,392 members
Home / Discussions / Mobile
   

Mobile

 
GeneralRe: Wizard Dialog again Pin
João Paulo Figueira23-Sep-03 9:14
professionalJoão Paulo Figueira23-Sep-03 9:14 
GeneralRe: Wizard Dialog again Pin
João Paulo Figueira23-Sep-03 10:49
professionalJoão Paulo Figueira23-Sep-03 10:49 
GeneralRe: Wizard Dialog again Pin
João Paulo Figueira23-Sep-03 11:24
professionalJoão Paulo Figueira23-Sep-03 11:24 
GeneralRe: Wizard Dialog again Pin
#realJSOP24-Sep-03 6:46
professional#realJSOP24-Sep-03 6:46 
GeneralRe: Wizard Dialog again Pin
João Paulo Figueira24-Sep-03 6:56
professionalJoão Paulo Figueira24-Sep-03 6:56 
GeneralDialog BOx Question Pin
CSharpDavid22-Sep-03 12:57
CSharpDavid22-Sep-03 12:57 
GeneralRe: Dialog BOx Question Pin
besmel22-Sep-03 20:08
besmel22-Sep-03 20:08 
GeneralRe: Dialog BOx Question Pin
Daniel Strigl22-Sep-03 20:15
Daniel Strigl22-Sep-03 20:15 
I do it the following way:
...

class CConnMsgDlg : public CDialog
{
    ...
    
// Implementation
protected:
	// Generated message map functions
	//{{AFX_MSG(CConnMsgDlg)
	virtual BOOL OnInitDialog();
        ...
	//}}AFX_MSG
    afx_msg LRESULT OnEnd(WPARAM wParam, LPARAM lParam);
    DECLARE_MESSAGE_MAP()
    
    ...

private:
    static const UINT MY_WM_END;
};

...

/////////////////////////////////////////////////////////////////////////////
// Message table

const UINT CConnMsgDlg::MY_WM_END =
    RegisterWindowMessage(_T("MY_WM_END-{29813B84-DD1E-11d7-9B13-0002B32C4875}"));

BEGIN_MESSAGE_MAP(CConnMsgDlg, CDialog)
	//{{AFX_MSG_MAP(CConnMsgDlg)
    ...
	//}}AFX_MSG_MAP
    ON_REGISTERED_MESSAGE(MY_WM_END, OnEnd)
END_MESSAGE_MAP()

BOOL CConnMsgDlg::OnInitDialog()
{
	CDialog::OnInitDialog();

	// TODO: Add extra initialization here

        // Create the thread and start it

	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

LRESULT CConnMsgDlg::OnEnd(WPARAM wParam, LPARAM lParam)
{
    EndDialog(wParam);

    return 0L;
}

void CConnMsgDlg::ThreadFnc()
{
    ...

    PostMessage(MY_WM_END, IDOK); // destroy the dialog
}


I have a dialog that starts a thread in the 'OnInitDialog' function.
The thread reads some data from the serial port. This can take a long
time, so I do it in a own thread. When the thread is ready it post
the message 'MY_WM_END', that I have registered in the message map.
The 'OnEnd' function closes the dialog with 'EndDialog'.

Cheers,
Daniel.
--
FIND A JOB YOU LOVE, AND YOU'LL NEVER HAVE TO WORK A DAY OF YOUR LIFE. Wink | ;)
General3d App under WindowsCE Pin
JWood22-Sep-03 12:41
JWood22-Sep-03 12:41 
GeneralRe: 3d App under WindowsCE Pin
Daniel Strigl22-Sep-03 20:04
Daniel Strigl22-Sep-03 20:04 
GeneralIncomming call problem Pin
Member 55831121-Sep-03 13:14
Member 55831121-Sep-03 13:14 
GeneralShockwave Flash Pin
Mahesh Varma18-Sep-03 1:25
Mahesh Varma18-Sep-03 1:25 
QuestionHow to control the backlight on/off or adjust the brightness Pin
Anonymous17-Sep-03 20:10
Anonymous17-Sep-03 20:10 
AnswerRe: How to control the backlight on/off or adjust the brightness Pin
Daniel Strigl18-Sep-03 0:29
Daniel Strigl18-Sep-03 0:29 
GeneralGPS Pin
Anonymous17-Sep-03 6:30
Anonymous17-Sep-03 6:30 
GeneralRe: GPS Pin
João Paulo Figueira17-Sep-03 7:28
professionalJoão Paulo Figueira17-Sep-03 7:28 
GeneralRe: GPS Pin
Daniel Strigl17-Sep-03 9:59
Daniel Strigl17-Sep-03 9:59 
GeneralSymbian DMA Pin
HalfWayMan17-Sep-03 4:31
HalfWayMan17-Sep-03 4:31 
Generalfingerprint reader Pin
ibiteu216-Sep-03 8:26
ibiteu216-Sep-03 8:26 
GeneralTesting mobile web form Pin
Weiye Chen16-Sep-03 3:45
Weiye Chen16-Sep-03 3:45 
Generalsql CE Pin
Roger Alsing15-Sep-03 23:26
Roger Alsing15-Sep-03 23:26 
Generalproblem with fscanf in Pocket PC Pin
villalbaja15-Sep-03 2:01
villalbaja15-Sep-03 2:01 
GeneralRe: problem with fscanf in Pocket PC Pin
Daniel Strigl15-Sep-03 20:27
Daniel Strigl15-Sep-03 20:27 
GeneralRe: problem with fscanf in Pocket PC Pin
villalbaja15-Sep-03 20:49
villalbaja15-Sep-03 20:49 
GeneralRe: problem with fscanf in Pocket PC Pin
Daniel Strigl15-Sep-03 22:37
Daniel Strigl15-Sep-03 22:37 

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.