RE: Regular DLL How To register

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: nayak (nayak_at_discussions.microsoft.com)
Date: 12/17/04


Date: Fri, 17 Dec 2004 06:03:04 -0800

You cannot register a non COM dll(which doesn't export DllRegisterServer func)
Use the win32 api function
HMODULE LoadLibrary( LPCTSTR lpFileName);
and
FARPROC GetProcAddress( HMODULE hModule, LPCSTR lpProcName);

to explicitly load the dll and make your function calls

"Jay Chadderwala" wrote:

> Hi all,
>
>
> I have created Regular dll statically linked with mfc ( no automation
> ).
> i have written one function which uses MFC classes like CString,Cfile,
> etc... This is only exported function. It is not an activex component
> nor com dll.
> it has following prototye
>
> extern "C" __declspec(dllexport) int fucntion(const CString&
> sParam1, const CString& sParam2, const CString&
> sParam3)
> {
>
> // do some work and return result code
> return;
>
> }
>
>
> Client application which uses that function. ( given .lib in project
> setting in MSVC6)
>
>
>
> Now my problem is that i have 2 such client application running and
> that is on differant locations ( e.g one is running on c:\ and other
> is on d:\ ) i want my dll to be in 3rd location ( e.g. e:\ )
>
> Is there any mechanism to import dll by hardcoded path to dll? and
> client EXE will load that dll from that path.?
>
> how can solve the path issue for dll? how can i make my client app to
> be aware of where my regular dll is located?
>
> i dont want to put dll in same directory as client nor in system
> folder.
> also dont want to make entry in system PATH variable.
>
> what else option can be? By programming.
>
>
> when i am trying to run regsvr32 regdll.dll
> it says dll is loaded but dllregisterserver failed. may be corrept dll
>
> What should i do? i am stucked...
>
>
> thanks in advance.
>
> Regards,
> Jay
>



Relevant Pages

  • Re: DllMain vs. DllMain
    ... Lots of Win32 code assumes HMODULE is a pointer to ... the beginning of DLL in memory. ... Lots of Win32 code (including VC CRT) ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Pfad einer Dll
    ... Da kam der Explorer zurück. ... >> Über die Funktion GetModuleFileName versuche ich zur Zeit den Pfad der ... >> Dll rauszulesen. ... > HMODULE hModule, ...
    (microsoft.public.de.vc)
  • Re: Overflow Error with GetModuleFileName() on Windows Vista
    ... When I develop applications or dlls, and each of them must know wether it runs in the IDE, ... Here the dll uses its IsInIDE function itself and so the function then should report True when the dll itself is running uncompiled in the IDE. ... Dim hModule As Long, lLen As Long ... Dim strModule As String * 256 ...
    (microsoft.public.vb.general.discussion)
  • Cant find the DLL entry point
    ... I use the C++.NET to write a dll and call the dll using VB6. ... BOOL APIENTRY DllMain(HINSTANCE hModule, ... End Sub ...
    (microsoft.public.dotnet.languages.vc)
  • Re: screen scrape / remote manipulation
    ... Functionally a dll is no different from an .exe in terms of spying ... The other option is to install software capable of monitoring TCP/IP port ... connection is established between the dll (on the client) and the server, ...
    (microsoft.public.windowsxp.general)