|
MVS2010 + PB12 - argument type differs from required argument type
|
|||
---|---|---|---|
#18+
Добрый день! Пробую вызвать внешнюю функцию из dll, откомпилированную в проекте C++ в MVS2010. Объявляю такие функции в MVS2010 CplusPB.h Код: plaintext 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15.
CplusPB.cpp Код: plaintext 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25.
CplusPB.def Код: plaintext 1. 2. 3. 4. 5.
Затем на uo объявляю Local External Function Код: plaintext 1. 2. 3. 4.
и вызов этих функций Код: plaintext 1. 2. 3. 4. 5. 6. 7. 8. 9.
Функция без аргументов test1() проходит без ошибок, а при добавлении аргументов выскакивает ошибка --------------------------- PowerBuilder application execution error (R0042) --------------------------- Application terminated. Error: Specified argument type differs from required argument type at runtime in DLL function test3. (invalid stack pointer on return from function call) at line 8 in function uf_add of object uo_cpluspb. --------------------------- OK --------------------------- Пробовал разные варианты типа аргумента при объявлении функции в PB12 (вместо Long - int, uint) Если кто-то с этим сталкивался - как это можно победить? ... |
|||
:
Нравится:
Не нравится:
|
|||
14.11.2011, 11:43 |
|
MVS2010 + PB12 - argument type differs from required argument type
|
|||
---|---|---|---|
#18+
Добрый день, если описали ref string ... Function Long test3( ref string b ) Library "CplusPB.DLL" ALIAS FOR "test3;Ansi" то в C должно быть так: int _test3( char** b ) {return 1;} или так int _test3( char* b[] ) {return 1;} ... |
|||
:
Нравится:
Не нравится:
|
|||
14.11.2011, 13:05 |
|
MVS2010 + PB12 - argument type differs from required argument type
|
|||
---|---|---|---|
#18+
Еще раз добрый день ... и неплохо было бы перед вызовом test3 сделать ls_arg = space(256) // или сколько вам надо ... |
|||
:
Нравится:
Не нравится:
|
|||
14.11.2011, 13:09 |
|
MVS2010 + PB12 - argument type differs from required argument type
|
|||
---|---|---|---|
#18+
Спасибо за ответ - к сожалению не помогло ... |
|||
:
Нравится:
Не нравится:
|
|||
14.11.2011, 14:01 |
|
MVS2010 + PB12 - argument type differs from required argument type
|
|||
---|---|---|---|
#18+
Разобрался. Вопрос снят ... |
|||
:
Нравится:
Не нравится:
|
|||
14.11.2011, 15:39 |
|
MVS2010 + PB12 - argument type differs from required argument type
|
|||
---|---|---|---|
#18+
14.11.2011 12:43, bor__bor пишет: > *Function* Long test1( ) Library"CplusPB.DLL" ALIAS*FOR* "test1;Ansi" > *Function* Long test2( int a ) Library"CplusPB.DLL" ALIAS*FOR* "test2;Ansi" Не Int, а Long. Да и ;Ansi здесь - бессмысленный gimmick. Posted via ActualForum NNTP Server 1.4 ... |
|||
:
Нравится:
Не нравится:
|
|||
14.11.2011, 15:40 |
|
|
start [/forum/topic.php?fid=15&msg=37525789&tid=1335614]: |
0ms |
get settings: |
10ms |
get forum list: |
14ms |
check forum access: |
3ms |
check topic access: |
3ms |
track hit: |
34ms |
get topic data: |
10ms |
get forum data: |
2ms |
get page messages: |
35ms |
get tp. blocked users: |
1ms |
others: | 14ms |
total: | 126ms |
0 / 0 |