combase错误(尚未调用CoInitialize) [英] combase error (CoInitialize has not been called)

查看:131
本文介绍了combase错误(尚未调用CoInitialize)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

onecore \ com \ combase \ objact \ objact.cxx(812)\ combase.dll!00007FF8BD322169:(调用者:00007FF8BD320F78)ReturnHr(1)tid(b54)800401F0尚未调用CoInitialize.

onecore\com\combase\objact\objact.cxx(812)\combase.dll!00007FF8BD322169: (caller: 00007FF8BD320F78) ReturnHr(1) tid(b54) 800401F0 CoInitialize has not been called.

我正在使用Visual Studio 2015,已经开始收到以下错误消息.我不是想写dll或使用COM对象或其他任何东西.这只是一个简单的OpenGL程序.我不知道此错误消息是从哪里来的.我如何摆脱它?

I'm using Visual Studio 2015 and have started receiving the following error message. I'm not trying to write dll's or using COM objects or whatever. It's just a simple OpenGL program. I have no idea where this error message has come from. How do I get rid of it?

推荐答案

您正在隐式使用COM.没有代码,我们将不知所措.可能来自shell api,通用文件对话框,操纵杆处理等.

You are using COM implicitly. Without code, we don't know exacly. It could be something from shell api, common file dialog, joystick handling etc.

您需要将 CoInitialize(0); 放在某些主要函数(或WinMain或wWinMain)的开头,并将 CoUninitialize(); 放在函数末尾.如果需要使用特定的并发模型,还可以使用 CoInitializeEx .

You need to put CoInitialize( 0 ); at the beginning of some main function (or WinMain or wWinMain), and CoUninitialize(); at function end. There is also CoInitializeEx if you need to use specific concurrency model.

CoInitialize描述

这篇关于combase错误(尚未调用CoInitialize)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆