Главная страница
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.062 c
4-1093101668
Alexis
2004-08-21 19:21
2004.10.24
Сохранение Bitmap из буфера обмена(Clipboard) в файл


3-1095941523
Snip
2004-09-23 16:12
2004.10.24
Динамическое создание компонетов TIBDatabase и TIBTransation


14-1097047209
NewDelpher
2004-10-06 11:20
2004.10.24
Где бы скачать хороший учебник по UML с примерами?


1-1097480490
Jann
2004-10-11 11:41
2004.10.24
ComboBox


6-1092556481
Maxim
2004-08-15 11:54
2004.10.24
Определение OS УДАЛЕННОГО компьютера