Thank you for the info. Is it possible in a vc++ dll to check for the existence or a value of a VFP variable or VFP object? If yes, I hope you can give me a simple example.
You can embed a .dll file inside an .exe. You just can't declare functions or call them from the DLL without writing it to an external file first.
You could include the DLL in your project with a modified name, say with an underscore added (You have to use an altered name, or code that references the DLL will still "see" the one inside the .EXE - that it can't use). Then before your EXE uses the dll, you would just need to add code to "export" the .dll from within the .exe to an external .dll file.
As long as the .dll is smaller than 16MB, you can use the FILETOSTR() and STRTOFILE() functions. These functions will "see" a file within the .EXE. The code would look something like:
IF !FILE("mydll.dll"
* Assuming that file _mydll.dll was included
* in the project when the .exe was built, the
* next statement will write the _mydll.dll
* file from within the .exe to an external .dll
* file called "mydll.dll".
STRTOFILE(FILETOSTR("_mydll.dll", "mydll.dll"
ENDIF
... code to declare DLL functions from the DLL, etc.
It probably isn't the best way to distribute a .dll, but if you really want to have a single .EXE file, and don't want to mess with an installer package, this would be one option for distrubuting the DLLs.
Personally, I prefer to create an installer package that includes the VFP runtime files, along with any DLLs you use. It's more user friendly.
I recently created a VC++ DLL, and I send an object as well as 2 by reference variables from VFP to a function in the VC++ DLL. You may want to check it out in relation to your question above regarding VFP Objects and variables and VC++ DLL.
ComputeControlSize MonthView Control Problem
thread184-742345
Slighthaze = NULL craig1442@mchsi.com
"Whom computers would destroy, they must first drive mad." - Anon
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.