Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Eric den Doop
  Where is Eric den Doop?
 Houten
 Netherlands
 Eric den Doop
 To: Iuliu Nedelcu
  Where is Iuliu Nedelcu?
 Buzau
 Romania
 Iuliu Nedelcu
 Tags
Subject: RE: Registerin ActiveX controls
Thread ID: 33647 Message ID: 33655 # Views: 2 # Ratings: 0
Version: Visual FoxPro 6 Category: Active X Controls & OLE Automation
Date: Monday, December 01, 2003 2:17:29 PM         
   


> I have tried REGSVR32 mscomctl.ocx
> I have restarted the computer
> Not working : the same invitation to "Open *.ocx" and after this it comes the error "OLE error code 0x80040154: Class not registered. OLE object is being ignored. Record number 6."
>
> I am using "VFP6->Tools->Wizard->Setup" to create the distribution package.
>
> The same program is working good on a PC with VFP6 installed.
>
> Iuliu(54)
>

I think you're installing a different version of the Common Controls library than the one you're using in your app. There are two versions of the control library (and even more file versions but that's another story). The two control libary versions are not "binary compatible". In other words, if you're using the 6.0 version in your app and you're installing the 5.0 version on the target machine, then your program will not work. Your VFP code however can be compatible with both versions. What you need to do now is to identify the version of the OCX you're using in your app. If you're using the 5.0 version, I advise you to upgrade your source code to the 6.0 version. You can identify the version you're using this way:

- open a form/class that has the control
- open the property sheet and locate the OleClass property
- pass the value of the OleClass to the following function to retrieve the OCX file from the registry
?GetLibraryFile("MSComctlLib.TreeCtrl.2") && Treeview control of the Windows Common Controls 6.0 library
 
FUNCTION GetLibraryFile
 LPARAMETER tcOleClass
 LOCAL lnRetval, lnHandle, lcBuffer, lcSubKey, lcRetval
 #DEFINE HKEY_CLASSES_ROOT 0x80000000
 #DEFINE SECURITY_ACCESS_MASK 983103
 #DEFINE REG_SZ 1
 DECLARE INTEGER RegOpenKeyEx IN Win32API ;
  INTEGER nKey, STRING @cSubKey, INTEGER nReserved,;
  INTEGER nAccessMask, INTEGER @nResult
 DECLARE INTEGER RegQueryValueEx IN Win32API ;
  INTEGER nKey, STRING cValueName, INTEGER nReserved,;
  INTEGER @nType, STRING @cBuffer, INTEGER @nBufferSize
 DECLARE INTEGER RegCloseKey IN Win32API ;
  INTEGER nKey
 lnRetval = 0
 lnHandle = 0
 lcBuffer = SPACE(255) + CHR(0)
 lcSubKey = tcOleClass + "\Clsid"
 RegOpenKeyEx(HKEY_CLASSES_ROOT, @lcSubKey, 0, SECURITY_ACCESS_MASK, @lnHandle)
 RegQueryValueEx(lnHandle, "", 0, REG_SZ, @lcBuffer, LEN(lcBuffer))
 RegCloseKey(lnHandle)
 * retrieve the ClsID value of the class from the Registry
 lcRetval = ALLTRIM(STRTRAN(LEFT(lcBuffer, AT(CHR(0), lcBuffer)), CHR(0), ""))
 IF NOT EMPTY(lcRetval)
  lnHandle = 0
  lcBuffer = SPACE(255) + CHR(0)
  lcSubKey = "CLSID\" + lcRetval + "\InprocServer32"
  RegOpenKeyEx(HKEY_CLASSES_ROOT, @lcSubKey, 0, SECURITY_ACCESS_MASK, @lnHandle)
  RegQueryValueEx(lnHandle, "", 0, 0, @lcBuffer, LEN(lcBuffer))
  RegCloseKey(lnHandle)
  * retrieve class lib file name
  lcRetval = ALLTRIM(STRTRAN(LEFT(lcBuffer, AT(CHR(0), lcBuffer)), CHR(0), ""))
 ELSE
  lcRetval = "error: class not found in registry"
 ENDIF
 RETURN lcRetval
ENDFUNC

Good luck.
--
Eric den Doop
www.foxite.com - The Home Of The Visual FoxPro Experts

ENTIRE THREAD

Registerin ActiveX controls Posted by Iuliu Nedelcu @ 12/1/2003 12:23:44 PM
RE: Registerin ActiveX controls Posted by Eric den Doop @ 12/1/2003 1:26:41 PM
RE: Registerin ActiveX controls Posted by Iuliu Nedelcu @ 12/1/2003 2:09:50 PM
RE: Registerin ActiveX controls Posted by Eric den Doop @ 12/1/2003 2:17:29 PM
RE: Registerg in ActiveX controls (Victory) Posted by Iuliu Nedelcu @ 12/1/2003 2:58:29 PM