Inconsistant compiler result

Discussion in 'Questions (Windows Mobile)' started by glook, Mar 4, 2008.

  1. glook

    glook Member Licensed User

    I am not sure if this is a bug or a problem with my set-up:-

    Sometimes my program crashes on a "bitmap1.Dispose" command, but not every time. The error message is always the same - attached below.

    This small section of code had been working fine for some time, but I assumed my program was faulty. However, I could not find the problem.

    Then I discovered that the first compile after loading the IDE always produces an exe that works OK, but any re-compile after that, without re-starting the IDE, makes an exe that always has the error!

    I'm using optimized compile, version 6.05, no recent changes to libraries and believe ImageLib and other libs are the correct files on desktop and device. The error only happens on the device - .Net 2, WM5 and emulator for WM6. Un-optimized exe's do not have the error.

    Any ideas?

    (By the way, despite this little problem I think the optimized compiler is fantastic.)

    Geoff.
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    Is it possible to upload the code?
    The error message is related to closing an SQL connection.
     
  3. glook

    glook Member Licensed User

    Yes, but I isolated the failure point by inserting MsgBox's. All the SQL routines before and after this were checked by commenting out the problem section (which just loads a jpg into an Image control) and all work fine.

    The offending code section is below. It wouldn't be practical to upload the whole project, but I will PM you.

    Geoff.

    AddObject("bitmap1","Bitmap")
    bitmap1.New1(dlgOpen.File)
    w = bitmap1.Width
    h = bitmap1.Height
    OP_Setupform
    imgOP.Image = bitmap1.Value
    imgOP.Image = imgOP.Image
    bitmap1.Dispose * ERROR HERE *
    imgOP.Width = imgOP.Height*(w/h)
    lblOPname.Text=lblName.Text
    frmPM.Show
     
  4. Erel

    Erel Administrator Staff Member Licensed User

Loading...