Re:Simplified Share ADO Connection? for Ross
Look at my compilier directives. It can do it either way. It does not
matter.
However, I have notice in Delphi6 that if you load the library dynamically,
when the test application closes a Windows error occurs:
The instruction at "0x00000000" referenced memory at "0x00000000". The
memory could not be "read"
I do not know why this happens yet. (Using Delphi6 in Win2k w/ sp2)
A solution for this it to replace (in the form destroy event) the function
call
FreeLibrary(MCSSLibHandle)
with
DLLEntryPoint(DLL_PROCESS_DETACH);
Don't forget to update the following sections too!
{$IFDEF DYNAMIC_LINK_MCSS_LIB}
<...snip...>
type
<...snip...>
TDLLEntryPoint = procedure(dwReason: DWORD); stdcall;
var
<...snip...>
DLLEntryPoint : TDLLEntryPoint;
{$ENDIF}
//In form create add the line
{$IFDEF DYNAMIC_LINK_MCSS_LIB}
<...snip...>
@DLLEntryPoint := GetProcAddress(MCSSLibHandle, 'DLLEntryPoint');
{$ENDIF}
Best Regards,
Ray
Quote
"Ross" <polk...@hotmail.com> wrote in message news:3b58a4a0$1_1@dnews...
> It works great. I will use this to learn how to do it.
> I can't tell you how my mind got confused when there was not an access
> violation.
> One difference is that you load the DLL implicitly. I was loading the dll
> dynamically. Should that make a difference?
> "Ray" <sugar_ra...@hotmail.com> wrote in message news:3b5739d3_2@dnews...