00001
00010
#include "stdafx.h"
00011
#include "nExpCsv.h"
00012
00032 STATUS LNPUBLIC
ExportView(
00033 VIEWIXDATA *ViewData,
00034 WORD Flags,
00035 HMODULE hModule,
00036
char *AltLibraryName,
00037
char *FileName)
00038 {
00039
00040 AFX_MANAGE_STATE(AfxGetStaticModuleState());
00041
00042
00043 CnExpCsvApp *app = (CnExpCsvApp*)AfxGetApp();
00044
return app->DoExport(ViewData, Flags, hModule, AltLibraryName, FileName);
00045 }
00046
00047
00059 LNSTATUS
ReplaceAll(LNString &strText,
const LNString &strFrom,
const LNString &strTo)
00060 {
00061
if (strFrom == strTo)
return LNNOERROR;
00062
00063
try {
00064 LNINT nFromCount = strFrom.GetCharacterCount();
00065 LNINT nToCount = strTo.GetCharacterCount();
00066
00067 LNINT pos = 0, loc;
00068
00069
if (nFromCount == nToCount) {
00070
00071
while (LNWARN_NOT_FOUND != strText.Find(strFrom, pos, &loc) ) {
00072 strText.Replace( loc, nToCount, strTo );
00073 pos = loc + nToCount;
00074 }
00075 }
else {
00076
00077
while (LNWARN_NOT_FOUND != strText.Find(strFrom, pos, &loc) ) {
00078 strText.Delete( loc, nFromCount );
00079
if (nToCount > 0) strText.Insert( loc, strTo );
00080 pos = loc + nToCount;
00081 }
00082 }
00083 }
catch (LNSTATUS Lnerror) {
00084
char ErrorBuf[LNERROR_MESSAGE_LENGTH];
00085 LNGetErrorMessage(Lnerror, ErrorBuf);
00086 AfxMessageBox(ErrorBuf);
00087
return Lnerror;
00088 }
00089
return LNNOERROR;
00090 }