Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ZAP
Message
From
11/09/2000 10:51:13
 
 
To
08/09/2000 12:31:19
General information
Forum:
Visual Basic
Category:
Coding, syntax & commands
Title:
Re: ZAP
Miscellaneous
Thread ID:
00409714
Message ID:
00414906
Views:
23
>>Create a VFP dll using code like the code below.
>
>Joe -
>
>I am trying to do the same thing. I followed your advice and created a VFP dll. I tried to reference the dll but I received an error that "Can't add a reference to the specified file". It will allow me to add a reference to the tlb. That works great except when I create the install it doesn't work on the machine I installed too.
>
>I tried adding:
>
>Private Declare Function lib "c:\foxutil.dll" and that seems ok but when I run the program I get "Can't find the entry point" error.
>
>I'm new at creating dlls and using them in a vb program. Can you give me some direction on what I need to do to get this to work?
>
>Thanks,
>
>Nichole Brelje

Compile the VFP project code creating a com dll useing the code I gave you. Select compile all files, display all errors, and VFP will create and register what you need.

In VB under project/referances: Look for the FoxUtil entry

My VB code looks like this:
    Dim objFoxDBF As FoxUtil

    Set objFoxDBF = CreateObject("foxtool.foxutil")

    objFoxDBF.zapp (App.Path & "\game.dat")
I've included the Fox code below for any lurkers new to the thread.
PARAMETERS strFunction, strTable
** Build the command string
cmdString = &strFunction(&strTable)
** Execute the command string
&cmdString

DEFINE CLASS FoxUtil AS CUSTOM OLEPUBLIC

** Pack the table
	FUNCTION Pak(strTable)
		USE &strTable EXCLUSIVE
		PACK
		USE && Gotta clean up
		RETURN 0
	ENDFUNC

** Zap the table
	FUNCTION Zapp(strTable)
		USE &strTable EXCLUSIVE
		ZAP
		USE && Gotta clean up
		RETURN 0
	ENDFUNC
~Joe Johnston USA

"If ye love wealth better than liberty, the tranquility of servitude better than the animated contest of freedom, go home from us in peace. We ask not your counsel or arms. Crouch down and lick the hands which feed you. May your chains set lightly upon you, and may posterity forget that ye were our countrymen."
~Samuel Adams

Previous
Reply
Map
View

Click here to load this message in the networking platform