Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Content Management (Extended ECM)
API, SDK, REST and Web Services
Visual Basic Wrapper for LAPI
Dave_Sawyer_(dsawyer_(Delete)_2254029)
Greetings,Let me start by saying ... "Sorry for the long post." I think this information may be helpful for some and when you reach your ropes end it never hurts to ask for help. So here I go...I am coding a VB wrapper for LAPI for several projects which I have that need to interface with LiveLink. We are using LL 8.1.5 with VB6. Here is a simple breakdown of our goal:Convert existing Win32/16 applications to Intranet hosted applications using a mixture of ASP, VB/COM, and Citrix (for Win32). Some of these applications need to integrate with LiveLink through this new environment.Here is what I have done:- Created VB class wrappers for: LAPI (general), Workspaces, and RecArrays- Built a test VB application to access, enumerate, create, and remove objects from LiveLinkAll of this works great (finally after several weeks of frustration)!! So I took it to the next level. The main interface for our new application is our Intranet and therefor is hosted on IIS4(NTServer 4 sp 6) so I need to create a MTS DLL for the LiveLink classes. So I:- Removed the private classes from my test project- Created a new ActiveX DLL project and added all of the - required lapi*.bas files - LAPI wrapper classes (*.cls) - custom LAPI main module with some global functions I created- Compiled and registered the DLL in MTS- Modified my test project to reference the newly created DLL instead of the now missing local classesEverything worked great the first time!!!!! I could allocate the session, connect to EWS and PWS, and enumerate all objects within each workspace. Then I tried to add a new Document ........ BOOM!!The file for upload could not be located. Simply registering the component in MTS to run in the client process solved this problem ... yeah! So then I tried to create a new folder ........ BOOM!!I did not get an error this time ... instead our good friend Dr. Watson came to visit me :-(While debugging this error I noticed it was failing on the LL_ValueSetAssoc(assocNewItem) statement. Since the AddDocument method does not *require* object properties sent as specifically type Assoc it did not fail.More testing seems to indicate that the only LL_* function that fails is LL_ValueSetAssoc()! So I:- made all of the classes private to my test project- removed references to the DLL- changed references to use local classes- executed the projectShazaam!! It worked ... hmmm ...So ... I guess my question, comment, insanity is: "Why does it work as private classes in a project but not as a compiled DLL?" This is especially puzzling to me since the LL_ValueSetAssoc() call is not even located in my wrapper DLL!!I would greatly appreciate ANY assistance, comments, suggestions, critisisms, or sympathy I can get...Thanks in advance ... and happy LAPI to all!!----------Dave Sawyerdhsawyer@broadband.att.com
Find more posts tagged with
Comments
Dave_Sawyer_(dsawyer_(Delete)_2254029)
I received an e-mail response to this post that ended up being the solution. Just wanted to share it with the rest of the group to help save some headaches.Thanks to David Russell for supplying the answer!==================================================Saw your post on Opentext LAPI forum. I've written my own VB6 wrapper for LAPI too - last year, though, so bear with me ! I suspect your problem isn't anything to do with it being private/dll/whatever, it SOUNDS like you haven't called the SetAssocInArgs API function to initialise your Assoc before passing it to the LAPI API call. This will result in code that works "sometimes" depending on what's in memory ! The documentation probably says you don't need to worry about setting the type, but I definitiely remember it causing me problems on something ! LL_ValueSetAssocInArgsThis function sets the type of a value object to Assoc and assigns LL_NOTSET as the default value.C Function PrototypeLLSTATUS LL_ValueSetAssocInArgs( LLVALUE value );Visual Basic PrototypeLong LL_ValueSetAssocInArgs( _ ByVal value as Long )Input Parametersvalue the allocated value object on which to operate Output ParametersNone RemarksThe value object passed to this function can be of any type. The LL_ValueSetAssoc function changes the type to Assoc and disassociates any previous contents.The LL_ValueSetAssocInArgs function establishes a default value (LL_NOTSET) for the Assoc that is returned if an invalid field name is specified. It is useful to create an Assoc using this function when the Assoc will be used as an input argument. If the input Assoc value object does not contain every field in the database table being updated, an Undefined value will overwrite the object's previous field value unless the input Assoc value object was created using the LL_SetAssocInArgs function.