wallys
April 5th, 1999, 03:46 PM
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
Thanks in Advance
|
Click to See Complete Forum and Search --> : Registration wallys April 5th, 1999, 03:46 PM 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 Karl April 6th, 1999, 05:08 AM 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. wallys April 6th, 1999, 09:10 AM 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. Vladimir Milyaev April 6th, 1999, 09:15 AM May be your DllRegisterServer() is somehow not exported? Use dumpbin.exe to view dll interface. Best regards, Bob. wallys April 6th, 1999, 09:17 AM I know for a fact that it isn't because I didn't create one. What do I need to do? Vladimir Milyaev April 6th, 1999, 09:28 AM 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. wallys April 6th, 1999, 09:36 AM 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? Vladimir Milyaev April 6th, 1999, 09:57 AM 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. Karl April 6th, 1999, 10:05 AM 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. wallys April 6th, 1999, 10:28 AM 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"); } wallys April 6th, 1999, 10:31 AM 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"); } Karl April 6th, 1999, 10:43 AM 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. Vladimir Milyaev April 7th, 1999, 06:49 AM 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. Karl April 8th, 1999, 04:23 AM Is courtesy dead in our days ? Ash to ash and clay to clay, if the enemy doesn't get you, your own folk may. wallys April 8th, 1999, 08:03 AM Did I offend you somehow? If so it was unintentional and i apoligize. I sincerely appreciate any and all help I have received. codeguru.com
Copyright Internet.com Inc., All Rights Reserved. |