在一个简单赋值的代码出现了:unhandled exception in oxc000000005 :Acess Violation
void Test:fuzhi()
{
double x,y;
x=1;
y=2;
}在别的Test的成员函数调用fuzhi()函数时 x=1出出现了
unhandled exception in oxc000000005 :Acess Violation如果我写成y=2;x=1;
则在y=2的时候出现 unhandled exception in oxc000000005 :Acess Violation为什么出现这样的错误?我想是不是我对.ini文件写了自定义的函数进行了频繁操作造成的,请高手帮我看看函数对不对:
int Test::ReadIntegerIni(CString fname, CString Section, CString Ident , int Default )
{
int Reasult;
Reasult = GetPrivateProfileInt(Section, Ident, Default, fname);
return Reasult;
}Void Test::WritePrivateProfileString(CString fname, CString Section, CString Ident , double value )
{
CString str;
str.Format("%d",value);
WritePrivateProfileString(section,Ident,str,fname );
}我同时还写了两个类似对 float 型数据读写操作的函数, 在类函数里频繁的调用了这些读写函数, 这样对吗?
void Test:fuzhi()
{
double x,y;
x=1;
y=2;
}在别的Test的成员函数调用fuzhi()函数时 x=1出出现了
unhandled exception in oxc000000005 :Acess Violation如果我写成y=2;x=1;
则在y=2的时候出现 unhandled exception in oxc000000005 :Acess Violation为什么出现这样的错误?我想是不是我对.ini文件写了自定义的函数进行了频繁操作造成的,请高手帮我看看函数对不对:
int Test::ReadIntegerIni(CString fname, CString Section, CString Ident , int Default )
{
int Reasult;
Reasult = GetPrivateProfileInt(Section, Ident, Default, fname);
return Reasult;
}Void Test::WritePrivateProfileString(CString fname, CString Section, CString Ident , double value )
{
CString str;
str.Format("%d",value);
WritePrivateProfileString(section,Ident,str,fname );
}我同时还写了两个类似对 float 型数据读写操作的函数, 在类函数里频繁的调用了这些读写函数, 这样对吗?
解决方案 »
- BMP裁剪,高手来啊
- 更改MDI子窗口的标题总是不对
- vc解析xml函数参数个数的疑惑!
- 各位大侠紧急求助????!!!在NT service程序中调用mouse_event模拟鼠标按键不起作用?
- CListCtrl 的选定
- 请哪位告诉我一声实现树形控件浏览本机目录和文件用哪一控件或技术?
- 菜鸟问题:?????急急急!!!!!
- 求关于用SAPI开发的语音识别的简单例子
- 不太明白socket非堵塞//第一次setsocketopt不已经设置超时了吗?//第二次设置的不也是超时吗???
- 为什么我的程序在调试模式下运行正常,可一旦真正运行却又报错,或者执行错误呢?
- 动态库中使用ADO和一般应用程序使用ADO有什么需要注意的事情
- 关于类的线程函数
打断点调试
double x,y;
x=1;
y=2;
这样的地方怎么调试啊....
其中 我 fname = "//test.ini"; 这样写对吗?