//加密
typedef int (__stdcall *XX_RTea)(char* p,char* s,long l);
XX_RTea _XX_RTea;void CEncryptTestDlg::OnBnClickedButton1()
{
// TODO: 在此添加控件通知处理程序代码 UpdateData();
INT X=79;
CString str1,str2;
str2.Empty();
GetDlgItemText(IDC_EDIT1,str1);
if (!str1.IsEmpty())
{
_XX_RTea = (XX_RTea)GetProcAddress(hInstLibrary, "XX_RTea");
//BSTR bstr1;
//BSTR bstr2;
//bstr1 = str1.AllocSysString();
//X=_XX_RTea(bstr1,bstr2,RTea_License);
X=_XX_RTea(str1.GetBuffer(0),str2.GetBuffer(0),RTea_License); SetDlgItemText(IDC_EDIT2,str2);
}
UpdateData(FALSE);
}==========================
Windows 已在 TFEncryptTest.exe 中触发一个断点。其原因可能是堆被损坏,这也说明 TFEncryptTest.exe 中或它所加载的任何 DLL 中有 bug。输出窗口可能提供了更多诊断信息
=================================
---------------------------
Microsoft Visual C++ Debug Library
---------------------------
Debug Assertion Failed!Program: e:\SU\DSM\11\testICA\testICA\Debug\testICA.exe
File: dbgheap.c
Line: 1252Expression: _CrtIsValidHeapPointer(pUserData)For information on how your program can cause an assertion
failure, see the Visual C++ documentation on asserts.(Press Retry to debug the application)
---------------------------
终止(A) 重试(R) 忽略(I)
---------------------------不知道该怎么办?各位大侠给看看。
typedef int (__stdcall *XX_RTea)(char* p,char* s,long l);
XX_RTea _XX_RTea;void CEncryptTestDlg::OnBnClickedButton1()
{
// TODO: 在此添加控件通知处理程序代码 UpdateData();
INT X=79;
CString str1,str2;
str2.Empty();
GetDlgItemText(IDC_EDIT1,str1);
if (!str1.IsEmpty())
{
_XX_RTea = (XX_RTea)GetProcAddress(hInstLibrary, "XX_RTea");
//BSTR bstr1;
//BSTR bstr2;
//bstr1 = str1.AllocSysString();
//X=_XX_RTea(bstr1,bstr2,RTea_License);
X=_XX_RTea(str1.GetBuffer(0),str2.GetBuffer(0),RTea_License); SetDlgItemText(IDC_EDIT2,str2);
}
UpdateData(FALSE);
}==========================
Windows 已在 TFEncryptTest.exe 中触发一个断点。其原因可能是堆被损坏,这也说明 TFEncryptTest.exe 中或它所加载的任何 DLL 中有 bug。输出窗口可能提供了更多诊断信息
=================================
---------------------------
Microsoft Visual C++ Debug Library
---------------------------
Debug Assertion Failed!Program: e:\SU\DSM\11\testICA\testICA\Debug\testICA.exe
File: dbgheap.c
Line: 1252Expression: _CrtIsValidHeapPointer(pUserData)For information on how your program can cause an assertion
failure, see the Visual C++ documentation on asserts.(Press Retry to debug the application)
---------------------------
终止(A) 重试(R) 忽略(I)
---------------------------不知道该怎么办?各位大侠给看看。
解决方案 »
- VC统计ACCESS中表的记录数
- vc++获得焦点时,滚动鼠标的轮子,dBgrid 中的记录定位也上下滚动?如何实现
- 研究过泡泡龙的高手请进..
- socket多线程问题,请高手帮忙!
- 有关关闭程序之后进程依然存在的问题
- 《虚拟人生》,有没有一些角色可以控制其它角色的行为的啊?
- 如何将控件内的显示内容保存成JPG图片???
- 有哪位大虾知道下列地错误提示,谢谢。
- 如何在自己写的COM(用ATL)中调用别的COM对象,如NETMEETING3的INmCall接口?
- 怪事,包含CHtmlView的project出现连结问题!!!!(我可是用的wizard直接生成的啊!)
- 客户区画图保存到8位位图
- web使用Activex控件,控件能不能读取配置文件????
{
UpdateData();
INT X=79;
// CString str1,str2;
char str1[1000]; // 定义足够大的数组
char str2[1000]; // 定义足够大的数组
if (GetDlgItemText(IDC_EDIT1,str1,sizeof(str1)))
{
_XX_RTea = (XX_RTea)GetProcAddress(hInstLibrary, "XX_RTea");
X=_XX_RTea(str1,str2,RTea_License);
SetDlgItemText(IDC_EDIT2,str2);
}
UpdateData(FALSE); // 这行貌似没有意义。
}
这样是没问题了,但是为什么str1.GetBuffer(0)不行呢?
另外,GetBuffer用完后还需要执行ReleaseBuffer释放缓冲区。