C++MFC开发程序,使运行时首先弹出对话框,代码应写哪

来源:百度知道 编辑:UC知道 时间:2024/09/23 14:32:59
前题我是初学C++的,问题是这样的,我在用C++6.0MFC开发一个程序,软件是一个替换文件的功能,我的软件一运行就查找指定文件(如QQ.exe是否在c:\bin\目录下)的路径,如果路径不对,就弹出对话框选择路径,之后在保存路径地址到一个dat文件下,以使下次打开软件时不用在选择路径。

现在的问题是1.我这个代码要写在哪,我找不到主函数,是不是要写在主函数下。
另外一个问题:
1.为什么自动这生成的代码中,比如确定按钮的中文字“确定”的字符定议在哪个文件下了,为什么也找不到。我知道右键属性可以改变,但是我要找他的定议代码,因为我是想在我按下确定之后,按钮变为灰色,不可点,并显示已确定字样。

还有一个问题:怎么MFC给程序界面加上一个图片,或一个网站试的框框,好多软件都有这样的,我是想知道用哪个属性工具加的。

高手回答一下吧,我还正在冲满激情的开发中,希望你们指点一下,谢谢!

InitInstance() 在这个函数上添吧。mfc的winmain被隐藏了,所以找不着。。如果你不是用vc添加的mfc的话就是winmain了。

建议先看 孙鑫C++视频吧 很有用

用 boost的filesystem吧
//FileIO.h
#ifndef __FILE_IO_H__
#define __FILE_IO_H__

#include <fstream>
#include <iostream>
#include <string>
#include "clysedef.hpp"
#include <boost/function.hpp>
#include <vector>

class FileIO
{
public:
FileIO(void);
virtual ~FileIO(void);
static void writeFile(const std::string& fname, const char* buffer, u32 size);
static u8* readFile(const std::string& fname, u32& size);
static bool createDirectory(const std::string& dpathstr, const std::string& dname);
static bool renameDirectory(const std::string& dpath, const std::string& oldname, const std::string newname);
static bool removeDirectory(const std::string& dpathstr, const std::string& dname);
static bool copyFile(const std::string& srcpathstr,