Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "Основная";
Текущий архив: 2004.10.24;
Скачать: [xml.tar.bz2];

Вниз

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

 
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;
Скачать: [xml.tar.bz2];

Наверх





Память: 0.45 MB
Время: 0.033 c
9-1088280771
ALexb
2004-06-27 00:12
2004.10.24
delphix


14-1096643578
Anatoly Podgoretsky
2004-10-01 19:12
2004.10.24
Слухи о защищенности Оперы и Мозиллы оказались сильно преувеличен


8-1091169788
Руслан
2004-07-30 10:43
2004.10.24
Библиотеки для рисования схем


1-1097475322
goliath
2004-10-11 10:15
2004.10.24
Замена курсора средствами CLX


14-1096877390
gn
2004-10-04 12:09
2004.10.24
я болдею с бенигейтси чесное слово





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский