[Mod] updated TapQuoteApi.dll: use newer official provided x64 dll.
[Fix] fixed nullptr error.
This commit is contained in:
parent
a20eee2d44
commit
a5e545ba0c
Binary file not shown.
@ -1,11 +1,12 @@
|
||||
#!/usr/bin/env bash
|
||||
# autocxxpy version: 0.2.4
|
||||
# autocxxpy version: 0.2.5
|
||||
python -m autocxxpy \
|
||||
vntap \
|
||||
iTapTradeAPI.h TapQuoteAPI.h TapAPIError.h iTapAPIError.h \
|
||||
-I vntap/include \
|
||||
-A custom/custom_wrappers.hpp\
|
||||
--output-dir vntap/generated_files \
|
||||
--copy-autocxxpy-includes vntap/include \
|
||||
--pyi-output-dir . \
|
||||
\
|
||||
--no-clear-pyi-output \
|
||||
|
Binary file not shown.
@ -7,7 +7,7 @@ if typing.TYPE_CHECKING:
|
||||
from .vntap import *
|
||||
|
||||
|
||||
def set_async_callback_exception_handler(handler: Callable[[AsyncDispatchException], bool]):
|
||||
def set_async_callback_exception_handler(handler: Callable[[AsyncDispatchException], None]):
|
||||
"""
|
||||
set a customize exception handler for async callback in this module(pyd)
|
||||
\a handler should return True if it handles that exception,
|
||||
|
@ -48,11 +48,18 @@ namespace autocxxpy
|
||||
{
|
||||
inline static void call(ITapTrade::ITapTradeAPINotify* instance, const char* py_func_name, ITapTrade::TAPIUINT32 sessionID, ITapTrade::TAPIINT32 errorCode, const ITapTrade::TapAPIOrderActionRsp* info)
|
||||
{
|
||||
ITapTrade::TapAPIOrderInfo orderInfo = *info->OrderInfo;
|
||||
ITapTrade::TapAPIOrderInfo orderInfo;
|
||||
if (info->OrderInfo != nullptr)
|
||||
{
|
||||
orderInfo = *info->OrderInfo;
|
||||
}
|
||||
ITapTrade::TapAPIOrderActionRsp copied_info = *info;
|
||||
auto task = [=]() mutable
|
||||
{
|
||||
if (copied_info.OrderInfo != nullptr)
|
||||
{
|
||||
copied_info.OrderInfo = &orderInfo; // ensure pointer is pointer to the correct address(address changes after constructed lambda)
|
||||
}
|
||||
return default_callback_wrapper<&ITapTrade::ITapTradeAPINotify::OnRspOrderAction>::sync(instance, py_func_name, sessionID, errorCode, &copied_info);
|
||||
};
|
||||
dispatcher::instance().add(std::move(task));
|
||||
@ -63,11 +70,18 @@ namespace autocxxpy
|
||||
{
|
||||
inline static void call(ITapTrade::ITapTradeAPINotify* instance, const char* py_func_name, const ITapTrade::TapAPIOrderInfoNotice* info)
|
||||
{
|
||||
ITapTrade::TapAPIOrderInfo orderInfo = *info->OrderInfo;
|
||||
ITapTrade::TapAPIOrderInfo orderInfo;
|
||||
if (info->OrderInfo != nullptr)
|
||||
{
|
||||
orderInfo = *info->OrderInfo;
|
||||
}
|
||||
ITapTrade::TapAPIOrderInfoNotice copied_info = *info;
|
||||
auto task = [=]() mutable
|
||||
{
|
||||
if (copied_info.OrderInfo != nullptr)
|
||||
{
|
||||
copied_info.OrderInfo = &orderInfo; // ensure pointer is pointer to the correct address(address changes after constructed lambda)
|
||||
}
|
||||
return default_callback_wrapper<&ITapTrade::ITapTradeAPINotify::OnRtnOrder>::sync(instance, py_func_name, &copied_info);
|
||||
};
|
||||
dispatcher::instance().add(std::move(task));
|
||||
@ -79,11 +93,19 @@ namespace autocxxpy
|
||||
{
|
||||
inline static void call(ITapTrade::ITapTradeAPINotify* instance, const char* py_func_name, const ITapTrade::TapAPIPositionProfitNotice* info)
|
||||
{
|
||||
ITapTrade::TapAPIPositionProfit profit = *info->Data;
|
||||
|
||||
ITapTrade::TapAPIPositionProfit profit;
|
||||
if (info->Data != nullptr)
|
||||
{
|
||||
profit = *info->Data;
|
||||
}
|
||||
ITapTrade::TapAPIPositionProfitNotice copied_info = *info;
|
||||
auto task = [=]() mutable
|
||||
{
|
||||
if (copied_info.Data != nullptr)
|
||||
{
|
||||
copied_info.Data = &profit; // ensure pointer is pointer to the correct address(address changes after constructed lambda)
|
||||
}
|
||||
return default_callback_wrapper<&ITapTrade::ITapTradeAPINotify::OnRtnPositionProfit>::sync(instance, py_func_name, &copied_info);
|
||||
};
|
||||
dispatcher::instance().add(std::move(task));
|
||||
|
Binary file not shown.
@ -7,7 +7,7 @@ if typing.TYPE_CHECKING:
|
||||
from .vntap import *
|
||||
|
||||
|
||||
def set_async_callback_exception_handler(handler: Callable[[AsyncDispatchException], bool]):
|
||||
def set_async_callback_exception_handler(handler: Callable[[AsyncDispatchException], None]):
|
||||
"""
|
||||
set a customize exception handler for async callback in this module(pyd)
|
||||
\a handler should return True if it handles that exception,
|
||||
|
Loading…
Reference in New Issue
Block a user