How do I use the handle returned by pIProvTaskPage->GetPag..

G

Guest

Guest
Archived from groups: microsoft.public.msdn.general,microsoft.public.platformsdk.shell,microsoft.public.vc.mfc,microsoft.public.windowsnt.misc (More info?)

I'm really up against the wall here, any help at all would be wonderful.

I'm adding the Schedule and Settings pages to a wizard that is creating
Scheduled Task Items. The OnNext() handler on the first page of the wizard
calls NewWorkItem() to create the task and then pIProvTaskPage->GetPage() to
retrieve handles to the Schedule and Settings pages and finally adds those
pages to the wizard.

The added pages are displayed as expected but when I get to the final page
in the wizard, there are no triggers in the task object, even though I have
added some on the Schedule page.

Having created the work item with NewWorkItem(), should I be persisting it
before getting the dialog pages? I currently only call IPersistFile::Save()
at the end, in OnWizardFinish().

Should I be explicitely telling the Schedule and Settings pages to add their
settings to the new task? The documentation implies that this is done
automagically. If I do need to do this, how do I do it? GetPage() only gives
me a window handle, not an object I can interact with.

I've been staring at this problem for weeks now and its becoming a serious
headache with my deadlines.

--- Al.
 
G

Guest

Guest
Archived from groups: microsoft.public.msdn.general,microsoft.public.platformsdk.shell,microsoft.public.vc.mfc,microsoft.public.windowsnt.misc (More info?)

I seem to have found it...

Sadly, the first suggestion my boss made when he had a look at the
documentation seems to be depressingly right: the schedule pages do not seem
to save themselves to the task object when the user switches pages. They
seem do it when they recieve a PSN_APPLY notification message which I'm
guessing is when the wizard is closing (after the OnWizardFinished()). but I
was saving the task inside the OnWizardFinished rather than in the class
that invoked the wizard.

I have solved the problem by explicitly sending a PSN_APPLY notification
message to each page at the start of the final page's OnSetActive(). Forcing
the schedule pages to update the task here allows the final page to display
a summary of the task and its schedule. I then save the task within the
final page's OnWizardFinish().

Is this a rubbish solution? It seems to work but its probably not the Right
Way.

--- Al.

"TVR Fan" <nosuch@address.com> wrote in message
news:OxJ2n87GEHA.3664@TK2MSFTNGP12.phx.gbl...
> I'm really up against the wall here, any help at all would be wonderful.
>
> I'm adding the Schedule and Settings pages to a wizard that is creating
> Scheduled Task Items. The OnNext() handler on the first page of the wizard
> calls NewWorkItem() to create the task and then pIProvTaskPage->GetPage()
to
> retrieve handles to the Schedule and Settings pages and finally adds those
> pages to the wizard.
>
> The added pages are displayed as expected but when I get to the final page
> in the wizard, there are no triggers in the task object, even though I
have
> added some on the Schedule page.
>
> Having created the work item with NewWorkItem(), should I be persisting it
> before getting the dialog pages? I currently only call
IPersistFile::Save()
> at the end, in OnWizardFinish().
>
> Should I be explicitely telling the Schedule and Settings pages to add
their
> settings to the new task? The documentation implies that this is done
> automagically. If I do need to do this, how do I do it? GetPage() only
gives
> me a window handle, not an object I can interact with.
>
> I've been staring at this problem for weeks now and its becoming a serious
> headache with my deadlines.
>
> --- Al.
>
>
 
G

Guest

Guest
Archived from groups: microsoft.public.msdn.general,microsoft.public.platformsdk.shell,microsoft.public.vc.mfc,microsoft.public.windowsnt.misc (More info?)

I seem to have fond it...

Sadly, the first suggestion my boss made when he had a look at the
documentation seems to be depressingly right: the schedule pages do not seem
to save themselves to the task object when the user switches pages. They
seem do it when they recieve a PSN_APPLY notification message which I'm
guessing is when the wizard is closing (after the OnWizardFinished()). but I
was saving the task inside the OnWizardFinished rather than in the class
that invoked the wizard.

I have solved the problem by explicitly sending a PSN_APPLY notification
message to each page at the start of the final page's OnSetActive(). Forcing
the schedule pages to update the task here allows the final page to display
a summary of the task and its schedule. I then save the task within the
final page's OnWizardFinish().

Is this a rubbish solution? It seems to work but its probably not the Right
Way.

--- Al.

"TVR Fan" <nosuch@address.com> wrote in message
news:OxJ2n87GEHA.3664@TK2MSFTNGP12.phx.gbl...
> I'm really up against the wall here, any help at all would be wonderful.
>
> I'm adding the Schedule and Settings pages to a wizard that is creating
> Scheduled Task Items. The OnNext() handler on the first page of the wizard
> calls NewWorkItem() to create the task and then pIProvTaskPage->GetPage()
to
> retrieve handles to the Schedule and Settings pages and finally adds those
> pages to the wizard.
>
> The added pages are displayed as expected but when I get to the final page
> in the wizard, there are no triggers in the task object, even though I
have
> added some on the Schedule page.
>
> Having created the work item with NewWorkItem(), should I be persisting it
> before getting the dialog pages? I currently only call
IPersistFile::Save()
> at the end, in OnWizardFinish().
>
> Should I be explicitely telling the Schedule and Settings pages to add
their
> settings to the new task? The documentation implies that this is done
> automagically. If I do need to do this, how do I do it? GetPage() only
gives
> me a window handle, not an object I can interact with.
>
> I've been staring at this problem for weeks now and its becoming a serious
> headache with my deadlines.
>
> --- Al.
>
>