Welcome to Soft32 Forums!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

DESKTOPTODEVICE or RAPICopyPCFileToCE with PPC 2003

 
   Soft32 Home -> PDA -> Pocket PC Developer RSS
Next:  JScript & FileSystem (mscefile.dll) PPC2000 v..  
Author Message
Jerry Danks

External


Since: Sep 04, 2003
Posts: 1



(Msg. 1) Posted: Thu Sep 04, 2003 12:03 pm
Post subject: DESKTOPTODEVICE or RAPICopyPCFileToCE with PPC 2003
Archived from groups: microsoft>public>pocketpc>developer (more info?)

I have an application written with VB6 that successfully transfers an MS
Access database from the PC to the PPC 2002 device using the
DESKTOPTODEVICE API call. It also works with the RAPICopyPCFileToCE
function.

The problem is that these calls will not work with PPC 2003 devices. I am
able to use the "opposite" calls (DEVICETODESKTOP and RAPICopyCEFileToPC) to
get the .cdb file to the PC, but I can't get it to go back.

Does anyone have any ideas?

Thanks!
Back to top
Login to vote
Sainath Kesavan

External


Since: Sep 07, 2003
Posts: 3



(Msg. 2) Posted: Sun Sep 07, 2003 10:19 am
Post subject: Re: DESKTOPTODEVICE or RAPICopyPCFileToCE with PPC 2003 [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Hi,

On the pocket pc2003, if the file already exists on the device, the
desktoptodevice
call fails. You need to check for the file, and then copy it back to the
pocket pc.

Hope this helps

Sainath

"Jerry Danks" <jdanks.DeleteThis@wi.rr.com> wrote in message
news:ZfK5b.35762$hf1.5349@twister.rdc-kc.rr.com...
> I have an application written with VB6 that successfully transfers an MS
> Access database from the PC to the PPC 2002 device using the
> DESKTOPTODEVICE API call. It also works with the RAPICopyPCFileToCE
> function.
>
> The problem is that these calls will not work with PPC 2003 devices. I am
> able to use the "opposite" calls (DEVICETODESKTOP and RAPICopyCEFileToPC)
to
> get the .cdb file to the PC, but I can't get it to go back.
>
> Does anyone have any ideas?
>
> Thanks!
>
>
Back to top
Login to vote
Robert Bremers

External


Since: Aug 22, 2003
Posts: 5



(Msg. 3) Posted: Sun Sep 07, 2003 11:04 am
Post subject: Re: DESKTOPTODEVICE or RAPICopyPCFileToCE with PPC 2003 [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Jerry:

The overwrite in DESKTOPTODEVICE fails in PPc 2003. See following posts
from Access developers news group for solution using RAPI to delete the file
first. The recommmended revision also worked in my Access 2K code and
resolved the problem.

RB
---------------------------------------

Hi Robert, Jun,
there is one mistake in that code:
Wrong: lret = CeDeleteFile(StrPtr("\my documents\test.cdb"))
Right: lret = CeDeleteFile(StrConv("\my documents\test.cdb", vbUnicode))
The string needs to be converted to unicode and it works fine!
Thanks a lot for your help,
Greatings
Erwin

"Robert Bremers" <robert DeleteThis @brokerforce.com> wrote in message
news:<eHiwrxlbDHA.3896 DeleteThis @TK2MSFTNGP11.phx.gbl>...
> Jun:
>
> Thanks for the post. We will try this with our Access project, it is not
a
> vb.exe. I belive that your methods for initialize RAPI are the same in an
> Access module as the code you provide.
>
> Regards,
>
> RB
>
> "Jun Chen[MSFT]" <junchen DeleteThis @online.microsoft.com> wrote in message
> news:YM$qMKdbDHA.1996@cpmsftngxa06.phx.gbl...
> > Hi Robert,
> >
> > I am not sure if you have reviewed the sample code in KB #306368. I have
> > revised the code so that it can delete the file through the RAPI. Please
> > note that since it calls RAPI directly, there's no need to add any
> > references in the VB project:
> >
> > 1.Create a new Standard EXE project in Visual Basic.
> > 2.Place a command button on Form1.
> > 3.Paste the following code into Form1's code module:
> >
> > Option Explicit
> >
> > Private Sub Command1_Click()
> > Dim lret As Long
> > Dim lcon As Long
> >
> > ' Initialize RAPI
> > lcon = ConnectRapi
> > If lcon <> ERROR_SUCCESS Then
> > MsgBox "Failure to initialize RAPI"
> > Else
> > MsgBox "RAPI was initialized successfully"
> > End If
> >
> > lret = CeDeleteFile(StrPtr("\my documents\test.cdb"))
> >
> > ' Uninitialize RAPI
> > lcon = DisconnectRapi
> > If lcon <> ERROR_SUCCESS Then
> > MsgBox "Failure to uninitialize RAPI"
> > Else
> > MsgBox "RAPI was uninitialized successfully"
> > End If
> > End Sub
> >
> > 4. From the Project menu, click Add Module to add a .bas module to the
> > project.
> > Paste the following code into Module1:
> >
> > Option Explicit
> >
> > Public Const ERROR_SUCCESS = 0
> > Public Const REG_DWORD = 4
> > Public Const REG_SZ = 1
> >
> > Type RAPIINIT
> > cbsize As Long
> > heRapiInit As Long
> > hrRapiInit As Long
> > End Type
> >
> > Public Declare Function CeRapiUninit Lib "rapi.dll" () As Long
> >
> > Public Declare Function CeRapiInitEx Lib "rapi.dll" ( _
> > pRapiInit As RAPIINIT) As Long
> >
> > Public Declare Function CeDeleteFile Lib "rapi.dll" (ByVal lpFileName As
> > String) As Long
> >
> > ' Initialize RAPI
> > Public Function ConnectRapi() As Long
> > Dim lcon As Long
> > Dim lRapiInit As RAPIINIT
> >
> > With lRapiInit
> > .cbsize = Len(lRapiInit)
> > .heRapiInit = 0
> > .hrRapiInit = 0
> > End With
> >
> > lcon = CeRapiInitEx(lRapiInit)
> > ConnectRapi = lcon
> > End Function
> >
> > ' Uninitialize RAPI
> > Public Function DisconnectRapi() As Long
> > Dim lcon As Long
> > lcon = CeRapiUninit
> > DisconnectRapi = lcon
> > End Function
> >
> > 5.Make sure the connection between the device and the desktop is
working.
> > You must also have a partnership established.
> >
> > 6.Run the project, and then click Command1.
> >
> > Thanks,
> > Jun Chen
> >
> > This posting is provided "AS IS" with no warranties, and confers no
> rights.
> >

"Jerry Danks" <jdanks DeleteThis @wi.rr.com> wrote in message
news:ZfK5b.35762$hf1.5349@twister.rdc-kc.rr.com...
> I have an application written with VB6 that successfully transfers an MS
> Access database from the PC to the PPC 2002 device using the
> DESKTOPTODEVICE API call. It also works with the RAPICopyPCFileToCE
> function.
>
> The problem is that these calls will not work with PPC 2003 devices. I am
> able to use the "opposite" calls (DEVICETODESKTOP and RAPICopyCEFileToPC)
to
> get the .cdb file to the PC, but I can't get it to go back.
>
> Does anyone have any ideas?
>
> Thanks!
>
>
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Emulator 2003 and ActiveSync - As stated on the documentation, Emulator for pocket Pc 2003 can be used to connect to activesync and develop sync app...

Do PPC 2003 support DirectShow? - Do PPC 2003 support DirectShow?

Prog for Pocket PC 2003 - I have Windows Server 2003 & visualstudio .net 2003. What is the best way to develop applications for the pocket pc...

gsoap pocket pc 2003 - Hello, has anybody succeeded to compile and use gsoap on Pocket PC 2003 platform ? I am getting some compile errors re...

installing LSP in Pocket PC 2003 - Is anyone successful in installing LSP in Pocket PC 2003. I'm trying to do what is told in MSDN (Windows CE .NET 4.2)...

PPC 2003: CeRunAppAtTime not ALWAYS waking up device - Hi, Having problem that only sometimes the device wakes up when CeRunAppAtTime executes. Unfortunately I don't have a...
       Soft32 Home -> PDA -> Pocket PC Developer All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum

Categories:
 Windows
 Linux
 Mac
  PDA


[ Contact us | Terms of Service/Privacy Policy ]