Windows Phone Thoughts - Daily News, Views, Rants and Raves

Check out the hottest Windows Mobile devices at our Expansys store!


Digital Home Thoughts

Loading feed...

Laptop Thoughts

Loading feed...

Android Thoughts

Loading feed...




Go Back   Thoughts Media Forums > WINDOWS PHONE THOUGHTS > Windows Phone Developer

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 08-13-2008, 01:43 AM
wrappingduke
Pupil
Join Date: Mar 2008
Posts: 13
Default CeCreateFile function to invoke app

Hello,

Attempting to use Rapi function to run java application on Pocket PC using CeCreateProcess function. It appears that the invocation runs intermittently. That is, the app does not appear to consistently run and I'm wondering if the CeCreateProcess call maybe the reason.

Here's a sample:
Code:
Dim sArgs as string
dim structProcess as PROCESS_INFORMATION
 
sArgs =  "-Xbootclasspath/a:" & Chr(34) & "\Storage Card\database\jsr169.jar" & Chr(34) & _
"-classpath" & Chr(34) & "\Storage Card\MyJavaApp.jar" & Chr(34) & _
  Chr(34) & "Parm1" & Chr(34) 
 
Debug.Print sArgs
 
'result: -Xbootclasspath/a:"\Storage Card\database\jsr169.jar" -classpath "\Storage Card\MyJavaApp.jar" "Parm1"

 
CeCreateProcess "\Storage Card\bin\cvm.exe" & sArgs", _
    "", vbNull, vbNull, 0, 0, vbNull, vbNull, vbNull, typProcessInfo
I have also tried:
-Xbootclasspath/a:"\Storage Card\database\jsr169.jar" -classpath "\Storage Card\MyJavaApp.jar" myjavaapp.Main "Parm1"
which works sometimes, as well.

The java app ran on Pocket PC creates a text file on the PPC. However, I haven't been able to delete this file w/ the CeDeleteFile due to a sharing violation.

Here's the code used:
Code:
' create me a handle to a file of this type.
lngFileHandle = CeCreateFile(sPathtoPPC & sFile, GENERIC_READ,     FILE_SHARE_READ, vbNullString, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)
'file is read into buffer to copied
intRetVal = CeReadFile(lngFileHandle, bytBuffer(1), 16384, lngBytesRead, 0)
'handle is closed added 08/12/08
CeFindClose lngFileHandle   
'after file has been to desktop, the following is done
CeDeleteFile sPathtoPPC & "MyText1.DAT"
The odd thing about the delete issue is for those files that have been moved to PPC programmatically and not been created on the PPC, CeDeleteFile works fine. There's no issue with the delete.

any help is appreciated.

Last edited by wrappingduke; 08-15-2008 at 02:39 AM.. Reason: entered improper commands
 
Reply With Quote
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:35 PM.