win10下c++通用开发杂记

1)

c++输出日志:

std::wstringstream wStringstream1;
wStringstream1 << L"An error occurred. " << e->ErrorCode.ToString()->Data() << L": " << e->ErrorMessage->Data() << L"\n";
OutputDebugString(wStringstream1.str().c_str());

2)

包括cocos2d-x的项目,以及VS2015 创建的"DirectX 11 和 XAML 项目"在内,使用Low Latency Input时都不能触发touch事件:

菜单->工具->选项->调试 将"启用 XAML 的 UI 调试工具" 关掉~~~


3)

工作线程跳转到主线程:

    auto workItemHandler = ref new WorkItemHandler([this](IAsyncAction ^)
    {
		if (_swapChainPanel)
		{
			_swapChainPanel->Dispatcher->RunAsync(Windows::UI::Core::CoreDispatcherPriority::Normal,
				ref new Windows::UI::Core::DispatchedHandler([this]()
			{
				if (_adControl)
				{
					unsigned int index;
					if (_swapChainPanel->Children->IndexOf(_adControl, &index))
					{
						_swapChainPanel->Children->RemoveAt(index);
					}
				}
			}));

		}
    });
	
    mInputLoopWorker = ThreadPool::RunAsync(workItemHandler, WorkItemPriority::High, WorkItemOptions::TimeSliced);


阅读更多
文章标签: win10 c++
个人分类: win10
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭