Originally posted by: swordingliang
I mean in what case the API CeRapiInit will return!
and if so, does it mean the both side connected?
thx!
Originally posted by: Will
Is there a way to tell if the connected device is running HPC2000 vs Pocket PC? Both return dwMajorVersion = 3 in CEOSVERSIONINFO.
ReplyOriginally posted by: Paraclete
Thanks for providing this code. However, it doesn't seem to handle the situation where the PPC device isn't connected. Then it just hangs.
The eVc 3.0 documentation indicates:
"A call to CeRapiInit does not return until the connection is made, an error occurs, or another thread calls CeRapiUninit. The CeRapiInitEx function does not block the calling thread. Instead, it uses an event to signal when initialization is complete."
Is there a version that uses CeRapiInitEx with a timeout?
TIA
ReplyOriginally posted by: Jose A. Vacas
IMO the copy loop is wrong.
If you try to copy a file 200 byte of size, it will copy a BUFFER_SIZE file.
I think this one does it better.
void CRencherRAPI::CopyFiletoWinCE(CString strFileNamePC, CString strFileNamePPC)
{
CFile oldFile;
oldFile.Open(strFileNamePC, CFile::modeRead |CFile::typeBinary);
int iLen = oldFile.GetLength();
iLen = iLen / BUFFER_SIZE;
BSTR bstr = strFileNamePPC.AllocSysString();
SysFreeString(bstr);
CeRapiInit();
HANDLE h
h = CeCreateFile(bstr, GENERIC_READ | GENERIC_WRITE, 0, NULL,
OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
char cTemp[BUFFER_SIZE];
DWORD nbytes;
int iTotBytes = 0;
int iReaded=0;
while((iReaded=oldFile.Read(&cTemp, BUFFER_SIZE)) >= 1)
CeWriteFile(h, &cTemp, (DWORD)iReaded, &nbytes, NULL);
CeCloseHandle(h);
oldFile.Close();
CeRapiUninit();
}
Originally posted by: Joe
When running the RAPI demo application it dies with a memory access violation as I hit the "Transfer" button.
I didn't modifiy the code at all, and have started the WinCe Handhelp PC Pro emulation. I've also tried it using the Palm-size PC 1.2 emulation.
I'm running Win2000 Pro.
I compiled the application using Visual C++ 6.0
The line of code where it dies is
CRencherRAPI::CopyFiletoWinCE(CString {"C:\test.txt"}, CString {"\test.txt"}) line 60 + 8 bytes
Anyone else have a similar problem?
Thanks,
joe
Originally posted by: Eunice
is copying file from pocket pc to pc and sharing file same??
do their use the same source code too??
Originally posted by: bms
will it work on emulation?
bms
Originally posted by: Christophe Labbe
Thank you for you article...
Reading that, I created a small exe ( inspired by your work ) I have put the code on an excellent site (for french developpers on Pocket PC ) : Codeppc.com
Cheers
Christophe
Originally posted by: option
There is a header file that i can't look for in your source file---Rapitest.h
ReplyOriginally posted by: nvolpe
Anyone know how to do a file transfer the other way from a ppc to pc?