|
-
April 5th, 1999, 03:46 PM
#1
Registration
My DLL's created with VC++ 6 do not work on NT when I dynamically link them into a release build. Someone suggested that I need to register them. Is this true and if so how?
Thanks in Advance
-
April 6th, 1999, 05:08 AM
#2
Re: Registration
Be sure that your DLL is release-build. you can't have a mix between Debug and Release when you modules need MFC.
HTH
K.
Ash to ash and clay to clay, if the enemy doesn't get you, your own folk may.
We're talking ****, 'cause life is a 'biz
You know it is
Everybody tryin' to get rich
God ****!
All I wanna do is live !
KoRn, Children of the Korn
-
April 6th, 1999, 09:10 AM
#3
Re: Registration
Both the DLL and the App are release builds. When I try regserv32 it finds the dll but I don't have entry points for DllRegisterServer.
-
April 6th, 1999, 09:15 AM
#4
Re: Registration
May be your DllRegisterServer() is somehow not exported? Use dumpbin.exe to view dll interface.
Best regards, Bob.
-
April 6th, 1999, 09:17 AM
#5
Re: Registration
I know for a fact that it isn't because I didn't create one. What do I need to do?
-
April 6th, 1999, 09:28 AM
#6
Re: Registration
Sorry, I didn't read source message accurately.
When you compile dll compiler creates <yourdllname>.lib. You must link it to you main exe. After that exe finds dll while loading.
On other hand you use LoadLibrary.
Best regards, Bob.
-
April 6th, 1999, 09:36 AM
#7
Re: Registration
I'll go into a little more detail. With Win95 I can dynamically link to my dll correctly from exe's and other dll's. When my app is run on NT I can not. I have been told that I need to register my DLL's for NT to recognize them. Is this true and if so how?
-
April 6th, 1999, 09:57 AM
#8
Re: Registration
As I know dlls donn't need any special registration. RegSvr32 is used for register ActiveX servers only.
Try to check path variable. LoadLibrary uses paths to load dll. May be you have problems with runtime dlls under NT.
Best regards, Bob.
-
April 6th, 1999, 10:05 AM
#9
Re: Registration
Regsrv32 is used to register ActiveX, not "standard" DLL.
So, are you sure of these points:
* you have included the .lib file in your (exe) project's settings.
* Verify your Dllimport and DllExport (avoid DEF files).
* Check that your exe is able to find the DLL (check PATH)
-> With all this, every is working fine for me, even under NT, 95 and 98.
Ash to ash and clay to clay, if the enemy doesn't get you, your own folk may.
We're talking ****, 'cause life is a 'biz
You know it is
Everybody tryin' to get rich
God ****!
All I wanna do is live !
KoRn, Children of the Korn
-
April 6th, 1999, 10:28 AM
#10
Re: Registration
The dll's are being run from the same network directory that contains the exe. I also tried placing the dll's in the users winnt/system32 directory.
It works for Win95 but not NT. If I do a quickview on the release builds, export info is not included. Here's the code I use to call the dll.
HINSTANCE hCommonLib;
int (*crcGen)(void);
hCommonLib = ::LoadLibrary("tkcommon.dll");
if(hCommonLib != NULL)
{
crcGen = (int (__cdecl *)(void))::GetProcAddress(hCommonLib,(LPCSTR)31);
ASSERT(crcGen != NULL);
crcGen();
FreeLibrary(hCommonLib);
}
else
{
MessageBox("TkCommon.dll is required and could not be found","Warning");
}
-
April 6th, 1999, 10:31 AM
#11
Re: Registration
I am pretty sure of this with the exception that I am using DEF files. I don't have any problems until I use a release build. The debug build works great. Here is the code I am using to call my dll.
HINSTANCE hCommonLib;
int (*crcGen)(void);
hCommonLib = ::LoadLibrary("tkcommon.dll");
if(hCommonLib != NULL)
{
crcGen = (int (__cdecl *)(void))::GetProcAddress(hCommonLib,(LPCSTR)31);
ASSERT(crcGen != NULL);
crcGen();
FreeLibrary(hCommonLib);
}
else
{
MessageBox("TkCommon.dll is required and could not be found","Warning");
}
-
April 6th, 1999, 10:43 AM
#12
Re: Registration
in the doc, MS says:
"MFC applications loading extension DLLs should use AfxLoadLibrary instead of LoadLibrary. AfxLoadLibrary handles thread synchronization before calling LoadLibrary. The interface (function prototype) to AfxLoadLibrary is the same as LoadLibrary.
If for some reason Windows cannot load the DLL, the process can attempt to recover from the error. For example, the process could notify the user of the error and have the user specify another path to the DLL."
you may try this.
HTH (this time)
K.
Ash to ash and clay to clay, if the enemy doesn't get you, your own folk may.
We're talking ****, 'cause life is a 'biz
You know it is
Everybody tryin' to get rich
God ****!
All I wanna do is live !
KoRn, Children of the Korn
-
April 7th, 1999, 06:49 AM
#13
Re: Registration
I agree with Karl but there are no difference in that case and want to add something.
Try ro get diagnostic by using GetLastError().
If program fails on library loading then -
You VC6 installed under 95 or NT? - you should copy runtimes (msvcirt.dll, mfcXX.dll e.t.c) to system directory of OS which has not VC6 installation. May be different versions and your dll can not load some runtime.
Best regards, Bob.
-
April 8th, 1999, 04:23 AM
#14
Thanks for nothing
Is courtesy dead in our days ?
Ash to ash and clay to clay, if the enemy doesn't get you, your own folk may.
We're talking ****, 'cause life is a 'biz
You know it is
Everybody tryin' to get rich
God ****!
All I wanna do is live !
KoRn, Children of the Korn
-
April 8th, 1999, 08:03 AM
#15
Re: Thanks for nothing
Did I offend you somehow? If so it was unintentional and i apoligize. I sincerely appreciate any and all help I have received.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|