程序如下:
BOOL CTestApp::InitInstance()
{
AfxEnableControlContainer();
CoInitialize(NULL);
CDlgLogin login;
if (login.DoModal() != IDOK)
{
return FALSE;
}
#ifdef _AFXDLL
Enable3dControls();// Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif
// Change the registry key under which our settings are stored.
// TODO: You should modify this string to be something appropriate
// such as the name of your company or organization.
SetRegistryKey(_T("Local AppWizard-Generated Applications"));
LoadStdProfileSettings(0); // Load standard INI file options (including MRU)对话框正确运行,但运行到SetRegistryKey出错,跟踪进程序后错误出现在
ASSERT(m_pszRegistryKey == NULL);
m_pszRegistryKey不为空,而且 CDlgLogin login;时就不为空了,这是什么原因造成的,怎样处理!
BOOL CTestApp::InitInstance()
{
AfxEnableControlContainer();
CoInitialize(NULL);
CDlgLogin login;
if (login.DoModal() != IDOK)
{
return FALSE;
}
#ifdef _AFXDLL
Enable3dControls();// Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif
// Change the registry key under which our settings are stored.
// TODO: You should modify this string to be something appropriate
// such as the name of your company or organization.
SetRegistryKey(_T("Local AppWizard-Generated Applications"));
LoadStdProfileSettings(0); // Load standard INI file options (including MRU)对话框正确运行,但运行到SetRegistryKey出错,跟踪进程序后错误出现在
ASSERT(m_pszRegistryKey == NULL);
m_pszRegistryKey不为空,而且 CDlgLogin login;时就不为空了,这是什么原因造成的,怎样处理!
解决方案 »
- VC++中怎么把一个字符串中的最后一个数字提取出来?
- VC中的窗口缩放
- 求教:为什么说使用非阻塞套接字 比使用 阻塞套接字 性能要好 效率要高啊。高分 求理论的解释
- 应用程序如何获得自己的文件名
- 怎么编写一个两球相撞的程序?
- 怎样更改CListCtrl(报表形式)的表头文字的颜色?---难道指数 高 ----------高手,斑竹请进
- 紧急求助,关于连接
- 那位大虾给俺讲讲http://www.csdn.net/Develop/read_article.asp?id=17437的传染机制
- 有关vc和系统的问题?
- 有关文件的问题
- syn包的问题
- VC关闭后再打开工程,却发现头文件视图里的头文件没了,类也没了,如何解决?
if (login.DoModal() != IDOK)
{
return FALSE;
}
放到Instance函数的LoadStdProfileSettings(0); // Load standard INI file options (including MRU)后面,return TRUE之前。
这样应该可以。
CAdoConnection m_sqlcon;
CAdoRecordSet m_sqlrec;
两个连接数据库的类成员,如果删除了就可以用了,但我需要连接数据库去验证密码。
TO QLFTL:你的办法不行,而且也是治标不治本的办法。
CAdoRecordSet m_sqlrec;有关?我的对话框类里也有ado和database ,没有你说的问题。
前再次把m_pszRegistryKey = NULL;看看!