Q&A

  • DLL 관련 다음 코드에서 에러나는 이유는 ??


// 이건 DLL에서 GetValue 선언이구여...

function GetValue : string;

var

intP : PLPSTR;

begin

intP := MapViewOfFile(filemapobj, FILE_MAP_READ, 0, 0, 0);

try

if intP = nil then result := ''

else result := intP^;

finally

UnMapViewOfFile(intP);

end;

end;





//이건 DLL을 부르는 메인 프로그램에서 GetValue를 가지구 값을 가져 오는 거구여..

procedure TForm1.Button2Click(Sender: TObject);

var tmpStr : variant;

begin

tmpStr := GetValue;

if tmpStr = '' then showmessage('값을 가져오는데 실패했습니다.')

else edit1.text := tmpStr; // ==> 요기!!에서 에러 발생

end;





tmpStr을 edit1.text에 넣을때 Invalid pointer Operation가 나네여...

에러에두 불구하고 값을 갖고 오긴 하더라구여...^^;

분명히 Pchar랑 string 때문에 나는 에러인것 같은데 ..

누구 속시원히 말 좀 해주세용...



0  COMMENTS