extern "C" IACTIVEMODEL * __export createactivemodel (CHAR *device, ILICENCESERVER *ils)
// Exported constructor for active component models.
{
if (ils->authorize (READOUT_KEY))
return new READOUT;
else
return NULL;
}
то есть, обязательно должно отработать: ils->authorize (READOUT_KEY)
Пишут, что если авторизация не прошла - модель дальше работать не будет:
The creatactivemodel function must also authorize the model using the ILICENCSERVER interface.
If a model fails to authorize correctly, it will not receive any further service from the simulator.
У меня ils->authorize (READOUT_KEY) вешается.
Я пробовал её обойти и сразу: return new READOUT;
У тебя срабатывает ils->authorize (READOUT_KEY)?
Before you can begin developing new models, you will need to obtain an allocation of unique product IDs from us. You can do this by emailing us at info@labcenter.co.uk. We will supply you with a base value from which to allocate Product IDs, and a product key file that enables these IDs for your copy of Proteus VSM.
В ils->authorize (READOUT_KEY) - READOUT_KEY - это и есть unique product IDs!
А я его подставляю 0х00000000 .... мда....
Last edited by Lavr on 18 Nov 2012 09:38, edited 2 times in total.
Я при запуске самодельной модели тестирую, в какие файлы она лезет
утилитой filemonitor от Марка Руссиновича from Sysintеrnas.
Ща проверю - если ils->authorize (READOUT_KEY) лезет в LICENCE.DLL,
то я дальше не знаю - что делать...
Вот ещё про Product ID:
To make this business model work, it is necessary to ensure that models can only be used when they have been paid for, and this is the role of the Licencing API within Proteus VSM. Essentially, each user of the system is allocated a Customer ID, which is unique to their copy and a Customer Key which ties that copy to their name and company details. Potentially we can also tie it to their hardware or OS installation.
Each model that is created is allocated a Product ID which is again unique. Then, to use that model on a given installation, the customer is issued with a Product Key. This key is a signature of the Customer ID and the Product ID, and validates that the model can be used with that particular installation of the software.
На Казусе - у них есть Product ID, поэтому бывает их модели и не работают у других...
Собственно поэтому я и хотел научиться делать свои цифровые модели...
Lavr wrote:DLL-ку от KAZUS.RU проверил сразу готовую - OneWireDebugger.dll,
и она у меня под Proteus выдала ошибку.
Хотя у них эта DLL - полностью рабочая...
SIMULATION LOGS
===============
...
FATAL: [OD1] External model DLL "OneWireDebugger.DLL" not found. GLE=0x00000002.
Simulation FAILED Due To Fatal Simulator Errors.
Я из их исходников пересобрал OneWireDebugger.DLL под Борландом, у него
та же болячка: ils->authorize (READOUT_KEY) вешается...
OttoStirliz wrote:Согласно Уставу Labcenter, лицензируется не только Proteus, но и модели.
Поскольку TM128X64OLED где-то работает, а где-то нет, я могу предположить,
что работает у тех, кто имеет на нее лицензию.
aav8 wrote:У меня получилось 149 кб.
Но если на него напустить tdstrp32 получается 38кб.
Спасибо за подсказку, а то давно напрягало, что Борланд это не хочет делать сам...
However, if you prefer to use the integrated linker, always enable debug information. There is no run-time overhead if debug information is included in a PE file. If desired, the debug information can be removed after linking using Borland's command line utility Tdstrp32.exe.
Краткий отчет:
Сделал тестовый пример и рассмотрел под
микроскопом как вызываются функции.
В функции члена класса кроме параметров
передается и ссылка на лбъект класса.
Borland так и поступает - складывает парамеры в стек,
и тоже в стек вставляет ссылку на объект.
VS тоже кладет парвметры в стек, а ссылку на объект
запихивает в регистр ECX и/или EDX - точно еще не понял.
--- в этом Shaos оказался прав - не полной совместимости ---
А вот если функция-член явно описана с
видом вызова ( _stdcall, _cdecl ) ...
VS правильно складывает параметры в стек, и тоже в стек
помещает ссылку на объект.
Поэтому когда мы вызываем из Borlande Proteus,
му ему передаем в authorize два параметра и ссылку на
объект (в стеке), а Proteus ждет два параметра в стеке, и
ссылку на объект в регистрах.
Вот и причина зависания.
aav8 wrote:Поэтому когда мы вызываем из Borlande Proteus,
му ему передаем в authorize два параметра и ссылку на
объект (в стеке), а Proteus ждет два параметра в стеке, и
ссылку на объект в регистрах.
Вот и причина зависания.