Print Page | Close Window

Taskdialog without an Form

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=13109
Printed Date: 22 November 2024 at 1:54pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Taskdialog without an Form
Posted By: Herbie
Subject: Taskdialog without an Form
Date 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



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



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


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



Posted By: Herbie
Date Posted: 12 January 2009 at 3:12am
Hi together!


Thanks a Lot!
I works fine. 

Best Regards from Germany
Frank



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