Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do you register VFP classes 1

Status
Not open for further replies.

jerry1117

Programmer
Sep 29, 2003
20
US
I am using the _olecalendar class in the _datetime.vcx VFP class library in my application to provide a pop up calendar. I got the coding example from the samples. I have deployed the compiled app as an EXE to various locations.

The problem I have is on some workstations I get a class not registered error when I try to create the _olecalendar class. This does not happen when I am running the exe on a workstation that has VFP installed. How can I get the class registered on a workstation that does not have VFP installed?

Thanks.
 

Jerry,

You will need to know the name of the OCX file that contains the calendar class.

On the user's machine, open a command prompt and type:

REGSVR32.EXE xxx

where xxx is the path and name of the OCX.

Mike




__________________________________
Mike Lewis (Edinburgh, Scotland)

My sites:
Visual FoxPro (www.ml-consult.demon.co.uk)
Crystal Reports (www.ml-crystal.com)
 
Thanks Mike, but I am not using an OCX class. I am using a VCX Visual FoxPro class. Jerry
 
The _olecalendar class includes the MSComCtl2.MonthView.2 portion which is part of the mscomctl.ocx activex, which as Mike suggested needs to be registered with REGSVR32. You need to find the mscomctl.ocx on the system and register it.


Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
ReFox XI (www.mcrgsoftware.com)
 
i've run into this myself..

if you use the installshield express that comes with vfp7(?) and higher, from the objects/merge modules section, include the ms windows common controls module. i wasn't sure which to include, so i just added common controls-2(6.0) and -3(6.0), which seems to work.

maybe someone can shed some light on exactly which one is needed?

-- frank~
 
Hi Jerry,

The _oleCalendar foundation class is a wrapper for a Microsoft ActiveX control. If you open _oleCalendar class and look at its Property Sheet you will see its OleClass property value is "MSComCt2.Monthview.2" That tells you it is an instance of the Montview class in the MSComCt2 library. You can find its registered filename and location by inspecting the Monthview class in the Object Browser. Mine is "c:\windows\system32\mscomct2.ocx" It is MSComCt2.ocx that has to be registered on any machine using the _OleCalendar class.

pamela
 
I am encountering similar errors trying to use a TreeView & associated ImageList control. It works fine when I test a program inside VFP, but when I run it as a standalone .exe, the "Class not registered" error occurs. One additional aspect is that the .exe runs under an alternate login, using WinAPI functions "LogonUser" & "ImpersonateLoggedOnUser". Any suggestions?

Thanks,
Randy W.
 

Randy,

The solution is the same as the one I suggested to Jerry: use REGSVR32.EXE to register the class on the user's system.

The treeview and imagelist controls are both stored in the same OCX file, which is MSCOMCTL.OCX. So, to register the classes, run the following from a command prompt:

RESVR32.EXE <path>\MSCOMCTL.OCX

where <path> indicates the directory holding the above file.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My sites:
Visual FoxPro (www.ml-consult.demon.co.uk)
Crystal Reports (www.ml-crystal.com)
 
Mike,

Thanks for the response. The problem seems to be that the application, as logged on using "ImpersonateLoggedOnUser", can't recognize the Active X controls as being registered. If I skip the Logon, etc. API's, it all works; the controls actually are registered on my PC. However, switching to the alternate logon identity, the controls are apparently not registered for that situation (possibly, b/c the alternate logon doesn't access the local C:\Windows subdirectories.)

Randy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top