Вниз
Скачать: CL | DM;

Почему не работает?   Найти похожие ветки 

← →
Vinivor   (2002-04-11 12:10) [0]

Привет всем!
Помогите чайнику плз %)

////////////////// roll.dll ///////////////////////////////
library roll;
uses
windows, Registry;
var reg:Tregistry;

function read_regedit_str(root_key:HKEY; reg_path,name_param:string):string; stdcall;
begin
Reg:=TRegistry.Create;
With Reg do
Try
Begin
RootKey:=root_key;
OpenKey(reg_path,true);
If ValueExists(name_param) then
Result:=Readstring(name_param);
CloseKey;
End;
Reg.CloseKey;
finally
Reg.Free;
end;
end;
exports read_regedit_str;

begin
end.

////////////////////////////////////////////////////////////////

////////////// use_roll.exe /////////////////////
unit Unit1;

interface

uses
Windows, Forms, registry, StdCtrls, Controls, Classes, sysutils,
ExtCtrls;

type --
TForm1 = class(TForm)
str: TButton;
Label1: TLabel;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;
reg:tregistry;
implementation

function read_regedit_str(root:HKEY; reg_path,name_param:string):string stdcall; external "roll.dll";

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
begin
label1.Caption:=read_regedit_str(HKEY_CURRENT_USER,"\Software\Microsoft\ Notepad","lfFaceName");
end;

end.
/////////////////////////////////////////////////////////////////

Не работает, и не пойму почему? Boolean и float работают, а string не хочет

Жду ответов :)


← →
Виктор Щербаков ©   (2002-04-11 12:14) [1]

В файле проекта roll и use_roll и хоста в uses на первом месте запиши модуль ShareMem.
Но при распространении приложения придется таскать за ним bordmm.dll.


← →
SVM   (2002-04-11 12:15) [2]

А кто же строки передает из DLL? Или PChar (ShortString),
или (цитата из файла проекта):

{ Important note about DLL memory management:
ShareMem must be the first unit in your library"s USES clause AND your project"s (select Project-View Source) USES clause if your DLL exports any procedures or functions that pass strings as parameters or function results.
This applies to all strings passed to and from your DLL--even those that are nested in records and classes.
ShareMem is the interface unit to the BORLNDMM.DLL shared memory manager, which must be deployed along with your DLL.
To avoid using BORLNDMM.DLL, pass string information
using PChar or ShortString parameters. }



Страницы: 1 вся ветка

Скачать: CL | DM;



Память: 0.45 MB
Время: 0.009 c
14-81077
dimich
2002-03-19 08:54
2002.04.25
Проблема с ХР.


14-81039
ProgMan
2002-03-11 14:35
2002.04.25
9 способов пеpеступить закон падающего бутеpбpода


1-80958
Explorer
2002-04-12 10:28
2002.04.25
Возможно запретить табуляцию?


3-80744
Lego
2002-04-02 02:35
2002.04.25
Наверное глупый вопрос... но все-же... какие файлы нужны клиенту?


14-81069
Oleg_V
2002-03-19 05:45
2002.04.25
Братья програмеры помогите, как зделать форму с неровными краями!!???




   Наверх