Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Translate VB COM code to VFP
Message
 
 
À
11/09/2003 14:20:28
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00828256
Message ID:
00828785
Vues:
13
Hi Quinn,

I think you're on right track. The Getinterface() allows to get refrerence to the interface of already instantiated COM object and that isn't the case here.

>I am trying to recreate this VB code in VFP but I am having trouble getting it to work. The COM interface I am trying to use is ArcObjects by ESRI and it is early binding.
>
>Dim pPropset As IPropertySet
>Set pPropset = New PropertySet
>
>Dim pFact As IWorkspaceFactory
>Dim pWorkspace As IWorkspace
>
>With pPropset
>.SetProperty "Server", "testserver"
>.SetProperty "Instance", "sdemss"
>.SetProperty "Database", "sde" ' Ignored with ArcSDE for Oracle
>.SetProperty "user", "sde"
>.SetProperty "password", "go"
>.SetProperty "version", "sde.DEFAULT"
>End With
>
>Set pFact = New SdeWorkspaceFactory
>Set pWorkspace = pFact.Open(pPropset, Me.hWnd)
>
>Dim pFeatureWorkspace As IFeatureWorkspace
>Set pFeatureWorkspace = pWorkspace
>
>Dim pFeatureClass As IFeatureClass
>Set pFeatureClass = pFeatureWorkspace.OpenFeatureClass("parcels")
>
>Here is what I have tried so far. I don't know if it is right but it worked. I am wondering if Getinterface would work better?
>
>lowsf = CREATEOBJECTex('esriCore.SdeWorkSpaceFactory','','{F173FC16-D63A-11D1-AA81-00C04FA33A15}')
>
>loPropset = CREATEOBJECTEX('esriCore.PropertySet','','{F0BA6ABC-8E9F-11D0-B4AB-0000F8037368}')
>
>lopropset.SetProperty("Server", "ifgis")
>lopropset.SetProperty("Instance", "esri_sde")
>lopropset.SetProperty("Database", "Woodlands")
>lopropset.SetProperty("User", "sde")
>lopropset.SetProperty("Password", "sde")
>lopropset.SetProperty("Version", "sde.DEFAULT")
>
>Thanks
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform