Results 1 to 7 of 7

Thread: CeFindFirstFile function

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2008
    Posts
    13

    CeFindFirstFile function

    Hello,

    Attempting to call CeFindFirstFile in a VB 6 app using RAPI. However, I having some difficulty. I'm using the library RemoteCe.tlb from http://www.unsupportedsoftware.com/p...dev/vbrapi.htm to help w/ the function call.

    I'm receiving the error: "There are no more file" or Error # 18 from CeGetLastError(). However, the file I'm attempting to find w/ the function is in the directory.

    The file I'm attempting to find is created by a process using CeCreateProcess. The process is a java app. After the process is complete, I then invoke CeFindFirstFile.

    The odd thing about the error I'm receiving is, I was able to retrieve the file w/ CeFindFirstFile() when the process used a executable jar file. However, when I switched to a zip file, the same file is created but now the file can't be located.

    Here's a sample of code:
    Code:
    sArgs = "-Xbootclasspath/a:" & Chr(34) & _ sPathtoPPC & "jsr169.jar" & Chr(34) & " -Djava.class.path=" & Chr(34) & _ "\Storage Card\Myclasses.zip" &  Chr(34) & " MyJavaApp.Main " & _ Chr(34) & sProcess & Chr(34) 
    
    lRetVal = CeCreateProcess("\Storage Card\bin\cvm.exe", sArgs, vbNull, vbNull, 0, 0, vbNull, vbNull, vbNull, typProcessInfo) 
    
    sFilePath = "\Storage Card\database\" & sDataFile 
    
    lHandle = CeFindFirstFile(sFilePath, struct_FindData)
    Any help is appreciated.

  2. #2
    Frenzied Member
    Join Date
    Oct 2005
    Posts
    1,286

    Re: CeFindFirstFile function

    Does the process you created create the file you are looking for?
    If so, I am guessing that the process has not created the file by the time you look for it.
    Pete Vickers
    MVP - Device Application Development
    http://www.gui-innovations.com http://mobileworld.appamundi.com/blogs/

  3. #3

    Thread Starter
    New Member
    Join Date
    Sep 2008
    Posts
    13

    Re: CeFindFirstFile function

    Hello,

    Thx. for the reply. Yes, the process creates the file I'm looking for. I also provide some for the process to complete w/ the following code:

    Code:
    sPathtoPPC = "\Storage Card\MyDB\"
    'wait for process to complete
    For i = 15 to 0 Step -5
      lHandle = CeFindFile(sPathtoPPC & sDataFile, structData)
      If lHandle = INVALID_HANDLE then
       Debug.Print CeGetLastError   'returns 18
       Debug.Print CeRapiGetError   'returns "successful"
       Sleep 5000
      Else
       Exit For
      End If
    Next i
    As mentioned in the previous post, the odd thing about this is when I using an executable jar rather than a zip file, the function was able to find the file w/ no problem.

    any help is appreciated.
    Last edited by wrappingduke; Sep 24th, 2008 at 12:11 PM.

  4. #4
    Frenzied Member
    Join Date
    Oct 2005
    Posts
    1,286

    Re: CeFindFirstFile function

    I don't understand the bit about
    using an executable jar rather than a zip file
    Have you checked manually that the file exists OK?
    Pete Vickers
    MVP - Device Application Development
    http://www.gui-innovations.com http://mobileworld.appamundi.com/blogs/

  5. #5

    Thread Starter
    New Member
    Join Date
    Sep 2008
    Posts
    13

    Re: CeFindFirstFile function

    Hello Pete,

    Thanks for the response. It's appreciated. I apologize for the vague post. Originally, an executable jar was used as the process that was ran via CeCreateProcess. It appears that CeCreateProcess did not consistently run the jar file, so I switched a zip file to retain the java app or process to be executed.

    Yes, I checked manually to see if the file exists on device. I have copied the file to the desktop as well and the file is what it should be.

    W/ a little more investigation, it appears that the function can't find this newly created file w/ the existing RAPI connection. I've tried disconnecting (i.e. CeRapiUnit) after running the process on the device and then re-connecting to find the file but unfortunately, this did not work either. However, when I re-run the desktop app to run the process again on the device, the file is found.

    Any help is appreciated.

  6. #6
    Frenzied Member
    Join Date
    Oct 2005
    Posts
    1,286

    Re: CeFindFirstFile function

    I would write a quick app on the device just to create an empty file, and then try creating that app, and seeing if cefindfirstfile works.

    Other than that I don't know what to suggest next.
    Pete Vickers
    MVP - Device Application Development
    http://www.gui-innovations.com http://mobileworld.appamundi.com/blogs/

  7. #7

    Thread Starter
    New Member
    Join Date
    Sep 2008
    Posts
    13

    Re: CeFindFirstFile function

    Oh, ok. Thx. for your help.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width