Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Writing a DLL in C++
Message
From
29/07/2004 15:41:58
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Writing a DLL in C++
Miscellaneous
Thread ID:
00929321
Message ID:
00929321
Views:
46
Hi,

This thread follows what I started in thread #928678 ("Calling a VB6 function in VFP").

Sorry for the annoyance...

Now the VB6 guys asked me "what is required to build (in any language, preferrable C++) a DLL with some functions (entry points) in it, that could be callable from a VFP, VB etc, program, without the need to register it, and not having to instantiate a class in order to pass parameters and have values returned".

Let me put the problem in VFP terms. If I had to write such function it would be a UDF like this:
Procedure MyProcedure
LParameters pStringParm

Do Case
   Case pStringParm = "123"
        Return        "abc"
   Case pStringParm = "456"
        Return        "def"
   ...
   Case pStringParm = "999"
        Return        "zzz"
EndCase

EndProc
In the above example I tried to show what kind of functionality is desired. In the "real" DLL, there would be other "procedures" (entry points) in it.

To call it I would "declare" it and "call" it, in the normal VFP way, for example:
 Declare Integer GetUserName In Win32API String  @lpUserIDBuffer, ;
                                         Integer @nBufferSize

 nRetVal = GetUserName (@lpUserIDBuffer, @nBufferSize)
Please pardom me if this kind of message may not be adequate to be posted here, but as this problem I'm facing is somewhat "exotic", I would apreciate very much to count on the VFP fellows help.

Thanks!

Fernando
Next
Reply
Map
View

Click here to load this message in the networking platform