Print Page | Close Window

TaskDialog with C++

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Controls
Forum Description: Topics Related to Codejock Controls
URL: http://forum.codejock.com/forum_posts.asp?TID=11974
Printed Date: 16 November 2024 at 12:22pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: TaskDialog with C++
Posted By: AndreasM
Subject: TaskDialog with C++
Date 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();
        }
    }
}




Replies:
Posted By: Oleg
Date Posted: 26 August 2008 at 12:00pm
Hi,
 
Please attach project to test. Maybe forgot AfxOleInit() or something...


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: AndreasM
Date 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 - uploads/20080827_034412_ControlTest.zip


Posted By: Oleg
Date Posted: 08 September 2008 at 6:49am
Hi,
 
Here sample project. It only use TaskDialog from 12.1 beta :( so you need change GUIDs.
 
http://forum.codejock.com/uploads/20080908_064839_ControlTest2.zip - uploads/20080908_064839_ControlTest2.zip
 
 
Basic idea is to put TaskDialog to dialog  as ActiveX and let VisualStudio generate headers.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: AndreasM
Date 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


Posted By: AndreasM
Date 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



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net