MSCAL.OCX troubles in Win XP

Started by Fred Harris, November 04, 2005, 01:14:45 PM

Previous topic - Next topic

Fred Harris

Is anyone using the Microsoft Calendar Control 8.0 (MSCAL.OCX) in any VB or FireFly projects running on Windows XP?  This control has been giving me grief in a number of different contexts for some time.  At this time I am having to support a Win 2000 setup and Win XP setup of a major application in my organization due to this problem (had to remove the control from XP version).  Using it in VB on an XP machine will actually crash the VB IDE.

Just tried it with FireFly installed on an XP machine with no better results.  I tried the \Samples\COM_ActiveX\Calendar project supplied with FireFly, which uses the above referenced control.  It compiles fine but crashes on startup.  Thanks in advance for any help you can give me with this.

Fred Harris
Pennsylvania

mikedoty

Why not replace it with version 9.0.0.3620 that came out in 2000?
Found the 8 version dated 1998.  Probably never tested with XP.

Fred Harris

Thats a good idea Mike.  I know this is a dumb question, but where can I get version 9 of the Calendar control?  I'm not even sure where the one came from that I'm using.  I have quite a few versions of Access and VB on all my computers.

Fred Harris

mikedoty

A google search.
The first hit http://www.fontstuff.com/mailbag/qvba01.htm
Versions  8.0.0.3432  9.0.0.2607 10.0.0.4024

Fred Harris

Mike,

    Thanks Mike!  I'm beginning to think this could be the source of the grief this control is giving me.  Gonna give it a try.

Fred Hrris
Shamokin Pennsylvania

Fred Harris

Still no luck.  Followed the Goggle link, downloaded, installed and registered (regsvr32) version 10 first on my XP machine, and having that one fail tried the 9 version.  

Firefly and VB6 will both compile an executable.  When you attempt to run it in Firefly you'll get the message  "Calendar using COM has encountered problems....  send report to Microsoft, etc..".  

When running p code in the VB6 IDE, or even an executable, the calendar seems to work now, which is an improvement.  However, if you try to rename the control in the properties window it takes the VB6 IDE down.

Probably some sort of COM/ActiveX versioning problem.  But far be it from me to figure it out.  When I used the RegSvr32 utility as directed in the Goggle link I couldn't help suspecting one had to unregister the version 8 OCX first.  Seems I saw an API function somewhere for doing that, but upon looking couldn't find it.  Then there's the issue of the type libraries.  The download didn't include a new Type Library.  One existed in my \System32 directory from the version 8 control.  However, the newer controls were bigger and Microsoft could have included the type library information in the component itself.  In any case VB eventually came up with the correct version in the 'Components' interface.  

Not sure where to go with this.  Keep trying or give up.  In my app at work I replaced the calendar on my XP version with a combo box.  However, the calendar is so much cooler!

Does anybody know if there is some kind of other calendar control I could get?  At this point I think I'd be willing to buy one.

Fred Harris
Shamokin, PA

TechSupport

It has been a long time since I used VB and RegSvr but I am pretty sure that you use the /u parameter to unregister an OCX.

regsvr32 /u {OCXname}

Jose Roca

Quote
Then there's the issue of the type libraries. The download didn't include a new Type Library. One existed in my \System32 directory from the version 8 control. However, the newer controls were bigger and Microsoft could have included the type library information in the component itself.
Microsoft broke binary compatibility in his version 10.0 of MSCAL that comes with Offixe XP. They added methods to support assigning Font objects by reference (putref) for the DayFont, GridFont and TitleFont properties, but they added them to the middle of the interface, thereby breaking binary compatibility by changing the layout of the ICalendar v-table. Microsoft has confirmed that this is a bug and blah, blah, blah, and suggest that you use late binding (of course you need to use the right typelib).
http://support.microsoft.com/default.aspx?scid=kb;en-us;311219

FarPoint has a Calendar OCX, but I haven't tried it:
http://www.fpoint.com/products/calendar/calendar.aspx

Fred Harris

Someone surely must have tried FireFly's Calendar COM project on XP.  Is mine the only one on which it doesn't work?  Tomorrow I'll try reloading the MSCAL.OCX from scratch in a new project.  Maybe that'll work.

Fred Harris
Shamokin, PA USA

mikedoty

It works fine.  It says:
"Microsoft Access Calendar Control Version 9.0" after
clicking on the about button.

Roger Garstang

Jose said V. 10 broke, so maybe you still have it on and need to unregister as suggested by Paul with the /u switch, which is correct, and be sure there isn't any trace of the control...perhaps by trying to run it, etc.  Then putting v. 9 on and seeing what happens.  Could also be a VS thing since you have it installed I gather from mention of VB.  I just ran the Calendar on mine and it runs fine...with version 10 that XP SP2 has.  So, either 10 was fixed, or with FF it doesn't have problems on mine.

mikedoty

Ran version 8, 9 and 10 without any problems.
Now using 10.0.0.4024 as the default.
Perhaps search for mscal.oca and delete them?

Fred Harris

Thanks a lot for the input on this!  Now I can concentrate on getting the files or registry cleaned up on my computer if I want to get that ActiveX control to work.

Fred Harris

The trick seemed to be to first first unregister the version 8 ocx with

regsvr32 C:\Winnt\system32\mscal.ocx /u

as stated by Paul, Mike and Roger.  Then delete all the support files for the ocx making sure to get the TypeLib cache (mscal.oca), which file, near as I can tell, is auto generated by the ocx either the first time it is run, or when it is registered.  Then register the version 9 file.

Now I've gotten the control to work with both FireFly and VB6 on XP!  Thanks again for the help.

One issue I'm not sure about is whether I was seeing the problem Jose alluded to concerning Microsoft's busting of their own rules about their sacrosanct immutable interfaces or not.  According to Jose's link to Microsoft's bug report, the problem shouldn't affect vb because of vb's so-called late binding, but were they referring to vb6 or vb.net?  I thought vb6 used early binding and vb.net late binding.  Or do I have that wrong.  Not sure.  FireFly early binds COM objects with Jose's code, doesn't it???