H
hsgrass
Unregistered / Unconfirmed
GUEST, unregistred user!
----------------------unit<br>procedure regplugin();<br>begin<br> TForm2.Create(Application); // tform2 = class(tform); 空白窗體.<br>end;<br><br>exports<br> regplugin;<br>--------------------------------------------------------<br><br>procedure TForm1.btn1Click(Sender: TObject);<br>var<br> h: thandle;<br> p: procedure();<br>begin<br> with dlgOpen1 do<br> begin<br> InitialDir := ExtractFileDir(ParamStr(0));<br> Filter := '*.dll|*.dll';<br> if Execute then<br> begin<br> h := LoadLibrary(pchar(filename));<br> p := GetProcAddress(h, 'regplugin');<br> if assigned(p) then<br> p;<br> FreeLibrary(h); // 釋放出現地址錯.<br> end;<br> end;<br>end;