Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to use classes from an Accpac DLL?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01340203
Message ID:
01340276
Vues:
9
Chris,

See if you can use GETINTERFACE() function. .

>I wonder if anyone can help me make use of classes in a DLL library?
>
>I want to use the AccpacCOMAPI object, from the A4wcomex.dll, which has classes in it such as AccpacView, AccpacDBLink etc.
>
>I can open the DLL in the Object browser to get this information - the object browser displays the following information about the DLL, together with a list of classes, and lists of methods and properties. Unfortunately I can only seem to find the methods and properties of the object when using it...
>
>Library AccpacCOMAPI
>ACCPAC COM API Object 1.0
>File: C:\ACCPAC\AAS54A\PROGRAMS\RUNTIME\A4WCOMEX.DLL
>Help File: This library doesn't have an associated help file.
>GUID: {4E5368A1-A652-11D2-9B94-00104B71EB3F}
>
>My first problem was how to create the AccpacCOMAPI object in VFP. By looking at the registry I figured out that I needed to use Accpac.Session.1, that is the ProgID of the DLL in the registry:
>
>oSession = CREATEOBJECT("Accpac.Session.1")
>
>But now I have my object, it only shows me the methods and properties of the AccpacCOMAPI library, I don't know how to see or use the library's classes, apart from the fact I can view them in the Object browser. For instance, I want to use the class AccpacDBLink, but the closest I can get to using it is to type myLink = oSession.GetDBLink(DBLINK_COMPANY, DBLINK_FLG_READWRITE) - where DBLINK_COMPANY and DBLINK_FLG_READWRITE constants I have defined by looking at the enums of the object.
>
>Now GetDBLink is listed as a method of the class AccpacDBLink, therefore it is also a method of the AccpacCOMAPI library that I can see, and it works perfectly well for me to "bypass" the class and use this method directly, but I am coming unstuck when I want to use a class for which I cannot find a one-to-one relationship with one of the library's methods. I want to create a data object using the class AccpacView, but there is no single equivalent method of AccpacCOMAPI that I can figure out that returns this data object.
>
>So, why can I see classes in the object browser, but they don't appear as classes/methods of the instance of the library that I have created? What vital piece of information do I need to make use of the library object classes, not just it's methods?
>
>I have spent hours trying to figure this out, but I am stumped, and I may have to revert to using VB, where the classes are readily available...
>
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform