Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Controls
  New Posts New Posts RSS Feed - Taskdialog without an Form
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Taskdialog without an Form

 Post Reply Post Reply
Author
Message
Herbie View Drop Down
Newbie
Newbie
Avatar

Joined: 14 July 2008
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote Herbie Quote  Post ReplyReply Direct Link To This Post Topic: Taskdialog without an Form
    Posted: 08 January 2009 at 5:36am
Hi together!

Is it possible to use an TaskDialog without an Control an a Form in an DLL?

Thanks and Best Regards

Frank
Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 09 January 2009 at 10:53am
This appears to work:

1) Start VB6 and create a new ActiveX DLL project.
2) Click the project menu, and then click References.
3) Click the Browse button.
4) Navigate to the Codejock OCX folder (%programfiles%\Codejock Software\ActiveX\Xtreme SuitePro ActiveX vXXX\Bin\).
5) From the "Files of type" list, select "ActiveX Controls (*.OCX)".
6) Select the "Codejock.Controls.Unicode.vXXX" or "Codejock.Controls.vXXX" OCX (the choice depends on your Unicode requirements), and then click Open.
7) Click OK.

Now add the following code to your DLL class:


Public Sub ShowTaskDialog()
   Dim lo_Dialog As XtremeSuiteControls.TaskDialog
  
   Set lo_Dialog = New XtremeSuiteControls.TaskDialog
   lo_Dialog.ShowDialog
End Sub


Compile & Reference your DLL in another project, and then create an instance of your class and call ShowTaskDialog. The Task Dialog will appear. You can then add properties to control the dialog appearance as required.

NOTE: Due to a bug in the VB6 IDE, the next time you go to the project references screen, you will NOT see the XtremeSuite Controls reference selected, even though it IS selected. You can confurm that it is selected by trying to select the reference again (You will get a name conflicts with existing project or llibrary error).

Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6

Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 09 January 2009 at 2:28pm
Hi,
 
Jason: What would be the advantage of using a DLL? Do I still have to register XtremeSuiteControls.ocx ?? If you still have to, you can better use:
 
Dim td
Set td = CreateObject("Codejock.TaskDialog.12.1.0")
      td.MainInstructionText = "This is a test"
      td.ShowDialog
 
I don't need control on form, just create it on the fly...
 
Thanks
 
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....
Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 09 January 2009 at 2:38pm
Hi Aaron,

I guess the advantage of putting the TaskDialog code in your own ActiveX DLL would be that you could add special/custom behaviour that could then be shared across all of your projects (that reference the DLL). For example, perhaps you always want to have the same Markup appear on part of the TaskDialog...You code it once in your DLL and then many projects can use that same look without any dupicated code.

The reason I chose the Project menu > References method instead of CreateObject is that my method is Early Bound instead of Late Bound, which is faster (although how much of a difference you would notice on a modern processor, I am not sure). It also has the benefit of keeping the IDE Intellisense working, whereas your Dim td (as variant or as object) method does not. If you aren't the type to find Intellisense useful (some people don't), then this may not be a benefit.

I also use the Project > References method instead of Project > Components because if the Project > Properties > Make tab > Remove information about unused ActiveX controls option is selected (which it is by default), then I *think* this causes problems with the compiled executable since the control doesn't appear on any forms (so the reference will be removed, and the code won't work). I actually haven't confirmed this in a long, long time, so my memory may be faulty here, and it might not actually be a problem.
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6

Back to Top
Herbie View Drop Down
Newbie
Newbie
Avatar

Joined: 14 July 2008
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote Herbie Quote  Post ReplyReply Direct Link To This Post Posted: 12 January 2009 at 3:12am
Hi together!


Thanks a Lot!
I works fine. 

Best Regards from Germany
Frank
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.