Click here to Skip to main content
15,910,980 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Error in Release build (Shift Operator) Pin
David Crow21-Jan-08 3:36
David Crow21-Jan-08 3:36 
GeneralRe: Error in Release build (Shift Operator) Pin
Alexander M.,21-Jan-08 3:42
Alexander M.,21-Jan-08 3:42 
GeneralRe: Error in Release build (Shift Operator): is it actually a C++ compiler bug? Pin
CPallini21-Jan-08 4:04
mveCPallini21-Jan-08 4:04 
GeneralRe: Error in Release build (Shift Operator) Pin
CPallini21-Jan-08 5:04
mveCPallini21-Jan-08 5:04 
GeneralAnti keylogger Pin
Eikthrynir21-Jan-08 3:05
Eikthrynir21-Jan-08 3:05 
GeneralRe: Anti keylogger Pin
Alexander M.,21-Jan-08 3:39
Alexander M.,21-Jan-08 3:39 
GeneralRe: Anti keylogger [modified] Pin
Eikthrynir21-Jan-08 3:45
Eikthrynir21-Jan-08 3:45 
QuestionCPropertySheet PressButton does not work Pin
linton samuel dawson21-Jan-08 2:12
linton samuel dawson21-Jan-08 2:12 
Urgent help required.
Tons of experience yet unable to see where I go wrong with this one.

Got a CPropertySheet in wizard mode.

One of its pages is scanning the serial ports for a device and for this I elected to use a callback method so that this process is kept asynchronously.

Obviously when this page receives the callback it's (possibly/likely) on another thread so I cast one of the callbacks parameter to the instance and post a user defined message to it, like so:

/*static*/ void CCommsPage::NotifyAPC(unsigned nId, bool bResult, void* pParam)<br />
{<br />
    CWnd* pThis = reinterpret_cast<cwnd*>(pParam);<br />
<br />
    if (pThis > NULL)<br />
    {<br />
        pThis->PostMessage(WM_NOTIFY_CB, nId, bResult); // WM_NOTIFY_CB = WM_USER+1<br />
    }<br />
}</cwnd*>


When this message is processed by the page I am indeed back on the thread that the port scan was initiated from.

Yet when I then get this page to instruct the wizard to progress to the next page, like so:

<br />
// called via OnWndMsg(WM_NOTIFY_CB,...)<br />
CCommsPage::OnCallBackConnect(bool bSuccess)<br />
{<br />
    if (bSuccess)<br />
    {<br />
        ...<br />
<br />
#ifdef _DEBUG<br />
        CPropertySheet* pSheet = dynamic_cast<cpropertysheet*>(GetParent());<br />
        ASSERT(pSheet > NULL);<br />
#else<br />
        CPropertySheet* pSheet = static_cast<cpropertysheet*>(GetParent());<br />
#endif<br />
<br />
        pSheet->PressButton(PSWIZB_NEXT);<br />
        ...<br />
    }<br />
}</cpropertysheet*></cpropertysheet*>



The wizard boms out completely when CPropertySheet::PressButton() is invoked.

If I replace the call to PressButton() with...

pSheet->SetWizardButtons(PSWIZB_BACK | PSWIZB_NEXT);

Then the "Next" button is enabled and when I manually click on that button then the wizard does go on to the next page.

That - however - is not an ideal solution and I really want the wizard to progress programmatically.

I've googled and googled and cannot find any article that has the answers that I look for.
I am sure that someone must have had a similar experience. Either that or I am making such a basic mistake that I should reconsider this career.

Someone please help. Cry | :((
QuestionRe: CPropertySheet PressButton does not work Pin
David Crow21-Jan-08 3:04
David Crow21-Jan-08 3:04 
AnswerRe: CPropertySheet PressButton does not work Pin
linton samuel dawson21-Jan-08 3:08
linton samuel dawson21-Jan-08 3:08 
QuestionRe: CPropertySheet PressButton does not work Pin
David Crow21-Jan-08 3:47
David Crow21-Jan-08 3:47 
AnswerRe: CPropertySheet PressButton does not work Pin
linton samuel dawson21-Jan-08 4:08
linton samuel dawson21-Jan-08 4:08 
GeneralRe: CPropertySheet PressButton does not work Pin
linton samuel dawson21-Jan-08 4:53
linton samuel dawson21-Jan-08 4:53 
GeneralRe: CPropertySheet PressButton does not work Pin
KarstenK21-Jan-08 3:59
mveKarstenK21-Jan-08 3:59 
AnswerRe: CPropertySheet PressButton does not work Pin
linton samuel dawson21-Jan-08 4:01
linton samuel dawson21-Jan-08 4:01 
GeneralDos windows invisible Pin
tom groezer21-Jan-08 1:30
tom groezer21-Jan-08 1:30 
GeneralRe: Dos windows invisible Pin
JudyL_MD21-Jan-08 2:01
JudyL_MD21-Jan-08 2:01 
GeneralRe: Dos windows invisible Pin
tom groezer21-Jan-08 16:08
tom groezer21-Jan-08 16:08 
GeneralRe: Dos windows invisible Pin
JudyL_MD22-Jan-08 2:36
JudyL_MD22-Jan-08 2:36 
GeneralRe: Dos windows invisible Pin
Rajesh R Subramanian21-Jan-08 21:29
professionalRajesh R Subramanian21-Jan-08 21:29 
GeneralUpdating source control status...Nightmare Pin
AbbyIndian21-Jan-08 0:40
AbbyIndian21-Jan-08 0:40 
GeneralRe: Updating source control status...Nightmare Pin
MrdavidOgle25-Feb-11 14:18
MrdavidOgle25-Feb-11 14:18 
GeneralReading .reg file. Pin
neha.agarwal2720-Jan-08 21:26
neha.agarwal2720-Jan-08 21:26 
GeneralRe: Reading .reg file. Pin
jhwurmbach20-Jan-08 21:46
jhwurmbach20-Jan-08 21:46 
GeneralRe: Reading .reg file. Pin
neha.agarwal2720-Jan-08 23:00
neha.agarwal2720-Jan-08 23:00 

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.