// LiGUIDlg.cpp : implementation file
//
#include "stdafx.h"
#include "LiGUI"
#include "LiGUIDlg.h"#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif#include "stdio.h"   
#include "string.h" 
//#include <iostream>
//#include <fstream> 
/////////////////////////////////////////////////////////////////////////////
// CLiGUIDlg dialogCLiGUIDlg::CLiGUIDlg(CWnd* pParent /*=NULL*/)
: CDialog(CLiGUIDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CLiGUIDlg)
m_path = _T("");
m_output = _T("");
//}}AFX_DATA_INIT
// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}void CLiGUIDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CLiGUIDlg)
DDX_Text(pDX, IDC_EDIT2, m_path);
DDX_Text(pDX, IDC_EDIT1, m_output);
//}}AFX_DATA_MAP
}BEGIN_MESSAGE_MAP(CLiGUIDlg, CDialog)
//{{AFX_MSG_MAP(CLiGUIDlg)
ON_WM_PAINT()
ON_WM_QUERYDRAGICON()
ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
ON_BN_CLICKED(IDC_BUTTON2, OnButton2)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()/////////////////////////////////////////////////////////////////////////////
// CLiGUIDlg message handlersBOOL CLiGUIDlg::OnInitDialog()
{
CDialog::OnInitDialog(); // Set the icon for this dialog.  The framework does this automatically
//  when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon

// TODO: Add extra initialization here

return TRUE;  // return TRUE  unless you set the focus to a control
}// If you add a minimize button to your dialog, you will need the code below
//  to draw the icon.  For MFC applications using the document/view model,
//  this is automatically done for you by the framework.void CLiGUIDlg::OnPaint() 
{
if (IsIconic())
{
CPaintDC dc(this); // device context for painting SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0); // Center icon in client rectangle
int cxIcon = GetSystemMetrics(SM_CXICON);
int cyIcon = GetSystemMetrics(SM_CYICON);
CRect rect;
GetClientRect(&rect);
int x = (rect.Width() - cxIcon + 1) / 2;
int y = (rect.Height() - cyIcon + 1) / 2; // Draw the icon
dc.DrawIcon(x, y, m_hIcon);
}
else
{
CDialog::OnPaint();
}
}// The system calls this to obtain the cursor to display while the user drags
//  the minimized window.
HCURSOR CLiGUIDlg::OnQueryDragIcon()
{
return (HCURSOR) m_hIcon;
}void CLiGUIDlg::OnButton1() 
{
// TODO: Add your control notification handler code here
//显示文件打开对话框
CFileDialog dlg(TRUE, "SQL", "*.txt",OFN_HIDEREADONLY
|OFN_OVERWRITEPROMPT,"Text Files(*.txt)|*.txt|All Files(*.*)|*.*||");
if ( dlg.DoModal()!=IDOK ) return;
//获取文件的绝对路径
CString sFileName=dlg.GetPathName();
m_path = sFileName;
UpdateData(false);}void CLiGUIDlg::OnButton2() 
{
// TODO: Add your control notification handler code here
unsigned char st[100000];//有'\n'符号
unsigned char Ust[100000];//不含'\n'符号
//打开文件
CStdioFile out;
out.Open(m_path, CFile::modeRead);
CString sSql="",s,USql="";
//读取文件
do{
out.ReadString(s);
sSql=sSql+s+(char)13+(char)10;//这里多了"\r";
USql=USql+s;
}
while (out.GetPosition()!=out.GetLength());
out.Close();
if(sSql.GetLength() > 100000){
MessageBox("文件过大,请重新选择!");
}else{
strcpy ((char*)st,sSql.GetBuffer(0));
// MessageBox((char*)st,"");
strcpy ((char*)Ust,USql.GetBuffer(0));
m_output = "含有回车的数组输出 \r\n";
m_output = m_output + st;
m_output = m_output+"\r\n没有回车字符的数组输出\r\n"+Ust;
UpdateData(false);
}}
1>------ 已启动生成: 项目: wei, 配置: Debug Win32 ------
1>正在编译...
1>wei.cpp
1>d:\my documents\visual studio 2005\projects\wei\wei\wei.cpp(5) : fatal error C1083: 无法打开包括文件:“LiGUI”: No such file or directory
1>生成日志保存在“file://d:\My Documents\Visual Studio 2005\Projects\wei\wei\Debug\BuildLog.htm”
1>wei - 1 个错误,0 个警告
========== 生成: 0 已成功, 1 已失败, 0 最新, 0 已跳过 ==========
总是出现上述错误