I am not too sure why GetProcAddress is returning nil, but a few points:

1) you do not need to typecast string literals as PChar

FGetAsText := GetProcAddress (FHandle, 'clipboard_getastext');

2) You really should not return strings as PChar, passing them is fine, but
return, nope

result := PChar (Clipboard.AsText);

Why? Because string types are managed and referenced counted. The project
returning the string is likely to deallocate the memory returned upon exit
(unless you save a copy locally) . A better approach would be to have the
caller allocate the memory and return the expected buffer size:

function clipboard_getastext(Buffer: PChar; BufferSize: Integer): Integer;
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to