Date Picker OCX control query

Forums for specific tips, techniques and example code
ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Date Picker OCX control query

Postby ConvertFromOldNGs » Fri Aug 07, 2009 2:13 pm

by Silver Springs ... >> Mon, 19 Apr 1999 5:24:58 GMT

Hi
I have a query on the use of a great "Date Picker" OCX that comes with Visual Basic (and maybe other M$ products) and is called MsComCt.ocx ?

In Date entry fields it provides for a popup calendar from which to select a date -- much better than getting the user to manually type in a date and having to check the syntax etc.

It works fine as long as the control it has been registered in the Painter via the 'Import Active X...'

But where it hasn't been registered in this way when a form making use of it is accessed it throws an exception about the unregistered control.

But how can I register it for use at a run-time deployed client ?

Does Jade provide a utility for doing the equivalent of registering an Active X control for each deployed client ?

p130 of the Developer's Reference Guide states that the control must be a self-registering control.

Does this mean that this OCX is not a self-registering control ----- because if it was then it would be picked up from either my
C:\WINNT\SYSTEM32 or the BIN sub-directory on the server where the deployed installation is running from ?

Mmmm...


Alan aka SilverSprings...

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Date Picker OCX control query

Postby ConvertFromOldNGs » Fri Aug 07, 2009 2:13 pm

by Craig Shearer >> Mon, 19 Apr 1999 10:40:07 GMT

Hi ho Silver

You need to use the Active-x registration utility that comes with Microsoft DevStudio (I think) called regsrv32.exe. At the commant line you would type:

regsvr32.exe MsComCt.ocx

and this should do the registration for you. Give it a go, and let us know how it goes.

Craig.

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Date Picker OCX control query

Postby ConvertFromOldNGs » Fri Aug 07, 2009 2:13 pm

by Silver Springs ... >> Tue, 20 Apr 1999 10:49:41 GMT

The MsComCt2.ocx Date Picker control is a self-registering control which according to the JADE help file means that it is one that can be used in JADE applications.

What self-registering means is that it has to be registered in a one off operation --- either by :

- registering it on a workstation that has the development environment and via the Painter "Import an Active X control " option off the File menu
- registering it on a workstation using the RegSvr32.EXE utility program supplied by NT
- registering it on a workstation by using an InstallShield install procedure that is configured to automatically call the RegSvr32 program

At all workstations you can register this in a one off operation by running the REGSVR32.EXE utility supplied by NT in the WINNT\SYSTEM32 directory. Use this by calling it with a single parameter detailing the drive/directory and full name of the DLL/OCX you want to register e.g.

From the command prompt you could type something like :

C:\WinNT\System32\RegSvr32 \\cnwakxz4\Cbspub\JACSDeploy\BIN\MsComCt2.ocx

Upon successful registration it comes up with a confirmatory dialogue to which you have to press OK.

What this means at a run-time deployed installation is that each workstation :

- needs a desktop icon or menu option setup to initiate the application
- the Active X control should be deposited in the applications BIN directory on the server and a command batch file could be distributed to be run at each workstation to call RegSvr32 to register the control
- anything else application-specific that needs to be setup e.g. Hlp files

this all works for me sweet as ....

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Date Picker OCX control query

Postby ConvertFromOldNGs » Fri Aug 07, 2009 2:13 pm

by Darrell Duniam >> Mon, 19 Apr 1999 20:53:03 GMT

Alan,

In the Cardinal BaseSchema there's a control called 'CnEcDateBox', which also provides a popup calendar from which to select a date (all in pure JADE). Talk to Nelson Lipinski if you want more info.

regards,
darrell.

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Date Picker OCX control query

Postby ConvertFromOldNGs » Fri Aug 07, 2009 2:13 pm

by Paul Mathews >> Tue, 20 Apr 1999 9:23:49 GMT

I was surprised how straightforward it was to write this in Jade, the initial version took 4 hours. Fast forwarding of dates is possible through holding down the left mouse button.

In CMSchema the Form CMDate is defined and can be tested in the
painter.

In CMBase this has been subclassed as shown below.
· CMDate
1. FCMDate
2. FCMDateTime
3. FCMDateTimeDuration
4. FCMStartAndEnd

There is also the form FCMTime.

I normally run them as Dialogs using the F2 Key, that way they are usefull from Tables as well,

In the next version of CMSchema, CMBase we will provide examples using these Forms.

Down load and use as you like.

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Date Picker OCX control query

Postby ConvertFromOldNGs » Fri Aug 07, 2009 2:13 pm

by Silver Springs ... >> Thu, 22 Apr 1999 3:32:50 GMT

I have been looking at Date Pickers and others seem, well shall we be charitable and call them "ugly" compared to this MickeySoft OCX (MsComCt2.OCX) I want to use as a Date Picker.

Much as I'd like to use a JADE control and ideally one should be provided simply as another 'type' of ComboBox --- in reality it ain't there (or I ain't come across it yet) with features and appearance that compare to MsComCt2.OCX.

Anyway as I intend to integrate this OCX into a live run-time deployed application I am happy to confirm that this one can be transparently registered if needbe at every workstation accessing the run-time deployed application.

To do this I :

- install a single copy of the OCX in the BIN directory of the application on the server
- in forms that make use of the control I ensure that a NormalException handler is invoked that can pick up a normal exception error code 14096 (OCX not registered for use...)
- when the user runs the new version of the application and doesn't have this control registered it triggers the NormalException routine upon creating the transient instance of the form.
- this then checks for exception code 14096 and calls the RegSvr32.EXE utility (supplied in both WinNT and Win95/98) using the app.createExternalProcess method and voila the OCX is registered on that workstation

Sweet as .....

SilverSprings....
athomson@cardinal.co.nz

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Date Picker OCX control query

Postby ConvertFromOldNGs » Fri Aug 07, 2009 2:13 pm

by Craig Shearer >> Thu, 22 Apr 1999 22:01:32 GMT

Congratulations Alan on not succumbing to the pressures of the NIH (Not invented here!) syndrome :-)

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Date Picker OCX control query

Postby ConvertFromOldNGs » Fri Aug 07, 2009 2:13 pm

by Silver Springs ... >> Mon, 26 Apr 1999 3:30:16 GMT

Problems encountered integrating the MsComCt2.OCX into a JADE form :

Licence problem
============
This great control is available from the Microsoft website (somewhere --- you'll need luck to locate it). You then have to have a M$ product like VB, Access etc loaded on a workstation in order to be able verified as licenced to use this control i.e. JADE's Painter will then allow you to "Add" the control into your schema via the "Import Active X control'

Tab order problem
==============
If you set the tab order on your controls on a form in Painter to be able to tab through the forms controls in logical sequence then when you come to execute that form and start pressing the Tab key that Jade BYPASSES the Date Picker controls completely!!!

Anyone know a workaround ?

Focus and Arrow keys problem
=======================
If you rest your focus on the Date Picker control when running the form then you can have focus set on the Day, Month or Year portions (say if you have it formatted in dd MMM yyyy format eg. 12 May 1999). But then when you press the Arrow keys the days, months or year all increment by a jump of TWO at a time. We've searched everywhere to see the setting to default it to one but can't find it !?!

Properties problem
==============
You cannot set the minDate and MaxDate properties in Painter on the control as it complains it cannot save these. I ain't tried setting these programmatically .... sigh

Other than that it works well ....

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Date Picker OCX control query

Postby ConvertFromOldNGs » Fri Aug 07, 2009 2:13 pm

by Silver Springs ... >> Mon, 26 Apr 1999 3:34:00 GMT

Also -- you can't set the control to be blank ie. have optional entry of a date. Most frustrating.

I currently disable instead -- but this still shows a default date of today in greyed out text. A blank entry would be preferable.

Setting the control invisible is a possibility -- but really its just the contents I don't want presented.

Ideas on a grey day?

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Date Picker OCX control query

Postby ConvertFromOldNGs » Fri Aug 07, 2009 2:13 pm

by BeeJay >> Tue, 27 Apr 1999 21:16:50 GMT

-- snip --
Tab order problem
==============
If you set the tab order on your controls on a form in Painter to be able to tab through the forms controls in logical sequence then when you come to execute that form and start pressing the Tab key that Jade BYPASSES the Date Picker controls completely!!!

Anyone know a workaround ?


Did you set tabstop = true in the properties in painter for this OCX control?
BeeJay.


Return to “Tips and Techniques”

Who is online

Users browsing this forum: No registered users and 20 guests