Click here to get back home

File operation on SP

 HomeNewsGroups | Search | About
 microsoft.public.smartphone    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
File operation on SP £Ã£Î£¹£¹ 12-29-2005
Posted by £Ã£Î£¹£¹ on December 29, 2005, 10:28 pm
Please log in for more thread options
Hi:

I'm under VC.net/Smart phone project, and I have some trouble with file
operation, pls see the following code snippet


//Create Test.xml and write something into it, for example csXML =
"<Diary></Diary>"

CFile file;
if (!file.Open( TEXT("\Test.xml"), CFile::modeCreate | CFile::modeWrite))
{
return;
}
if (file.GetLength() == 0) //first time writing
{
file.Write((LPCTSTR)csXML, csXML.GetLength());
}
file.Close();

////////////////////
//Read content out of Test.xml but pBuffer only contains '<', why?
CFile file;
if (!file.Open( TEXT("\Test.xml"), CFile::modeRead) )
{
ASSERT(FALSE);
}
int nFileLen = (int)file.GetLength();
char* pBuffer = new char[nFileLen + 2];
nFileLen = file.Read( pBuffer, nFileLen );
file.Close();
pBuffer[nFileLen] = '';
pBuffer[nFileLen+1] = ''; // in case 2-byte encoded



Similar ThreadsPosted
The operation has been refused error message October 21, 2007, 2:54 pm
How to get file November 10, 2005, 9:47 pm
Help need with cab file October 18, 2006, 4:05 am
Updating SIM file September 12, 2005, 2:05 pm
Updating SIM file September 12, 2005, 2:05 pm
File Not Supported December 9, 2005, 2:55 pm
Publishing Cab File April 24, 2006, 5:25 am
File sync October 27, 2006, 3:41 am
renaming wav file March 15, 2008, 8:07 pm
ActiveSync File Conduit? June 28, 2005, 8:50 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap