dcsimg
Results 1 to 20 of 20

Thread: Odd ball error

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2010
    Posts
    1,247

    Odd ball error

    The instruction at "0x73483f5a" referenced memory at "0x00000014". The memory could not be "read".

    This only happens when compiled and so I cannot debug it.

    Any thoughts what is is, or how I can fix it ?

  2. #2
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    18,993

    Re: Odd ball error

    Quote Originally Posted by AlexanderBB View Post
    The instruction at "0x73483f5a" referenced memory at "0x00000014". The memory could not be "read".
    From what I understand, the 1st 64K of memory is a page guard, reserved, cannot be read or written. Sounds like your code has a logic flaw somewhere. Assuming I'm not wrong, you'll want to look at your CopyMemory statements within your code, to start with.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2010
    Posts
    1,247

    Re: Odd ball error

    I realise my question may not be enough to offer a solution, and some code may help.

    Code:
    frmSelector.Caption = cTitle
    frmSelector.Show vbModal
    Res = frmSelector.Result
    and in frmselctor
    Code:
    Private retVal As String
    
    Public Property Let MyCaption(xx As String)
        Me.Caption = xx
    End Property
    
    Public Property Get Result() As String
        Result = retVal
    End Property
    
    Private Sub Check1_Click()
        retVal = Check1.Caption
        Unload Me
    End Sub
    
    Private Sub Check2_Click()
        retVal = Check2.Caption
       Unload Me
    End Sub
    The error occurs as one of the checkboxes is clicked. Is it something to do with Unloading the Form, then attempting the Property Get ?
    Although this seems to work fine in the editor/design mode.

  4. #4
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    18,993

    Re: Odd ball error

    What happens if you comment out those Unload Me statements?
    I know VB can't unload from a combobox click event, but am not sure about checkboxes.

    Also, are those checkboxes from VB or a custom control?

    edited: If that solves the problem, here is how I did it for a combobox
    1. Add a timer. Make its interval small like 20 ms and Enabled=False
    2. In the click event causing the problem, replace Unload Me with Timer1.Enabled = True
    3. In the timer's event: Timer1.Enabled = False: Unload Me
    ... Use your timer control's name
    Last edited by LaVolpe; May 21st, 2020 at 11:50 PM.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  5. #5

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2010
    Posts
    1,247

    Re: Odd ball error

    I set a Global string Retval2 instead of Retval, remmed out the Property Get, and Res= Retval2
    Compiled fine. 1st run okay. 2nd run error, 3rd run okay.
    Kindof suggests an intermittent problem of some kind, but it's only ever been with this VB6 exe.
    I'll add the timer and see what happens.
    The checkboxes were from the VB6 Toolbox(?) LH side.

  6. #6

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2010
    Posts
    1,247

    Re: Odd ball error

    Code:
    Private Sub Check1_Click()
        retval2 = Check1.Caption
        Timer1.Enabled = True
    End Sub
    
    Private Sub Check2_Click()
        retval2 = Check2.Caption
       Timer1.Enabled = True
    End Sub
    
    Private Sub Timer1_Timer()
    Timer1.Enabled = False
    Unload Me
    End Sub
    Is the timer correct? I set Enabled False and Interval 20. When I click the checkbox now, the whole thing is gone. No entry in Task manager .

  7. #7

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2010
    Posts
    1,247

    Re: Odd ball error

    I put a Msgbox "Made It here" a little later in the code (after reverting back from the Timer code).
    First run it showed the MsgBox then the error.
    The second time also the Msgbox but then something I've never seen before
    339
    Component 'MSCOMCTL.OCX' or one of its dependencies not correctly registered: a file is missing or invalid

  8. #8
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    13,152

    Re: Odd ball error

    You do know that when you unload a form it looses any values in its variables and then when you reference a var or property of that form after unloading it then it causes the form to be loaded again and with the default values again.

    Something like this would make more sense.

    Code:
    frmSelector.Caption = cTitle
    frmSelector.Show vbModal
    Res = frmSelector.Result
    unload frmSelector
    Code:
    Private Sub Check1_Click()
        retVal = Check1.Caption
        Me.Hide
    End Sub

  9. #9

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2010
    Posts
    1,247

    Re: Odd ball error

    DataMiser, I didn't know (or had forgotten about) 'Me.Hide'. What you suggested makes perfect sense and initial testing suggests it has solved all the problems and strange errors I was getting.
    Many thanks, I really needed this to work.

  10. #10
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    18,993

    Re: Odd ball error

    Quote Originally Posted by DataMiser View Post
    You do know that when you unload a form it looses any values in its variables and ... the form to be loaded again and with the default values again.
    Just to prevent any confusion. Public variables are not reset to defaults when unloading a form. They are reset when setting the form to Nothing or via user code in the form's load/unload events.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  11. #11
    PowerPoster
    Join Date
    Feb 2017
    Posts
    2,208

    Re: Odd ball error

    None of the variables of the form are reset in the form unload.

    And accessing properties declared in the code module of the form (like the code of post #3 does) does not load the form again.
    It is only accessing form's intrinsic properties (like .Caption or .Tag, Etc.), any control or property of a control that loads it.

  12. #12
    PowerPoster
    Join Date
    Feb 2017
    Posts
    2,208

    Re: Odd ball error

    Quote Originally Posted by AlexanderBB View Post
    I realise my question may not be enough to offer a solution, and some code may help.

    Code:
    frmSelector.Caption = cTitle
    frmSelector.Show vbModal
    Res = frmSelector.Result
    and in frmselctor
    Code:
    Private retVal As String
    
    Public Property Let MyCaption(xx As String)
        Me.Caption = xx
    End Property
    
    Public Property Get Result() As String
        Result = retVal
    End Property
    
    Private Sub Check1_Click()
        retVal = Check1.Caption
        Unload Me
    End Sub
    
    Private Sub Check2_Click()
        retVal = Check2.Caption
       Unload Me
    End Sub
    The error occurs as one of the checkboxes is clicked. Is it something to do with Unloading the Form, then attempting the Property Get ?
    Although this seems to work fine in the editor/design mode.
    Are you using standard VB checkboxes or something special?
    In principle, I don't see any problem with that code.

  13. #13
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    18,993

    Re: Odd ball error

    Quote Originally Posted by Eduardo- View Post
    Are you using standard VB checkboxes or something special?
    In post #5, he said standard checkboxes
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  14. #14
    PowerPoster
    Join Date
    Feb 2017
    Posts
    2,208

    Re: Odd ball error

    Quote Originally Posted by LaVolpe View Post
    In post #5, he said standard checkboxes
    Quote Originally Posted by AlexanderBB View Post
    The checkboxes were from the VB6 Toolbox(?) LH side.
    Every control appear there... but you are probably right.

  15. #15
    PowerPoster
    Join Date
    Feb 2017
    Posts
    2,208

    Re: Odd ball error

    What else is in the form, what other controls/objects?

  16. #16

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2010
    Posts
    1,247

    Re: Odd ball error

    There's 2 checkboxes, a label, an image control all integrated ones, plus a Listview control (from Components) which was the only one I had to add.
    I'll be using this solidly over the next 2 days which should prove if everything's okay now. Some daft thing I've done elsewhere may be playing a part but this Form is where the error showed up. Or the code calling it as a Msgbox right after that was never reached. Usually it was the error in msg #1. I couldn't step through to see any problems as it always worked (until compiled).

  17. #17
    PowerPoster
    Join Date
    Feb 2017
    Posts
    2,208

    Re: Odd ball error

    It is a weird error.
    What I would try:
    1) test the exe in another computer/OS if you can do that and see if the error also happen.
    2) try to make a small test project with the same form, and see if the error happen. In that case you might post it here.

  18. #18

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2010
    Posts
    1,247

    Re: Odd ball error

    Thanks Eduardo, I will certainly try that if it plays up. So far no problems after an hour. Seems what Datamiser said is magic, but I'd love to know why.

  19. #19
    PowerPoster
    Join Date
    Feb 2017
    Posts
    2,208

    Re: Odd ball error

    I never feel confortable when an error gets "resolved" without finding the real cause, because if something that should not happen happened, it means that there is something wrong somewhere (and it could manifest in some other form in the future or in some other place).
    But of course, some errors are very difficult to trace.

    Edit: one possibility is the last Windows update, that seems to be buggy.
    Last edited by Eduardo-; May 22nd, 2020 at 09:41 PM.

  20. #20

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2010
    Posts
    1,247

    Re: Odd ball error

    Ah, Eduardo I'm not using Windows 10. Quite agree resolving this would be a better result. I feel I've done something wonky, even though it still seems to be okay.
    It's too big/messy to show the whole thing, and it isn't standalone - gets data from ADODB connection to Access, and writes back to HDD etc. And of course I did it so anyone else would have had job following!

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width