Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Declare DDL, VB to VFP?

Status
Not open for further replies.

flintstone42

Programmer
Aug 7, 2001
52
US
Hi:
I am the follwoing statemnt for a VB program for calling a
COM object
(It say in the documentation that createobject will not work, I must use api?)

Private Declare Function GetEngineObject Lib "FREngine.dll" (engineObj As FREngine.Engine) As Long
Private Declare Function DeinitializeEngine Lib "FREngine.dll" () As Long

when I try
declare oengine as "Frengine.dll"
engine=oengine()
I get a cannot load FRENGINE.DLL

The aboce statements work fine in VB
Any ides?
 
First are you sure you have FRENGINE.DLL installed and registered on your machine? I don't seem to be able to find it a standard Win98 SE or Win NT 4.0 SP6a machine.

Next, you'll probably need to know the structure of the Engine Object to get anything useful from this .DLL.

Rick
 
Yes, I have frengine.tlb (typelib) that will
tell me (trhough object and class browser) what is
inside the frengine.dll, the frengine.tlb is registered
in windows. I think the question here is how to get vfp
to see a type library(.tlb) I heard you mgiht be able to do it in vfp 7.0 Any ideas?
 
Try, It says in the documentation (The is abby finereader engine) that you cannot register the frengine.dll

· ABBYY FineReader 5.0 Engine will not register itself as COM server.
This means that Engine object can't be obtained using CreateObject
or CoCreateInstance call. Applications should use APIs exported from FREngine.dll.

how do you do this in vfp?
 
Try:

Declare LONG GetEngineObject IN FREngine.dll STRING @
Declare LONG DeinitializeEngine IN FREngine.dll

lcStruct = "" && or maybe SPACE(200)
lnResult = GetEngineObject(@lcStruct)

Note: lcStruct may need to be chr(0) terminated or even intialized to all chr(0)'s for however bit it's expected to be. You may be able t figure this out from the information in the documentation or the TLB file.

Yes, 7.0 might be better to handle this, but I really have had much time to "play" with it yet.

Rick
 
Thanks for the posting. Unforately I get
"Cannot load 32-bit dll frengine.dll"
I get the same erro if I give it a file name that is
not there.

I can access it throught Visual Basic(VB) so
I gues that means it is registered in windows and is
working properly.

Thanks, Want to try again?
 
AFAIK, you cant do this in VFP6. However, I cant speak for VFP7.

Read the comments in FoxPro and APIs
thread184-52479

If you still need to use this API with VFP6 (since you appear to be familiar with VB), create a simple VB ActiveX dll that can facilitate the calls to the API DLL. Instantiate this object in VFP. Jon Hawkins
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top