nican.dll을 호출하여 실행할때 access violation 이 발생합니다.
다음은 개략적인 소스입니다. 문제가 있는 부분 지적해주십시오..
function ncOpenObject(ObjName:PChar; ObjHandlePtr:Pointer):Longint;
stdcall; external 'NICAN.DLL';
procedure Tfrmobj.Button1Click(Sender: TObject);
var
AProcedure : procedure;
DLLHandle : THandle;
Status,TxHandle : LongInt;
begin
TxHandle := 0;
DLLHandle := LoadLibrary(PChar('nican.dll'));
@AProcedure := GetProcAddress( DLLHandle, PChar('ncOpenObject'));
AProcedure;
Status := ncOpenObject('CAN0::std5',@TxHandle);
FreeLibrary(DLLHandle);
end;
|