Главная страница
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.051 c
6-1092811600
DillerXX
2004-08-18 10:46
2004.10.24
Дайте линку на пример использования компонента TIdIRSserver


4-1095712680
Саша
2004-09-21 00:38
2004.10.24
ExitWindow


3-1096041201
Jiny
2004-09-24 19:53
2004.10.24
проблема с группировкой записей


1-1097513743
Shved
2004-10-11 20:55
2004.10.24
Путь к файлам


14-1096620095
KilkennyCat
2004-10-01 12:41
2004.10.24
вот еще попробовал писательством заняться...