Midas.dll是不需要注册的,只要放在程序能搜索到的目录
系统目录,或当前目录就可以的
修改系统的DSIntf.Pas 并复制到当前目录
这样,midas.dll 就不用注册了
procedure CheckDbClient(const CLSID: TGUID);
var
Size: Integer;
FileName: string;
begin
if DbClientHandle = 0 then
begin
EnterCriticalSection(Loading);
try
if DbClientHandle = 0 then
begin
Size := 256;
SetLength(FileName, Size);
if RegQueryValue(HKEY_CLASSES_ROOT, PChar(Format('CLSID/%s/InProcServer32',
[GUIDToString(CLSID)])), PChar(FileName), Size) = ERROR_SUCCESS then
SetLength(FileName, Size) else
begin
FileName := MIDAS_DLL;
try
RegisterComServer(FileName);
except
end;
end;
FileName := MIDAS_DLL;
// add by lich 2004.3.3
DbClientHandle := LoadLibrary(PChar(FileName));
if DbClientHandle = 0 then
raise Exception.CreateRes(@SErrorLoadingMidas);
DllGetClassObject := GetProcAddress(DbClientHandle, 'DllGetClassObject');
end;
finally
LeaveCriticalSection(Loading);
end;
end;
end;