I tried running Parksie's DLL tutorial and I get this error, which I quickly blame on Borland but I don't have VC++.
http://www.vbforums.com/attachment.php?s=&postid=678558
I tried running Parksie's DLL tutorial and I get this error, which I quickly blame on Borland but I don't have VC++.
http://www.vbforums.com/attachment.php?s=&postid=678558
BTW, I editing the .def from testdll.dll to helloworld.dll and no change.
Borland sucks for dlls. *** does "referenced from root" mean???
Good question. But like I said I don't have access to VC++ unless you can suggest another compiler.
Anybody?
The .def file should be the same as the target .dll file name. Although I have no idea what the name means. It probably tried to optimise out the function :rolleyes:
Try using:Code:extern "C" long __stdcall TestFunction(...) { ... }
Well it compiled and linked and all that, but now it's bit**ing about not being able to create an output file.
I instantly blame Borland but I sorta need it to work too. :)Code:Info :Making...
Info :helloworld.cpp: rebuild due to dependency helloworld.cpp
Info : helloworld.cpp: cache age 7:57:12 PM 12/2/2001, disk age 6:28:10 PM 12/3/2001
Info :Compiling D:\Arien's Stuff\C++ Programs\Other\Hello World DLL\helloworld.cpp
Info :helloworld.rc: out of date with destination helloworld.res
Info : helloworld.rc: source date <unknown> destination date 9:31:28 PM 12/2/2001
Info :Resource compiling D:\Arien's Stuff\C++ Programs\Other\Hello World DLL\helloworld.rc
Info :Linking D:\Arien's Stuff\C++ Programs\Other\Hello World DLL\helloworld.dll
Info :Transferring to D:\Programs\BORLAND\C++ 5\BIN\implib.exe @C:\DOCUME~1\ARIENT~1\LOCALS~1\Temp\RSP0.$$$
Fatal: error (5,1): unable to open output file
Whoo:
Interestingly enough the file was there and compiled and all. Evil Borland. :rolleyes:VB Code:
' module: Declare Function TestFunction Lib "helloworld.dll" (ByVal lInput As Long) As Long ?TestFunction(10) 15
Why do you have a .RC file in there?
Hmm...how bizarre :)Quote:
Originally posted by filburt1
Whoo:
Interestingly enough the file was there and compiled and all. Evil Borland. :rolleyes:Code:?TestFunction(10)
15
At least MS got something right with MSVC ;)
Uh, because it added it to the project when I started it? I've only worked with console C++ before, haven't done any of this DLL stuff. :(Quote:
Originally posted by parksie
Why do you have a .RC file in there?
DLLs are technically simpler to write than console programs (they only need to supply code and resources).Quote:
Originally posted by filburt1
Uh, because it added it to the project when I started it? I've only worked with console C++ before, haven't done any of this DLL stuff. :(
Although DLLs do have an entry-point function (DllMain) so it's more complex behind the scenes.
Anyway, kick out the .RC file, you don't need it for that example.
Done and it compiled quite a bit faster. :)Quote:
Originally posted by parksie
Anyway, kick out the .RC file, you don't need it for that example.