Hi,
I want to use external DLL in VFP. Fox example i have created on DLL file in
Visual Basic using ActiveX DLL.
When i use it with VB application it works fine but in VFP 8.0 it gives an
error message i.e.
Cannot find entry point <FunctionName> in DLL.

Below is the example code:
Class Code in VB-ActiveX DLL
''''''''''''''''''''''''
Public Function Multiply(int_x As Integer, int_y As Integer) As Integer
Multiply = int_x * int_y
End Function

In VFP I am using it as:
DECLARE Integer Multiply IN tstProject.Dll integer @x, integer @y
x = 2
y = 3
?Multiply(@x , @y) && Gives an error message mentioned above
?Multiply(x , y) && Same error message

Please let me know if i am doing any mistake.

--
NR

Re: Accessing DLL in VFP by Christian

Christian
Sat Aug 05 08:46:02 CDT 2006

Hello,

you don't have to DECLARE anything.
Instead you create an object.

loObj = CREATEOBJECT('yourVBProject.Classname')
?loObj.Multiply(1,1)

-------

you can't create COM compatible structures in VFP - avoid them if you
want to use the ActiveX Dll from VFP.

Regards
Christian

Re: Accessing DLL in VFP by Mike

Mike
Sat Aug 05 16:26:08 CDT 2006

http://www.news2news.com/vfp/ for lots of examples.


"NR" <NR@discussions.microsoft.com> wrote in message
news:3C2D1A07-60B1-44C7-B1B6-C62F55E72908@microsoft.com...
> Hi,
> I want to use external DLL in VFP. Fox example i have created on DLL file
> in
> Visual Basic using ActiveX DLL.
> When i use it with VB application it works fine but in VFP 8.0 it gives an
> error message i.e.
> Cannot find entry point <FunctionName> in DLL.
>
> Below is the example code:
> Class Code in VB-ActiveX DLL
> ''''''''''''''''''''''''
> Public Function Multiply(int_x As Integer, int_y As Integer) As Integer
> Multiply = int_x * int_y
> End Function
>
> In VFP I am using it as:
> DECLARE Integer Multiply IN tstProject.Dll integer @x, integer @y
> x = 2
> y = 3
> ?Multiply(@x , @y) && Gives an error message mentioned above
> ?Multiply(x , y) && Same error message
>
> Please let me know if i am doing any mistake.
>
> --
> NR



Re: Accessing DLL in VFP by NR

NR
Sun Aug 06 00:37:01 CDT 2006

Dear Christian Ehlscheid! Thanks for your help.
With this method object is being created successfully but it gives an error
while executing a function. Like in your example..
?loObj.Multiply(1,1) && It gives message : "Syntax Error"

In such a simple example i am unable to find where syntax problem comes even
though VFP intellisence is guiding me for functions and it's respective
parameters.

--
NR

"Christian Ehlscheid" wrote:

> Hello,
>
> you don't have to DECLARE anything.
> Instead you create an object.
>
> loObj = CREATEOBJECT('yourVBProject.Classname')
> ?loObj.Multiply(1,1)
>
> -------
>
> you can't create COM compatible structures in VFP - avoid them if you
> want to use the ActiveX Dll from VFP.
>
> Regards
> Christian
>

Re: Accessing DLL in VFP by Chip

Chip
Wed Aug 30 15:54:42 CDT 2006

Could it be that you simply forgot a space after the question mark:

? loObj.Multiply(1,1)


"NR" <NR@discussions.microsoft.com> wrote in message
news:AF7E8F4B-A2A4-4F75-A82C-678A2A369E70@microsoft.com...
> Dear Christian Ehlscheid! Thanks for your help.
> With this method object is being created successfully but it gives an
> error
> while executing a function. Like in your example..
> ?loObj.Multiply(1,1) && It gives message : "Syntax Error"
>
> In such a simple example i am unable to find where syntax problem comes
> even
> though VFP intellisence is guiding me for functions and it's respective
> parameters.
>
> --
> NR
>
> "Christian Ehlscheid" wrote:
>
>> Hello,
>>
>> you don't have to DECLARE anything.
>> Instead you create an object.
>>
>> loObj = CREATEOBJECT('yourVBProject.Classname')
>> ?loObj.Multiply(1,1)
>>
>> -------
>>
>> you can't create COM compatible structures in VFP - avoid them if you
>> want to use the ActiveX Dll from VFP.
>>
>> Regards
>> Christian
>>