wrappingduke
08-13-2008, 01:43 AM
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:
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:
' 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.
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:
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:
' 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.