VC中怎么能把编辑框的内容一下全部转到列表框里面,格式不变!
我是编了一个打开txt文档的程序,但是打开后在编辑框里,我想给他弄到列表框里,虽然没分了,但是很急很急,求大侠们帮忙啦,急求!...
我是编了一个打开txt文档的程序,但是打开后在编辑框里,我想给他弄到列表框里,虽然没分了,但是很急很急,求大侠们帮忙啦,急求!
展开
2个回答
2011-05-24
展开全部
char strResult[128];
char strText[1024+1];
int counts;
int i;
{
typedef int (WINAPI ICEPUB_READFILETOTEXT)( char *strFilename,char *strText,int maxLen);
ICEPUB_READFILETOTEXT *icePub_readFileToText = 0;
HINSTANCE hDLLDrv = LoadLibrary("icePubDll.dll");
if(hDLLDrv)
{
icePub_readFileToText = (ICEPUB_READFILETOTEXT *)GetProcAddress(hDLLDrv, "icePub_readFileToText");
}
if(icePub_readFileToText != NULL)
{
icePub_readFileToText("悔纤a.txt"碧搭仿,strText,1024);
}
if(hDLLDrv)
FreeLibrary(hDLLDrv);
}
counts=0;
{
typedef int (WINAPI ICEPUB_COUNTSUBSTRING)(char *strFormTitle,int keyValue,int extendFlag);
ICEPUB_COUNTSUBSTRING *icePub_countSubString = 0;
HINSTANCE hDLLDrv = LoadLibrary("icePubDll.dll");
if(hDLLDrv)
{
icePub_countSubString = (ICEPUB_COUNTSUBSTRING *)GetProcAddress(hDLLDrv, "icePub_countSubString");
}
if(icePub_countSubString)
{
counts = icePub_countSubString(strText,"\r\n");
}
if(hDLLDrv)
FreeLibrary(hDLLDrv);
}
{
typedef int (WINAPI ICEPUB_GETFORMATSTRING)( char *sourceStr,int index,char *strFenge,char *strSubResult);
ICEPUB_GETFORMATSTRING *icePub_getFormatString = 0;
HINSTANCE hDLLDrv = LoadLibrary("icePubDll.dll");
if(hDLLDrv)
{
icePub_getFormatString = (ICEPUB_GETFORMATSTRING *)GetProcAddress(hDLLDrv, "icePub_getFormatString");
}
if(icePub_getFormatString)
{
for(i=0;i<枝粗counts;i++)
{
retCode = icePub_getFormatString(strText,i,"\r\n",strResult);
//AfxMessageBox(strResult);
m_List.AddString(strResult);
}
}
if(hDLLDrv)
FreeLibrary(hDLLDrv);
}
http://dl.icese.net/dev.php?f=icePubDll.rar 下载
char strText[1024+1];
int counts;
int i;
{
typedef int (WINAPI ICEPUB_READFILETOTEXT)( char *strFilename,char *strText,int maxLen);
ICEPUB_READFILETOTEXT *icePub_readFileToText = 0;
HINSTANCE hDLLDrv = LoadLibrary("icePubDll.dll");
if(hDLLDrv)
{
icePub_readFileToText = (ICEPUB_READFILETOTEXT *)GetProcAddress(hDLLDrv, "icePub_readFileToText");
}
if(icePub_readFileToText != NULL)
{
icePub_readFileToText("悔纤a.txt"碧搭仿,strText,1024);
}
if(hDLLDrv)
FreeLibrary(hDLLDrv);
}
counts=0;
{
typedef int (WINAPI ICEPUB_COUNTSUBSTRING)(char *strFormTitle,int keyValue,int extendFlag);
ICEPUB_COUNTSUBSTRING *icePub_countSubString = 0;
HINSTANCE hDLLDrv = LoadLibrary("icePubDll.dll");
if(hDLLDrv)
{
icePub_countSubString = (ICEPUB_COUNTSUBSTRING *)GetProcAddress(hDLLDrv, "icePub_countSubString");
}
if(icePub_countSubString)
{
counts = icePub_countSubString(strText,"\r\n");
}
if(hDLLDrv)
FreeLibrary(hDLLDrv);
}
{
typedef int (WINAPI ICEPUB_GETFORMATSTRING)( char *sourceStr,int index,char *strFenge,char *strSubResult);
ICEPUB_GETFORMATSTRING *icePub_getFormatString = 0;
HINSTANCE hDLLDrv = LoadLibrary("icePubDll.dll");
if(hDLLDrv)
{
icePub_getFormatString = (ICEPUB_GETFORMATSTRING *)GetProcAddress(hDLLDrv, "icePub_getFormatString");
}
if(icePub_getFormatString)
{
for(i=0;i<枝粗counts;i++)
{
retCode = icePub_getFormatString(strText,i,"\r\n",strResult);
//AfxMessageBox(strResult);
m_List.AddString(strResult);
}
}
if(hDLLDrv)
FreeLibrary(hDLLDrv);
}
http://dl.icese.net/dev.php?f=icePubDll.rar 下载
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询