Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Controls
  New Posts New Posts RSS Feed - TaskDialog with C++
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

TaskDialog with C++

 Post Reply Post Reply
Author
Message
AndreasM View Drop Down
Newbie
Newbie


Joined: 25 August 2008
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndreasM Quote  Post ReplyReply Direct Link To This Post Topic: TaskDialog with C++
    Posted: 26 August 2008 at 10:36am
Hi,
this topic is quite similar to may other topic (TaskDialog with JScript) as I get the same errors: I'm trying to use the ActiveX TaskDialog with C++ (code see below). creating the dispatch interface works but calling any method or setting any property throws a COleException with m_sc = -2147418113

Does anyone has examples how to use the TaskDialog ActiveX from C++?
Yes, I know that there's an MFC-Version but we purchased the ActiveX version to use the control with different programming languages...

Any sample code or tip is appreciated!
Thanks, Andreas

___________________________________________________

    CDTaskDialog TaskDlg;

    try
    {
        TaskDlg.CreateDispatch(L"Codejock.TaskDialog.12.0.1");
        TaskDlg.SetWindowTitle(L"Test");
        TaskDlg.ShowDialog();
    }
    catch(CException* e)
    {
        if(e)
        {
            e->ReportError();
            e->Delete();
        }
    }
}

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 26 August 2008 at 12:00pm
Hi,
 
Please attach project to test. Maybe forgot AfxOleInit() or something...
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
AndreasM View Drop Down
Newbie
Newbie


Joined: 25 August 2008
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndreasM Quote  Post ReplyReply Direct Link To This Post Posted: 27 August 2008 at 3:47am
Hi,
I made a small C++ MFC sample with VC 2005 (Version 8.0.50727.762 SP.050727-7600), of course with AfxOleInit()
You can find the source below. The effect is the same as with JScript:
CreateDispatch works and loads the .ocx into the process, but the rest not...

Maybe I forgot some other stuff? Some C++ samples would be very helpful here!

Best regards, Andreas


uploads/20080827_034412_ControlTest.zip
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 08 September 2008 at 6:49am
Hi,
 
Here sample project. It only use TaskDialog from 12.1 beta :( so you need change GUIDs.
 
 
 
Basic idea is to put TaskDialog to dialog  as ActiveX and let VisualStudio generate headers.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
AndreasM View Drop Down
Newbie
Newbie


Joined: 25 August 2008
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndreasM Quote  Post ReplyReply Direct Link To This Post Posted: 08 September 2008 at 9:36am
Hi Oleg,

basically this sounds good.
But I still have some problems here (when I try it in a new project):

- I insert an ActiveX Control to my dialog -> 'XTreme TaskDialog Control' -> Fine!

- But then I want to add a dialog variable ('Add Variable...') to trigger the generation of the wrapper class -> VisualStudio reports an error 'The Extender Provider failed to return an Extender for this object'

With other ActiveX Controls (e.g. Adobe PDF reader) I've got no problems here, the wrapper class gets generated!

By the way, I posted another task to this forum: TaskDialog with JScript -> maybe you've some hints here, too??

Thank you very much for your assistance,
Andreas
Back to Top
AndreasM View Drop Down
Newbie
Newbie


Joined: 25 August 2008
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndreasM Quote  Post ReplyReply Direct Link To This Post Posted: 15 September 2008 at 10:12am
Hi Oleg,

problem has gone as we gave back the ActiveX version and purchased the MFC-version....

Best regards, Andreas
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.203 seconds.