Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to Add a Control
Message
De
07/08/2006 12:35:59
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01142753
Message ID:
01143499
Vues:
13
Sergey --

Thank you for the reply. This did not directly solve the problem of accessing the dll type library, but it did get me started in finding a solution.

The type library has interfaces which can be viewed in the Object Browser. This gives the GUID of the interfaces. According to the VFP help for CREATEOBECTEX, the third parameter would be this value of the GUID. I kept getting an error in trying to create an object instance (interface not valid). Also, the GUID the Object Browser showed for the type library would not create an instance of the library -- a search in the registry gave the type library GUID linked to another GUID (this one would allow an object to be created). But still the interface could not be accessed for the associated methods/properties.

However, the Object Browser did show the internal name of the Type Library -- XCATCOM. The dll file name is MDMCOM.DLL. A search in the registry under the HKEY_CLASSES_ROOT for XCATCOM gave the list of the interfaces for the type library -- XCATCOM.Catalog, XCatCOM.CatalogStatus, etc. Now I used the command:
loCat = CREATEOBJECT("XCATCOM.Catalog")
Alternatively, you can use the CREATEOBJECTEX command with the GUID, but the GUID in the Object Browser is not correct for accessing the catalog object (it is the interface GUID). Again looking in the registry gives the registry key, CLSID value. This can then be used:
loCat = CREATEOBJECTEX("{9BCE6D99-43AB-11D4-AE4E-00AA00BD8FAD}","")
And now I am able to access the methods and properties of the Catalog interface. This would then be repeated for each interface. I don't think there is a benefit to using the ..EX version over the "normal" version -- the help file indicates that the CREATEOBJECTEX is for accessing a remote server which is not the case for me since the activex type lib is installed on the local PC.

Basically, this seems to be the solution for accessing type library active-x interfaces. So a little digging in the registry gives the solution. (I had been looking into trying to create an active-x wrapper in VB6 -- but that was looking to be a major work in accessing each of the methods/properties.)

>See if Re: Metalib 5.0 SDK 3rd party dll problem Message #1143476 can help.

>>I have an Active X that is a type library. In Visual Basic 6 these are added to a project via the menu path:
>>
>>Project -> Reference...
>>
>>This brings up a dialog and the dll can be added via the "Browse..." command button and then "checked" in the Availabile References list. This then adds the library commands to the project.
>>
>>How can this be done in VFP9 -- is it possible to create an instance of the type library? From a test VB6 project, I have the following added to the .vbp file:
>>
>>Reference=*\G{9BCE6D54-43AB-11D4-AE4E-00AA00BD8FAD}#1.0#0#..\..\Program Files\SAP MDM 5.5\COM\MDMCom.dll#MDMCOM 2.0 Type Library
>>
>>(all in a single line). Can the GUID be used somehow to create an object? Thanks.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform