Deploying an application with MonthView

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Deploying an application with MonthView

Bill Dargel
It might have been a mistake, but I used MonthView in an application. By
the time I worked around the (Microsoft confirmed) bug where the control
steals mouse clicks from buttons in the window, and stretched things a
bit to get it to select a week from a single click, I probably would
have been better off to put together the functionality completely in
Smalltalk. Oh well. BTW, anyone have or know of a Smalltalk date picker
that's floating around?

But, barring changing the control, I've been trying to get the
installation of MonthView to work on a machine where the OCX hadn't been
installed due to VisualStudio being on the machine. Looking at the EULA
and redist.txt file that came with VisualStudio, mscomct2.ocx is listed
among the 'REDISTRIBUTABLE CODE - Extended Use' files. So it appears to
be okay to redistribute with an application given a VisualStudio
license.

Trying to figure out how to do it with Dolphin, rather than VisualBasic,
is the challenge.

I've included mscomct2.ocx in the install file that I made using
ClickTeam. It takes care of registering the ocx when it's installed.
That part seems okay, because I later confirmed that a VisualBasic
executable that uses the MonthView control could be dropped onto the
target machine and it runs fine.

But the Dolphin application gets a gpfault when it first tries to set a
#displayValue: into the MonthView. I fired up the development
environment on that machine and both the ViewComposer and the
ActiveXControlBrowser get '80040112 - Class is not licensed for use'.

I did some research and found
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon98/html/vbconlicensingissuesforolecontrols.asp
entitled "Licensing Issues for Controls". It's aimed at VisualBasic
developers, but seems to shed some light. From my understanding, a VB
executable that one might make will have the license keys for controls
used, compiled into it. It seems like I need to do the equivalent in
order to use the control from Dolphin? It looks like
MonthView>>licenseKey: may do what's needed, but is there any way to get
from VisualStudio what the key is supposed to be for mscomct2.ocx? I
tried all the values that I found in the registry under
HKEY_CLASSES_ROOT\Licenses on the machine that has VisualStudio
installed. But none of them worked, either as Strings or UnicodeStrings,
for getting back an IMonthView. Anyone know just what form the keys
passed to #licenseKey: should be in?

Any thoughts on how to get this going?

thanks,
-Bill

-------------------------------------------
Bill Dargel            [hidden email]
Shoshana Technologies
100 West Joy Road, Ann Arbor, MI 48105  USA


Reply | Threaded
Open this post in threaded view
|

Re: Deploying an application with MonthView

Blair McGlashan
"Bill Dargel" <[hidden email]> wrote in message
news:[hidden email]...
> It might have been a mistake, but I used MonthView in an application. By
> the time I worked around the (Microsoft confirmed) bug where the control
> steals mouse clicks from buttons in the window, and stretched things a
> bit to get it to select a week from a single click, I probably would
> have been better off to put together the functionality completely in
> Smalltalk. Oh well. BTW, anyone have or know of a Smalltalk date picker
> that's floating around?

We have a wrapper for the MonthCal common control for D6 which is actually
very similar to the MonthView OCX (probably the same thing in fact). Its not
entirely compatible with D5 because DateTimePicker has been refactored under
a common abstract superclass which it shares, but I'm sure you could press
it into service with a little work. If you need it let me know.

>
> But, barring changing the control, I've been trying to get the
> installation of MonthView to work on a machine where the OCX hadn't been
> installed due to VisualStudio being on the machine. Looking at the EULA
> and redist.txt file that came with VisualStudio, mscomct2.ocx is listed
> among the 'REDISTRIBUTABLE CODE - Extended Use' files. So it appears to
> be okay to redistribute with an application given a VisualStudio
> license.

Yes. Thats right. You can distribute it if you have a VS license.

> Trying to figure out how to do it with Dolphin, rather than VisualBasic,
> is the challenge.
>...snip
> I did some research and found
>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon98/htm
l/vbconlicensingissuesforolecontrols.asp
> entitled "Licensing Issues for Controls". It's aimed at VisualBasic
> developers, but seems to shed some light. From my understanding, a VB
> executable that one might make will have the license keys for controls
> used, compiled into it. It seems like I need to do the equivalent in
> order to use the control from Dolphin?

The same challenge would apply if you wanted to use it in, say, an MFC or
ATL C++ app:

http://support.microsoft.com/default.aspx?scid=KB;en-us;q151771

The license request applet described in this article is easily replaced by a
short Smalltalk expression (see below).

The following article may also help as background:

http://archive.devx.com/premier/mgznarch/vbpj/1998/10oct98/fb1098.pdf

Look for the section "Dynamic Control Creation and Late-Bound events" (p33),
and also (p34) "You Can't Add a Control Without a License".

>...It looks like
> MonthView>>licenseKey: may do what's needed, ....

Yup, you need a runtime license to paste into it:

>...but is there any way to get
> from VisualStudio what the key is supposed to be for mscomct2.ocx?

You should be able to get a valid runtime license key by running the
following on your development machine:

    pFactory := IClassFactory2 newPointer.
    OLELibrary default
        coGetClassObject: IMonthView clsid
        dwClsContext: IClassFactory ctxServer
        pServerInfo: nil
        riid: pFactory iid
        ppv: pFactory.
    licenseKey := pFactory requestLicenseKey

Or try the LICREQST.EXE applet, which gives the same result on my machine -
in this case a GUID, but I think it can be any arbitrary string.

>...

Do let me know how you get on, and we can think about how to provide some
support for this in the base system.

Regards

Blair


Reply | Threaded
Open this post in threaded view
|

Re: Deploying an application with MonthView

Bill Dargel
Blair McGlashan wrote:

> We have a wrapper for the MonthCal common control for D6
>   [snip]
> If you need it let me know.

Even though I've got it working now, it still might be good to eliminate the
need to distribute mscomct2.ocx. So, if it's not much trouble, I'd like to take
a look at what you have.

> You should be able to get a valid runtime license key by running the
> following on your development machine:
>
>     pFactory := IClassFactory2 newPointer.
>     OLELibrary default
>         coGetClassObject: IMonthView clsid
>         dwClsContext: IClassFactory ctxServer
>         pServerInfo: nil
>         riid: pFactory iid
>         ppv: pFactory.
>     licenseKey := pFactory requestLicenseKey

That's just the ticket! I was also able to get the same key from the VisualBasic
snippet that was given in the background article that you referenced.

> Do let me know how you get on, and we can think about how to provide some
> support for this in the base system.

Blair, as usual, your information's spot on! :-)

I simply put in an override for the MonthView>>licenseKey method, which answers
the string that the above snippet provided. Thus, "compiling" it into my
executable. Works for me -- so I'm off to slay other dragons.

thanks again,
-Bill

-------------------------------------------
Bill Dargel            [hidden email]
Shoshana Technologies
100 West Joy Road, Ann Arbor, MI 48105  USA