陷入mbstowcs C ++ [英] Stuck in mbstowcs C++

查看:100
本文介绍了陷入mbstowcs C ++的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用MFC在Visual Studio 2008 C ++中工作。

I am working in Visual Studio 2008 C++ using MFC.

我遇到的问题是,当我退出程序时,进程会继续运行否则关闭。 当我点击暂停时,它会停在mbstowcs.c,第309行:  return _mbstowcs_s_l(pConvertedChars,pwcs,sizeInWords,s,n,
NULL);  整个调用堆栈如下所示。

I've run into the problem that sometimes when I exit my program, a process continues to run though everything else is closed.  When I click pause, it stops in mbstowcs.c, line 309:  return _mbstowcs_s_l(pConvertedChars, pwcs, sizeInWords, s, n, NULL);   The entire Call Stack is listed below.

   kernel32.dll!7c812afb() 

   [以下框架可能不正确和/或缺失,没有为kernel32.dll加载符号] 

   kernel32.dll!7c812afb() 

   kernel32。 dll!7c85ada0() 

>  msvcr90d.dll!mbstowcs_s(unsigned int * pConvertedChars = 0x7c85b078,wchar_t * pwcs = 0x00000000,unsigned int sizeInWords = 1243916,const char * s = 0x102d5c8b ,unsigned int n = 1231588) 第309行+ 0x1b字节  C ++

   kernel32.dll!7c839ad8()

  kernel32.dll!7c812afb()  
  [Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll] 
  kernel32.dll!7c812afb()  
  kernel32.dll!7c85ada0()  
> msvcr90d.dll!mbstowcs_s(unsigned int * pConvertedChars=0x7c85b078, wchar_t * pwcs=0x00000000, unsigned int sizeInWords=1243916, const char * s=0x102d5c8b, unsigned int n=1231588)  Line 309 + 0x1b bytes C++
  kernel32.dll!7c839ad8()

没有错误被抛出,它只是冻结,好像卡在一个无限循环。 由于我的代码都没有列在调用堆栈中,我不知道是什么导致了这一点。 有没有人有什么想法?

No errors are thrown, it just freezes as if stuck in an infinite loop.  Since none of my code is listed in the Call Stack, I have no idea what could be causing this.  Does anyone have any ideas?

- 大卫

推荐答案

*免责声明*黑暗的猜测在这里出现:

*disclaimer* Wild shot in the dark guess coming up here:

我打赌你有一些代码正在运行,因为CRT正在关闭。  一旦无法获取区域设置/代码页信息,mbstowcs就不会起作用。

I bet you have some code running as the CRT is shutting down.  mbstowcs will not likely work once it can't obtain locale/codepage information.

也许你的线程仍在运行,主要退出并开始清理CRT后正在执行?

Maybe you have threads still running that are executing after your main exits and starts cleaning up the CRT?

或许您有静态对象(在文件范围内声明的对象),其析构函数在atexit处理程序中的主要退出后运行?

Or maybe you have static objects (objects declared at file scope) whose destructors run after main exits in the atexit handlers?


这篇关于陷入mbstowcs C ++的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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