AmoebaMan17
11th March 2004 17:15 UTC
Could not load: ...\myplugin.dll
I have created a plugin that uses ADO to update an MSAccess database at install time, for registration purposes. The installation and plugin works fine on some workstations and doesn't work on others.
The workstations that work have Visual Studio 2003 installed on them.
Does anyone know what conditions will generate the message in the [Details...] button during installation: Could not load:...\myplugin.dll?
I am able to create this installer on the machine which can not load the DLL during installation, and since the installer is able to load the DLL at install file creation time, I thought it would work.
Another strange situation is that I am able to create a seperate .EXE file with the same code inside the exported _dllspec function, and that will run on the workstations in question.
So, my guess is that it is some compiler/linker switch that is preventing this from working.
My compiler switches are:
/O1 /Ob1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "REGDEMO_EXPORTS" /D "_MBCS" /D "_WINDLL" /GF /FD /EHsc /MT /GS /Gy /YX"stdafx.h" /Fp"Release/regDemo.pch" /Fo"Release/" /Fd"Release/vc70.pdb" /W3 /nologo /c /TP
My linker switches are:
/OUT:"Release/regDemo.dll" /VERSION:1.0 /INCREMENTAL:NO /NOLOGO /DLL /NODEFAULTLIB /OPT:NOWIN98 /ENTRY:"_DllMainCRTStartup" /IMPLIB:"Release/regDemo.lib" MSVCRT.lib comsupp.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib
I am a programmer, but I am not an expert in compiling.
Chris
kichik
11th March 2004 20:10 UTC
Your DLL probably requires some runtime DLLs that are not present on those workstations. I would guess msvcr70.dll and some ADO DLLs. You can either distribute those DLLs, put them in $PLUGINSDIR before you call the plug-in or simply not use them and link statically.
AmoebaMan17
11th March 2004 20:57 UTC
:up: :up:
Thank you 1000 times!! I have been fighting with
getting anything to work and this fixed it!!
You were exactly right!! It was the msvcr70.dll.
Is there a way to make VS.NET compile with an
older C Runtime requirement? Do I just need
to find an older msvcrt.lib file to compile
against? My program requires Windows 2000 or
greater, all of which should have msvcrt.dll of
at least version 6, I assume.
Also, as a lesser important question, how do I
prevent the horrendous non-word-wrapping from
happening again during my posts, without manually
formatting my paragraphs?
Chris
Joel
11th March 2004 23:57 UTC
Doesn't Visual Studio .NET come a Win32 Project without the .NET runtime?
AmoebaMan17
12th March 2004 05:06 UTC
When I created a new project, I chose to create an empty
Win32 DLL project. I don't think it requires the CLR, but
I'm not sure. But I also downloaded the source to a
couple of plugins from the NSIS archive and then just
inserted my functions in that code, leaving the compiler
and linker settings alone, and that also wasn't working.
I don't have my VS.NET compiler on this computer, but I
have my MS VC++ 6.0. I notice that the MSVCRT.LIB that is
with MS VC++ 6.0 requires msvcrt.dll. So, I am going to
copy that onto my other computer and hopefully things will
compile without the requirement of msvcr70.dll.
-chris
kichik
12th March 2004 10:38 UTC
Instead of messing with libraries you can simply link statically. In MSVC 6 it's an option in the project setting. I'm sure that option exists in 7 too.
To create smaller DLLs simply avoid using MSVCRT just like NSIS and all of its plug-ins are doing.
As for the word wrap, the forum software must have gotten confused by the long line of compiler switches. It shouldn't do it, you don't have to break the lines on your own.