nedoPC.org

Electronics hobbyists community established in 2002
Atom Feed | View unanswered posts | View active topics It is currently 28 Mar 2024 03:54



Reply to topic  [ 295 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6 ... 20  Next
Proteus C++ DLL's 
Author Message
Supreme God
User avatar

Joined: 21 Oct 2009 08:08
Posts: 7777
Location: Россия
Reply with quote
Post 
Слушай, есть ещё один тонкий момент - лицензирование модели...
Я так прочитал, что оно осуществляется вот в этот момент:
Code:
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)
Пишут, что если авторизация не прошла - модель дальше работать не будет:
Quote:
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)?

_________________
iLavr


18 Nov 2012 09:21
Profile
Maniac

Joined: 05 Nov 2008 19:47
Posts: 287
Location: 81.28.208.238
Reply with quote
Post 
Quote:
то есть, обязательно должно отработать: ils->authorize (READOUT_KEY)
Пишут, что если авторизация не прошла - модель дальше работать не будет:

Да у меня тоже тут подвисает...

offtopic {
ни фига не стоит - зато как висит!
}


18 Nov 2012 09:28
Profile
Supreme God
User avatar

Joined: 21 Oct 2009 08:08
Posts: 7777
Location: Россия
Reply with quote
Post 
Ха-хаааааа... :( ну надо же! :o
Quote:
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! :o
А я его подставляю 0х00000000 .... мда.... :(

_________________
iLavr


Last edited by Lavr on 18 Nov 2012 09:38, edited 2 times in total.



18 Nov 2012 09:30
Profile
Maniac

Joined: 05 Nov 2008 19:47
Posts: 287
Location: 81.28.208.238
Reply with quote
Post 
Quote:
В ils->authorize (READOUT_KEY) - READOUT_KEY - это и есть unique product IDs!
А я его подставляю 0х00000000 .... мда....

В примере от Kazus тоже 0...


18 Nov 2012 09:33
Profile
Supreme God
User avatar

Joined: 21 Oct 2009 08:08
Posts: 7777
Location: Россия
Reply with quote
Post 
Я при запуске самодельной модели тестирую, в какие файлы она лезет
утилитой filemonitor от Марка Руссиновича from Sysintеrnas.
Ща проверю - если ils->authorize (READOUT_KEY) лезет в LICENCE.DLL,
то я дальше не знаю - что делать... :(

Вот ещё про Product ID:
Quote:
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, поэтому бывает их модели и не работают у других...
Собственно поэтому я и хотел научиться делать свои цифровые модели...

_________________
iLavr


18 Nov 2012 09:38
Profile
Supreme God
User avatar

Joined: 21 Oct 2009 08:08
Posts: 7777
Location: Россия
Reply with quote
Post 
Lavr wrote:
Ща проверю - если ils->authorize (READOUT_KEY) лезет в LICENCE.DLL,
то я дальше не знаю - что делать... :(

Нет - вроде как не лезет...
Code:
12665  19:59:36  Isis  Read  C:\PROGRAM FILES\LABCENTER ELECTRONICS\PROTEUS 6 PROFESSIONAL\MODELS\OURDEV.DLL  SUCCESS  Offset: 92672 Length: 512
12666  19:59:36  Isis  Attributes  C:\WINDOWS\MEDIA\NOTIFY.WAV  SUCCESS  GetAttributes
12667  19:59:36  Isis  Open  C:\WINDOWS\MEDIA\NOTIFY.WAV  SUCCESS  OPENEXISTING READONLY DENYNONE
12668  19:59:36  Isis  Ioctl  C:  SUCCESS  Subfunction: 08h
12669  19:59:36  Isis  Attributes  C:\WINDOWS\MEDIA\NOTIFY.WAV  SUCCESS  Get Modify
12670  19:59:36  Isis  Close  C:\WINDOWS\MEDIA\NOTIFY.WAV  SUCCESS  CLOSE_FINAL
12671  19:59:44  Isis  Read  C:\PROGRAM FILES\LABCENTER ELECTRONICS\PROTEUS 6 PROFESSIONAL\MODELS\OURDEV.DLL  SUCCESS  Offset: 58880 Length: 4096
12672  19:59:44  Isis  Read  C:\PROGRAM FILES\LABCENTER ELECTRONICS\PROTEUS 6 PROFESSIONAL\BIN\PROSPICE.DLL  SUCCESS  Offset: 269312 Length: 4096
12673  19:59:44  Isis  Read  C:\PROGRAM FILES\LABCENTER ELECTRONICS\PROTEUS 6 PROFESSIONAL\BIN\SPICESIM.DLL  SUCCESS  Offset: 719872 Length: 4096
12674  19:59:44  Isis  Read  C:\PROGRAM FILES\LABCENTER ELECTRONICS\PROTEUS 6 PROFESSIONAL\BIN\PROSPICE.DLL  SUCCESS  Offset: 58880 Length: 4096
12675  20:00:28  MSGSRV32  Attributes  C:\WINDOWS\USER.DAT  SUCCESS  SetAttributes

NOTIFY.WAV - это MessageBox("Выполняется обращение [authorize(model_key)]!")
OURDEV.DLL - обращается в PROSPICE.DLL , значит вызов ils->authorize (READOUT_KEY)
сработал...
PROSPICE.DLL вызвала SPICESIM.DLL и повисла...

aav8 wrote:
На работе есть студия 2010 попробую на ней,
но в результате не уверен.

Попробуй компильни в студии 2010... мне все же кажется, ils->authorize (READOUT_KEY)
не должна вешать Proteus, а хотя бы должна вернуться с ошибкой...

vsm.hpp - получается, что это интерфейс к PROSPICE.DLL?

_________________
iLavr


18 Nov 2012 10:12
Profile
Supreme God
User avatar

Joined: 21 Oct 2009 08:08
Posts: 7777
Location: Россия
Reply with quote
Post 
Lavr wrote:
DLL-ку от KAZUS.RU проверил сразу готовую - OneWireDebugger.dll,
и она у меня под Proteus выдала ошибку.
Хотя у них эта DLL - полностью рабочая... :-?

Ошибка вот такая:
Code:
SIMULATION LOG
==============

Reading netlist...
FATAL: [OD1] External model DLL "OneWireDebugger.DLL" not found. GLE=0x0000001F.

Simulation FAILED due to fatal simulator errors.

Мне кажется, у меня нету MSVCR90D.DLL, потому что если нет самой OneWireDebugger.DLL,
то ошибка другая:
Code:
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) вешается... :(

_________________
iLavr


18 Nov 2012 15:19
Profile
Supreme God
User avatar

Joined: 21 Oct 2009 08:08
Posts: 7777
Location: Россия
Reply with quote
Post 
Хотя, я смотрю, - и у товарищей с KAZUS.RU с их новыми и лицензионными
(местами) Proteus-ами одни и те же цифровые модели у одних - работают,
а у других - нет
... :-?
Согласно Уставу Labcenter, лицензируется не только Proteus, но и модели.
Поскольку TM128X64OLED где-то работает, а где-то нет, я могу предположить,
что работает у тех, кто имеет на нее лицензию.

Image

А модели в принципе - симпатичные! :kruto:

_________________
iLavr


18 Nov 2012 18:16
Profile
Maniac

Joined: 05 Nov 2008 19:47
Posts: 287
Location: 81.28.208.238
Reply with quote
Post 
Quote:
Попробуй компильни в студии 2010... мне все же кажется, ils->authorize (READOUT_KEY)
не должна вешать Proteus, а хотя бы должна вернуться с ошибкой...

После студии заработало с исходниками от KAZUS...


18 Nov 2012 18:32
Profile
Supreme God
User avatar

Joined: 21 Oct 2009 08:08
Posts: 7777
Location: Россия
Reply with quote
Post 
aav8 wrote:
Quote:
Попробуй компильни в студии 2010... мне все же кажется, ils->authorize (READOUT_KEY)
не должна вешать Proteus, а хотя бы должна вернуться с ошибкой...

После студии заработало с исходниками от KAZUS...

Ну это как бы нас не удивило... :lol:

Удивляет, что студия делает файл OneWireDebugger.DLL в 35 кБайт,
а Борланд Билдер - в 105 кБайт, да он ещё и виснет! :o

_________________
iLavr


18 Nov 2012 18:53
Profile
Maniac

Joined: 05 Nov 2008 19:47
Posts: 287
Location: 81.28.208.238
Reply with quote
Post 
Quote:
Удивляет, что студия делает файл OneWireDebugger.DLL в 35 кБайт,
а Борланд Билдер - в 105 кБайт, да он ещё и виснет!

У меня получилось 149 кб.
Но если на него напустить tdstrp32 получается 38кб.
Но c Proteus-ом позанимаюсь.
Благо что есть с чем сравнивать.


18 Nov 2012 19:36
Profile
Supreme God
User avatar

Joined: 21 Oct 2009 08:08
Posts: 7777
Location: Россия
Reply with quote
Post 
aav8 wrote:
У меня получилось 149 кб.
Но если на него напустить tdstrp32 получается 38кб.

Спасибо за подсказку, а то давно напрягало, что Борланд это не хочет делать сам...
Quote:
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.

_________________
iLavr


19 Nov 2012 12:48
Profile
Supreme God
User avatar

Joined: 21 Oct 2009 08:08
Posts: 7777
Location: Россия
Reply with quote
Post 
aav8 wrote:
Есть некоторое подозрение, что VSM.HPP для каждой весии свой...

Ты оказался прав! Я посмотрел на KAZUS.RU - обсуждали этот момент!

Самый последний доступный вариант VSM.HPP должен иметь вот такую строчку:
Code:
#define VSM_API_VERSION  110

Но у нас он такой и есть. После этой версии VSM SDK стал доступен ограниченно...

_________________
iLavr


19 Nov 2012 14:49
Profile
Maniac

Joined: 05 Nov 2008 19:47
Posts: 287
Location: 81.28.208.238
Reply with quote
Post 
Краткий отчет:
Сделал тестовый пример и рассмотрел под
микроскопом как вызываются функции.
В функции члена класса кроме параметров
передается и ссылка на лбъект класса.
Borland так и поступает - складывает парамеры в стек,
и тоже в стек вставляет ссылку на объект.
VS тоже кладет парвметры в стек, а ссылку на объект
запихивает в регистр ECX и/или EDX - точно еще не понял.
--- в этом Shaos оказался прав - не полной совместимости ---
А вот если функция-член явно описана с
видом вызова ( _stdcall, _cdecl ) ...
VS правильно складывает параметры в стек, и тоже в стек
помещает ссылку на объект.
Поэтому когда мы вызываем из Borlande Proteus,
му ему передаем в authorize два параметра и ссылку на
объект (в стеке), а Proteus ждет два параметра в стеке, и
ссылку на объект в регистрах.
Вот и причина зависания.


19 Nov 2012 18:32
Profile
Supreme God
User avatar

Joined: 21 Oct 2009 08:08
Posts: 7777
Location: Россия
Reply with quote
Post 
aav8 wrote:
Поэтому когда мы вызываем из Borlande Proteus,
му ему передаем в authorize два параметра и ссылку на
объект (в стеке), а Proteus ждет два параметра в стеке, и
ссылку на объект в регистрах.
Вот и причина зависания.

Ну ты гигант! :o :kruto:

А мы никак не сможем это подправить или обойти?


PS. А что ты юзал в качестве "микроскопа"? :wink:

_________________
iLavr


19 Nov 2012 18:41
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 295 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6 ... 20  Next

Who is online

Users browsing this forum: No registered users and 24 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software.