Location:
Search - CString hex
Search list
Description: 打开一个TXT文件并显示在EDIT控件中
步骤:
1.新建一个基于对话框的工程,名称为ReadFile
2.在界面上添加一个按钮(IDC_BUTTON1)和一个文本编辑(IDC_EDIT1)
IDC_EDIT1的属性:多行、可下拉滚动条.
3.编辑按钮触发事件(void CReadFileDlg::OnButton1())
void CReadFileDlg::OnButton1()
{
// TODO: Add your control notification handler code here
CString sFileFilter=\"*.hex|*.hex\"
CString sFileName
CFileDialog fDlg(true,NULL,NULL,OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,sFileFilter,NULL)
fDlg.DoModal()
sFileName=fDlg.GetFileName()
if(sFileName!=\"\")
{
CFile file(sFileName,CFile::modeRead)
int nFileLength=file.GetLength()
char *buffer
HGLOBAL hgl=::GlobalAlloc(GMEM_MOVEABLE,nFileLength+1)
buffer=(char *)::GlobalLock(hgl)
file.Read(buffer,nFileLength)
SetDlgItemText(IDC_EDIT1,buffer)
::GlobalUnlock(hgl)
::GlobalFree(hgl)
}
UpdateData(false)
}
Platform: |
Size: 26089 |
Author: 这程子 |
Hits:
Description: CString数据类型转换为16进制的数据-redeem data type conversion of the 16-band data
Platform: |
Size: 37826 |
Author: 魏兴贤 |
Hits:
Description: Hex转换成CString-Hex conversion redeem
Platform: |
Size: 22627 |
Author: 郭喜春 |
Hits:
Description: CString数据类型转换为16进制的数据-redeem data type conversion of the 16-band data
Platform: |
Size: 37888 |
Author: 魏兴贤 |
Hits:
Description: Hex转换成CString-Hex conversion redeem
Platform: |
Size: 22528 |
Author: 郭喜春 |
Hits:
Description: 打开一个TXT文件并显示在EDIT控件中
步骤:
1.新建一个基于对话框的工程,名称为ReadFile
2.在界面上添加一个按钮(IDC_BUTTON1)和一个文本编辑(IDC_EDIT1)
IDC_EDIT1的属性:多行、可下拉滚动条.
3.编辑按钮触发事件(void CReadFileDlg::OnButton1())
void CReadFileDlg::OnButton1()
{
// TODO: Add your control notification handler code here
CString sFileFilter="*.hex|*.hex"
CString sFileName
CFileDialog fDlg(true,NULL,NULL,OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,sFileFilter,NULL)
fDlg.DoModal()
sFileName=fDlg.GetFileName()
if(sFileName!="")
{
CFile file(sFileName,CFile::modeRead)
int nFileLength=file.GetLength()
char *buffer
HGLOBAL hgl=::GlobalAlloc(GMEM_MOVEABLE,nFileLength+1)
buffer=(char *)::GlobalLock(hgl)
file.Read(buffer,nFileLength)
SetDlgItemText(IDC_EDIT1,buffer)
::GlobalUnlock(hgl)
::GlobalFree(hgl)
}
UpdateData(false)
}
-Open a TXT file and displayed in the EDIT control steps: 1. Create a new dialog-based project, known as the ReadFile2. In the interface to add a button (IDC_BUTTON1) and a text editor (IDC_EDIT1) IDC_EDIT1 properties: multi-line, can be drop-down scroll bar .3. Edit button trigger events (void CReadFileDlg:: OnButton1 ()) void CReadFileDlg:: OnButton1 () (//TODO: Add your control notification handler code here CString sFileFilter =*. hex |*. hex CString sFileName CFileDialog fDlg (true, NULL, NULL, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, sFileFilter, NULL) fDlg.DoModal () sFileName = fDlg.GetFileName () if (sFileName! =) (CFile file (sFileName, CFile:: modeRead) int nFileLength = file.GetLength () char* buffer HGLOBAL hgl =:: GlobalAlloc (GMEM_MOVEABLE, nFileLength+ 1) buffer = (char*):: GlobalLock (hgl) file.Read (buffer, nFileLength) SetDlgItemText (IDC_EDIT1, buffer):: GlobalUnlock (hgl):: GlobalFree (hgl)) UpdateData (false))
Platform: |
Size: 1888256 |
Author: 这程子 |
Hits:
Description: BSTR2, Bubble Sort2, Character to integer, CString s into char s. I am posting
, Letter count with linked list, MasterString - over 3,000 lines of hardcore string manipluation (classes, structs, functions ) etc,
string functions using both user defined & stdlib,
Writing to a file, A Simple Count String.cpp, ACCI 2 Decimal,Hex,octal.cpp,
ACCURATE and MODERN conversion .cpp, Ascii to Unicode and vice-versa.cpp,
Converts a numeric string to integer .cpp, Finds and replaces a string with a given string.cpp, GotoXY.cpp, how variables can exist in different scopes.cpp,
input and revers string.cpp, revers string 2.cpp, Searches if a textfile contains a string .cpp, simplest logic and most simplest password program .cpp, strcat,strcmp,strcpy(VB).cpp, string compare.cpp, string manip tutorial.cpp,
StriStr--This function is an ANSI version of strstr() with case insensitivity.cpp,
strrtrim.cpp, UPPER.C, VB string function.cpp
Platform: |
Size: 21504 |
Author: Ahmad |
Hits: