Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: DENNIS JONES
  Where is DENNIS JONES?
 salina
 Kansas - United States
 DENNIS JONES
 To: Andy Kramek
  Where is Andy Kramek?
 Hot Springs Village
 Arkansas - United States
 Andy Kramek
 Tags
Subject: RE: Call DLL IN VFP
Thread ID: 153655 Message ID: 155026 # Views: 4 # Ratings: 0
Version: Visual FoxPro 9 Category: Classes and Objects
Date: Friday, December 21, 2007 11:53:54 PM         
   


> > But, that's the whole point! Any 32 bit dll which exposes a public interface can be converted to a Foxpro class which Implements the dll's functions. My topic dealt with a third party license manager, but the basic idea would work equally well with other COM objects.
>
> I understand what you are saying. The issue is that it will only work if the DLL in question is an Automation Server (i.e. implements iDispatch and iUnknown). If the DLL is not built that way, then your technique will not work because IMPLEMENTS relies on accessing the Type Library and if the DLL is not created as an automation server it will not have exposed a type library.
>
> If the DLL is an automation server, then VFP can also instatniate it directly using CREATEOBJECT().
>
> Regards
> Andy Kramek
> Microsoft MVP (Visual FoxPro)
> Tightline Computers Inc, Akron Ohio, USA

IDispatch and IUnknown are methods present in all COM objects, yet It has been my experience that CreateObject() often fails with controls which work fine in VB6. While the Declare statement along with CreateObjectEx does work with Microsoft API's, it requires knowledge about the dll's methods and parameters ahead of time.

The class generated by dragging and dropping an interface from the Object Broswer is in fact doing something unique. Perhaps it is early binding to the control, whatever, it lets me get on with life instead of fussing over how to code a Delcare statement which may not be appropriate for the control anyway.

ENTIRE THREAD

Call DLL IN VFP Posted by Paul Newman @ 12/6/2007 7:04:52 PM
RE: Call DLL IN VFP Posted by DENNIS JONES @ 12/20/2007 12:22:28 AM
RE: Call DLL IN VFP Posted by Andy Kramek @ 12/20/2007 12:06:21 PM
RE: Call DLL IN VFP Posted by DENNIS JONES @ 12/20/2007 8:04:41 PM
RE: Call DLL IN VFP Posted by Andy Kramek @ 12/20/2007 9:38:33 PM
RE: Call DLL IN VFP Posted by DENNIS JONES @ 12/21/2007 12:40:19 AM
RE: Call DLL IN VFP Posted by Andy Kramek @ 12/21/2007 12:48:10 PM
RE: Call DLL IN VFP Posted by DENNIS JONES @ 12/21/2007 11:53:54 PM
RE: Call DLL IN VFP Posted by Andy Kramek @ 12/22/2007 11:40:09 AM