Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2004.10.24;
Скачать: CL | DM;

Вниз

Создать секцию для общедоступных переменных   Найти похожие ветки 

 
DelphiLexx ©   (2004-10-08 19:21) [0]

С++ позволяет создвать переменные в общедоступном блоке памяти:

#pragma data_seg("Shared")
HHOOK g_hhook = NULL;
#pragma data_seg()
#pragma comment(linker, "/Section:Shared,rws")

Вопрос: Как сделать аналогичное на Delphi, без использования
CreateFileMapping.
Я долго заморачивался по поводу того, чтобы данный код на с++ перевести на анологичное на Delphi. У всех у кого я спрашивал отвечали, что сделать подобное на Delphi нельзя (т.е. нельзя создать общедоступный блок переменных) . Но ведь можно сделать на ассемблере(я узнал, что на асме можно создать общедоступный блок переменных) и код асмы вставить в delphi. Вопрос как аналогичный код на C++ на писать на assembler"e и вставить его в Delphi?!


 
Fenik   (2004-10-08 19:39) [1]

Глобальные переменные?


 
Cobalt ©   (2004-10-08 21:49) [2]

Это должен поддерживать линковщик, кажется.
Хотя, попробуй
Link object file

Type Parameter
Syntax {$L filename}
{$LINK filename}
Scope Local
Remarks

The $L parameter instructs the compiler to link the named file with the program or unit being compiled. The $L directive is used to link with code written in other languages for procedures and functions declared to be external. The named file must be an Intel relocatable object file (.OBJ file). The default extension for filename is .OBJ. If filename does not specify a directory path, then, in addition to searching for the file in the same directory as the current module, Delphi searches in the directories specified in the Search path input box on the Directories/Conditionals page of the Project|Options dialog box (or in the directories specified in the -O option on the DCC32 command line).

To specify a file name that includes a space, surround the file name with single quotation marks: {$L "My file"}.
For further details about linking with assembly language, see online Help.


 
Игорь Шевченко ©   (2004-10-08 23:45) [3]


> Вопрос: Как сделать аналогичное на Delphi, без использования
> CreateFileMapping.


Искать на Borland Community статью how to make shared section. Автор - кто-то из маститых, может быть, Petr Vones, может, я ошибаюсь.


 
programania ©   (2004-10-09 01:32) [4]

Отдельный Unit c обьялениями
включить в uses всех других unitов



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

Текущий архив: 2004.10.24;
Скачать: CL | DM;

Наверх




Память: 0.47 MB
Время: 0.025 c
14-1097128849
Fanat
2004-10-07 10:00
2004.10.24
Онлайн игрушки


3-1096194063
Merfi
2004-09-26 14:21
2004.10.24
Запрос(Query)


3-1096342004
NoG
2004-09-28 07:26
2004.10.24
Файл Btr


11-1079435066
klim.r.mad
2004-03-16 14:04
2004.10.24
крывые ссылки на сайте


14-1096906491
zokzok
2004-10-04 20:14
2004.10.24
посоветуйте, какой модем купить