реклама на сайте
подробности

 
 
> Экспорт класса из dll
Pathfinder
сообщение Nov 22 2007, 13:56
Сообщение #1


Местный
***

Группа: Свой
Сообщений: 275
Регистрация: 29-06-05
Пользователь №: 6 400



Может кто знает, как правильно экспортировать из dll непосредственно методы класса? Сейчас я экспортирую функции, в которые в качестве первого параметра передается адрес экземпляра класса, и внутри функций уже происходит вызов соответствующего метода, получается лишняя обертка из практически пустых функций...


--------------------
ADC / DAC LC Filter Designer — Удобный инструмент проектирования LC-фильтров для ЦАП и АЦП
Go to the top of the page
 
+Quote Post
 
Start new topic
Ответов
makc
сообщение Nov 22 2007, 16:41
Сообщение #2


Гуру
******

Группа: Админы
Сообщений: 3 621
Регистрация: 18-10-04
Из: Москва
Пользователь №: 904



Если компилятор микрософтовский:


dllimport, dllexport
Microsoft Specific

__declspec( dllimport ) declarator

__declspec( dllexport ) declarator

The dllexport and dllimport storage-class attributes are Microsoft-specific extensions to the C and C++ languages. They enable you to export and import functions, data, and objects to and from a DLL. These attributes explicitly define the DLL’s interface to its client, which can be the executable file or another DLL. Declaring functions as dllexport eliminates the need for a module-definition (.DEF) file, at least with respect to the specification of exported functions. Note that dllexport replaces the __export keyword.

The declaration of dllexport and dllimport uses extended attribute syntax.

For more information, see __declspec.

Example

// Example of the dllimport and dllexport class attributes
__declspec( dllimport ) int i;
__declspec( dllexport ) void func(); END Microsoft Specific



C их помощью, afair, можно экспортировать и классы. Но! Это не переносимый метод, т.к. тут будут эскортироваться mangled имена.


--------------------
BR, Makc
В недуге рождены, вскормлены тленом, подлежим распаду. (с) У.Фолкнер.
Go to the top of the page
 
+Quote Post



Reply to this topicStart new topic
1 чел. читают эту тему (гостей: 1, скрытых пользователей: 0)
Пользователей: 0

 


RSS Текстовая версия Сейчас: 22nd July 2025 - 18:17
Рейтинг@Mail.ru


Страница сгенерированна за 0.01361 секунд с 7
ELECTRONIX ©2004-2016