{app.exe!_com_error::'vector delete destructor'(unsigned int)}
{app.exe!_com_error::`vector deleting destructor'(unsigned int)}
我在Visual Studio 2017中创建MSMQqueue时遇到异常,请在下面找到代码和异常详细信息:
Exception details :
app.exe!`queue::CreateQueue'::`1'::catch$3() Line 56 C++ Symbols loaded.
请建议队列实现串口读写。
队列.cpp
#include "stdafx.h"
#include "MSMQ_Queue.h"
#import "mqoa.dll"
using namespace MSMQ;
queue::queue() {}
queue::~queue() {}
HRESULT queue::CreateQueue(WCHAR *wszPathName)
{
HRESULT hr = S_OK;
if (wszPathName == NULL)
{
return MQ_ERROR_INVALID_PARAMETER;
}
try
{
IMSMQQueueInfoPtr pInfo("MSMQ.MSMQQueueInfo");
// Set the queue's path name and label.
pInfo->PathName = wszPathName;
pInfo->Label = "TestQueue";
// Create the queue.
**pInfo->Create();**//Hitting exception at this point
WCHAR wszMessage[1024] = { 0 };
}
catch (const _com_error& comerr)
{
hr = comerr.Error();
WCHAR wszMessage[2048] = { 0 };
}
return hr;
}
主.cpp
#include "stdafx.h"
#include"queue.h"
#include <stdio.h> // for printf
int main()
{
wchar_t name[] = L".\vniqueue";
queue msmqueue;
//CoInitialize(0);
OleInitialize(NULL);
HRESULT returnValue = msmqueue.CreateQueue(name);
getchar();
return 0;
}
异常创建队列
最后我找到了解决方案。
我提供了公共路径而不是私人拍拍。 将".//queuename"更改为.//private$//queuename"。
相关文章:
- 从"int*"强制转换为"unsigned int"会丢失精度错误
- 不能在初始值设定项列表中将非常量表达式从类型 'int' 缩小到'unsigned long long'
- C++核心准则 C35 对于接口类"A base class destructor should be either public and virtual, or protected and nonv
- <Windows>为什么 std::thread::native_handle 返回类型为"long long unsigned int"的值,而不是 void*(又名 HANDLE)?
- 错误:隐式转换更改符号:'int'到'unsigned long'
- 如何使用多次 memcpy 转换回 std::vector<unsigned char>?
- 定义 uint= "unsigned int" 没有像我在 Visual Studio 中使用 nvcc 时预期的那样应用
- static_cast<unsigned>(签名)与标准::bit_cast<unsigned>(签名)之间有区别吗?
- 对 '(const Y) (int&, std::mersenne_twister_engine<long unsigned int,
- 错误:从'void*'到'const uint8_t* {aka const unsigned char*}'的转换无效 [-允许]
- 错误:'class std::unique_ptr<std::set<long unsigned int> >'没有名为 'size' 的成员
- 为什么在C++负数static_cast如果<unsigned>数字是常数,则不同
- 正确语法,用于统一初始化名称中带有空格的类型的临时,如unsigned int
- "1L << count"是什么意思?如何使用超出"unsigned long long int? "范围的语句编号打印?
- C++ - 从 "int" 到 "unsigned char" 的缩小转换无效
- 让 'std::vector<unsigned char>' 从 'std::string' 中窃取内存
- C++11 模板函数"implicity"将位集<N>转换为"unsigned long"
- "runtime error: addition of unsigned offset to 0x129000a0 overflowed to 0x12900088"
- 按值对 std::unordered_map<std:::string, std::atomic<unsigned int>> 进行排序
- {app.exe!_com_error::'vector delete destructor'(unsigned int)}