您的位置:程序门 -> vc/mfc -> 基础类



超级菜鸟


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


超级菜鸟[已结贴,结贴人:zcxrollrock]
发表于:2007-07-26 16:42:50 楼主
#include <afx.h>
#include <stdio.h>
int   main()
{
int   lo,hi;
cstring   str;
cstdiofile   ffibo;
ffibo.open( "fibo.dat ",cfile::modewrite ¦cfile::modecreate ¦cfile::typetext);
str.format( "%s\n ", "fibonacci   squencee,less   than   100: ");
printf( "%s ",(lpctstr)str);
ffibo.writestring(str);
lo=hi=1;
str.format( "%d\n ",lo);
printf( "%s ",(lpctstr)str);
ffibo.writestring(str);
while(hi <100)
{
str.format( "%d\n ",hi);
printf( "%s ",(lpctstr)str);
ffibo.writestring(str);
hi=lo+hi;
lo=hi-lo;
}
ffibo.close();
return   0;
}
这是从侯大师的书上找的   p36   可是调试时有这样的错误:
fatal   error   c1189:   #error   :     building   mfc   application   with   /md[d]   (crt   dll   version)   requires   mfc   shared   dll   version.   please   #define   _afxdll   or   do   not   use   /md[d]
不知道是什么意思   ???
发表于:2007-07-26 16:47:431楼 得分:0
还有就是书上说:编译时需指定/mt,表示使用多线程版本的c   runtime函数库
我应该怎么指定/mt啊???
发表于:2007-07-26 16:58:582楼 得分:0
在项目属性中
你的vc   什么版本?
2003  
    项目   ->   xxx属性   ->   配置属性   ->   c++   ->   代码生成   ->   运行时库   ->   多线程
6.0
    project   ->   setting   ->   c++   ->   category:code   generation   ->   use   run-time   library   ->   multithreaded
发表于:2007-07-26 17:19:083楼 得分:0
问题出在cstdiofile   此为mfc的类   但是你没用mfc吧
肯定是win32程序   当然不行
#include <afx.h>   也为mfc的   在win32程序中不能使用
发表于:2007-07-26 18:21:384楼 得分:0
我用的是vs2005中文版的       找来找去都不知道怎么去用mfc是否有高人指点   ,就比如说举个一般的例子吧   把步骤跟我讲下   或者是告诉我哪里可以找到这样的步骤的   谢谢了
发表于:2007-07-26 18:32:335楼 得分:0
不是吧随便找一本书都有详细的步骤:
1.新建工程-> 选mfc(exe)-> dialg模式
2.next.next.....就行了
发表于:2007-07-26 19:06:286楼 得分:0
http://www.codeproject.com/managedcpp/hostmfc.asp

vs2005很不容易使用mfc的,而且各方面还有许多不爽.
  你还是装一个vc6.0吧.也不是很大..
发表于:2007-07-26 19:06:597楼 得分:0
想学c#装.net  
想学vc装vc6.0
发表于:2007-07-27 12:59:208楼 得分:0
vs   2005好用啊而且对话框界面也比vc6.0漂亮
发表于:2007-07-29 08:59:129楼 得分:20
新建工程-> 选mfc(exe)-> dialg模式


快速检索

最新资讯
热门点击