Windows 7中的例外 [英] Exception in windows 7

查看:80
本文介绍了Windows 7中的例外的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Windows 7中有一个例外,但在Windows XP中没有例外.

I have an exception in windows 7, but no exception in windows xp.

Problem signature:
  Problem Event Name: APPCRASH
  Application Name: AVKarMakerMUI.dealio._1.0.35.exe
  Application Version: 0.0.0.0
  Application Timestamp: 4bc06cda
  The name of the module with the error: StackHash_e98d
  Version of the module with the error: 0.0.0.0
  The time stamp module with the error: 00000000
  Exception Code: c0000005
  Exception Offset: 007ab16a
  OS Version: 6.1.7229.2.0.0.256.1
  Language Code: 1049
  Additional Information 1: e98d
  Additional Information 2: e98dfca8bcf81bc1740adb135579ad53
  Additional Information 3: 6eab
  Additional Information 4: 6eabdd9e0dc94904be3b39a1c0583635

Read our privacy statement on the Internet:
  http://go.microsoft.com/fwlink/?linkid=104288&clcid=0x0419

If the privacy statement on the Internet is not available, check with its local variants:
  C: \ Windows \ system32 \ ru-RU \ erofflps.txt



在申请注册效果期间有效.
模块使用CRegKey将值写入注册表.可能是由于cdect和stdcall引起的堆栈问题?



It is in effect module during registration effects for application.
Module writes value to registry using CRegKey. Could it be stack problems because of cdect and stdcall? What can it be?

推荐答案

您需要管理员特权才能写入许多注册表.检查您的应用程序清单中的设置是否正确,或者以管理员身份运行.


将以下内容添加到清单中:
You need administrator privileges for writing to much of the registry. Check that your application has the correct settings in its manifest, or run as administrator.


Add the following to your manifest:
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
  <security>
    <requestedPrivileges>
      <requestedExecutionLevel level='requireAdministrator' uiAccess='false' />
    </requestedPrivileges>
  </security>
</trustInfo>


出于安全性高的原因,很难在Windows 7上进行编码.我拥有的最佳链接是
-> [ ^ ]
下载Windows7培训工具包的设置.一定会对您有帮助.
如果您的应用程序是COM应用程序,则不是在Comlevation名字对象或cocreateinstanceasadmin上进行搜索.
For high security reason it is difficult to code on windows 7. the best link i have is
->[^]
download the setup of Windows7Training kit. it will definately help you.
If your application is COM app than search on Com elevation moniker or cocreateinstanceasadmin.


用以下代码替换CRegKey的使用后问题解决了

如果(bReg)
{
HKEY hKey = NULL;
DWORD dwDisposition = 0;
如果(RegCreateKeyEx(
HKEY_LOCAL_MACHINE,
pszKey,
0,NULL,0,KEY_ALL_ACCESS,NULL,& hKey和& dwDisposition
)!= ERROR_SUCCESS)
{
:: MessageBoxW(NULL,L注册错误1",L注册",MB_OK);
返回;
}

if(RegSetValueEx(
hKey,
V_EFFECT_KEY_NAME,
0,
REG_EXPAND_SZ,
(const unsigned char *)pszName,
wcslen(pszName))!=错误_成功)
{
:: MessageBoxW(NULL,L注册错误2",L注册",MB_OK);
}

if(RegSetValueEx(
hKey,
V_EFFECT_KEY_GROUPNAME,
0,
REG_EXPAND_SZ,
(const unsigned char *)pszGroupName,
wcslen(pszGroupName))!=错误_成功)
{
:: MessageBoxW(NULL,L注册错误3",L注册",MB_OK);
}
}
其他
{
HKEY hKey = NULL;
DWORD dwDisposition = 0;
如果(RegDeleteKey(
HKEY_LOCAL_MACHINE,
pszKey
)!= ERROR_SUCCESS)
{
:: MessageBoxW(NULL,L取消注册错误1",L取消注册",MB_OK);
返回;
}
}
Problem solved after replacing usage of CRegKey with following code

if ( bReg )
{
HKEY hKey = NULL;
DWORD dwDisposition = 0;
if (RegCreateKeyEx(
HKEY_LOCAL_MACHINE,
pszKey,
0, NULL, 0, KEY_ALL_ACCESS, NULL, &hKey, &dwDisposition
) != ERROR_SUCCESS)
{
::MessageBoxW( NULL, L"Registration Error 1", L"Registration", MB_OK );
return;
}

if( RegSetValueEx(
hKey,
V_EFFECT_KEY_NAME,
0,
REG_EXPAND_SZ,
(const unsigned char *)pszName,
wcslen(pszName) ) != ERROR_SUCCESS)
{
::MessageBoxW( NULL, L"Registration Error 2", L"Registration", MB_OK );
}

if( RegSetValueEx(
hKey,
V_EFFECT_KEY_GROUPNAME,
0,
REG_EXPAND_SZ,
(const unsigned char *)pszGroupName,
wcslen(pszGroupName) ) != ERROR_SUCCESS)
{
::MessageBoxW( NULL, L"Registration Error 3", L"Registration", MB_OK );
}
}
else
{
HKEY hKey = NULL;
DWORD dwDisposition = 0;
if (RegDeleteKey(
HKEY_LOCAL_MACHINE,
pszKey
) != ERROR_SUCCESS)
{
::MessageBoxW( NULL, L"Unregistration Error 1", L"Unregistration", MB_OK );
return;
}
}


这篇关于Windows 7中的例外的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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