FoxPro Programming
How to create a class library
Gravatar is a globally recognized avatar based on your email address. How to create a class library
  Govinda Berrio
  All
  Nov 22, 2019 @ 10:47am

Hello,

I'm trying to create a VFP class library similar to the shareware applications created by Mr. Strahl (ie. wwClient.app).

Specifically I'm trying to create a class lib, that uses wwClient, in which I've subclassed the wwJsonServiceClient.

Here's the basic setup of my project:

* main.prg
DO ('WestWindTools\wwclient.app')
SET PROCEDURE TO merlinapi, models ADDIT

* merlinapi.prg
DEFINE CLASS MerlinApi as wwJsonServiceClient
...
ENDDEFINE

Then I build -- Build Action: Application -- merlinapi.app.

But when I try to use it, I get an error: "Cannot load 32-bit DLL wwipstuff.dll"

DO merlinapi.app
api = CREATEOBJECT('MerlinApi')
api.GetMachines()

Does anyone have any tips or advice that would help me get this working?

Thank You, Govinda

Gravatar is a globally recognized avatar based on your email address. re: How to create a class library
  Govinda Berrio
  Govinda Berrio
  Nov 22, 2019 @ 10:59am

Nevermind. Looks like I just needed to add the WestWindTools folder to the PATH (ie. SET PATH TO ... ADDIT) in my calling program.

Gravatar is a globally recognized avatar based on your email address. re: How to create a class library
  Rick Strahl
  Govinda Berrio
  Nov 23, 2019 @ 11:41am

Hi Govinda,

Yes, you have to make sure that the program files (in the registered version), the compiled app (shareware version) and the dependent DLL files (wwipstuff, wwdotnetbridge etc) either are in your path or you copy the files into your distribution application folder.

The Client Tools are meant to be compiled and distributed with your application, so once you've registered you get the source code and then you can compile the FoxPro dependencies right into your application. The DLL(s) do need to be distributed with your application as loose files.

I always recommend copying the files to your project folder just so it doesn't get forgotten when an application gets distributed, causing runtime failures.

Hope this helps,

+++ Rick ---

© 1996-2024