Что-то посмотрю, форум меня постоянно Гостем обзывает. Ну, да ладно. Я всегда против регистрации был, и особенно политики, как на форуме iXBT.com.
Проехали...
--------------------------------------------------------------
В попыхах забыл указать, К и в самом деле Word-типа.
На счет полного кода, то он таков.
---------------------Головная-------------------------------
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
function convert_num(a:longint;Osn:byte):word;
external 'cnv.dll';
procedure TForm1.Button1Click(Sender: TObject);
var a: longint;
begin
a:=37;
Form1.Caption:=floattostr(convert_num(a,3));
end;
end.
------------------библиотека------------------------
library Cnv;
uses
SysUtils;
function convert_num(num: longint; Osn: byte): word;stdcall;export;
var k: word;
begin
k:=0;
result:=strtoint(inttostr(k));
end;
exports convert_num;
end.
Тут Sharemem что есть, что нет - одинаково возникает сообщение
---------------------------
Debugger Fault Notification
---------------------------
Project G:\Games\Íîâàÿ ïàïêà\Project1.exe faulted with message: 'access violation at 0x01006629: write of address 0x01c065fc'. Process Stopped. Use Step or Run to continue.
---------------------------
OK
---------------------------