VS2010과 Casablanca 버전 1.2를 사용하여 기존 C++ 솔루션에 REST 인터페이스를 통합하고 있습니다. 이 코드 블록만으로 새로운 솔루션을 만들면 완벽하게 작동합니다. 이 코드를 기존 .cpp 파일에 놓으면 memcpy 예외가있는 클라이언트 객체를 만들 때 충돌이 발생합니다. 업데이트를 통해 Casablanca (100)의 올바른 버전을 볼 수있는 속성 파일을 작성하고 include 및 lib 디렉토리의 경로뿐만 아니라 외부 종속성을 추가했습니다.Casablanca 코드를 기존 C++ 솔루션에 통합 할 때 Memcpy 예외가 발생했습니다.
코드의 블록은 다음과 같습니다
try
{
http_client_config cimconfig;
cimconfig.set_validate_certificates(false);
http_client cimclient(L"https://dmaid52.corp.global/workplace",cimconfig);
cimclient .request(methods::GET).then([](http_response response) {
string_t theResponse = response.to_string();
}).wait();
}
catch(const http_exception &e)
{
printf("Exception status code %u returned. %s\n", e.error_code(), e.what());
}
cimclient 내가 예외가 생성됩니다. 구성에 대한 참조를 제거하고 http_client cimclient(L"https://dmaid52.corp.global/workplace")
만 호출하면 제대로 작동하는 것으로 보이지만 .request
에 예외가 발생합니다.
예외에 대한 호출 스택은 다음과 같습니다.
msvcr100d.dll!_VEC_memcpy(void * dst, void * src, int len) + 0x46 bytes
cpprest100d_1_2.dll!_wmemcpy() + 0x31 bytes
cpprest100d_1_2.dll!std::char_traits<wchar_t>::copy() + 0x2f bytes
cpprest100d_1_2.dll! std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> ::assign() + 0xb7 bytes
cpprest100d_1_2.dll! std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> ::basic_string< wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >() + 0x86 bytes
cpprest100d_1_2.dll!web::http::client::credentials::credentials() + 0x67 bytes
cpprest100d_1_2.dll!web::http::client::http_client_config::http_client_config() + 0x6c bytes
cpprest100d_1_2.dll! web::http::client::details::_http_client_communicator::_http_client_communicator() + 0x73 bytes cpprest100d_1_2.dll!web::http::client::details::winhttp_client::winhttp_client() + 0x52 bytes
cpprest100d_1_2.dll!std::tr1::_Ref_count_obj<web::http::client::details::winhttp_client>::_Ref_count_obj<web::http::client::details::winhttp_client><web::http::uri const &,web::http::client::http_client_config const &>() + 0xa6 bytes
cpprest100d_1_2.dll!std::tr1::make_shared<web::http::client::details::winhttp_client,web::http::uri const &,web::http::client::http_client_config const &>() + 0x8f bytes
cpprest100d_1_2.dll!web::http::client::http_network_handler::http_network_handler() + 0x70 bytes
cpprest100d_1_2.dll!std::tr1::_Ref_count_obj<web::http::client::http_network_handler>::_Ref_count_obj<web::http::client::http_network_handler><web::http::uri const &,web::http::client::http_client_config const &>() + 0xa3 bytes
cpprest100d_1_2.dll!std::tr1::make_shared<web::http::client::http_network_handler,web::http::uri const &,web::http::client::http_client_config const &>() + 0x8c bytes
cpprest100d_1_2.dll!web::http::client::http_client::build_pipeline() + 0x6f bytes
cpprest100d_1_2.dll!web::http::client::http_client::http_client() + 0x74 bytes
Hl7.exe!CChartSchedule::sendScheduleToCIM(QMsgSchedule * pMsg) Line 146 + 0x35 bytes C++
나는이 오류에 대한 해결책을 찾기 위해 높거나 낮음을 검색했습니다. 프로젝트 설정의 어딘가에있는 설정 일 수도 있지만 독립형 프로젝트를 통합 프로젝트와 비교 했으므로 아무 것도 생각해 낼 수 없습니다.
실제 예외 (읽기 또는 쓰기 및 어떤 주소)가 무엇입니까? –