locked
The instruction at '0x000002c' referenced memory at '0x000002c. The memory could not be "read". RRS feed

  • Question

  • I am using VB.NET 2010 and accessing a DLL that was created in VB6.
    I added the DLL in the References, and in the program I do the following:
    Dim RTF As myDLL.clsRTF
    Dim s as string

    RTF = New myDLL.clsRTF
    s = RTF.RTFTOTEXT(somevariable)

    RTF = Nothing

    If I run the program from Visual Studio, the program closes fine with no error.
    But, wheI close my program (either by clicking on the "x" on the program or if I add "End" in it), I got the error "The instruction at '0x000002c' referenced memory at '0x000002c. The memory could not be "read". Click on OK to terminate the program"

    When I added Finalize() in the FormClosing, I don't get the error anymore, but the EXE stays in the Task Manager.

    If I only initialize the DLL (Dim RTF As myDLL.clsRTF and RTF = New myDLL.clsRTF) and don't call the function inside the DLL (s = RTF.RTFTOTEXT(somevariable)), I don't get the error.
    But, I need to call that function inside that DLL.

    How can I fix this problem ?
    Thank you.

     

     

     

     


    Sunday, December 11, 2011 11:32 PM

Answers

  • I did not even know this was possible, but have you installed the correct VB6 runtimes with your application and registered them all.

    Be aware I've never done this and also never heard this did run. Also be aware that if it runs, it will probably be a short while and fail on newer OS systems.

     

     


    Success
    Cor
    • Proposed as answer by Adam_Turner Monday, December 12, 2011 12:58 PM
    • Marked as answer by Mike Feng Tuesday, December 20, 2011 3:30 PM
    Monday, December 12, 2011 6:05 AM

All replies

  • Of not. Usually the first page of a process is not readable to generate an exception when someone has faulty code.

    Renee


    "MODERN PROGRAMMING is deficient in elementary ways BECAUSE of problems INTRODUCED by MODERN PROGRAMMING." Me
    Sunday, December 11, 2011 11:47 PM
  • I am not sure I understand your reply.
    Can you please elaborate ?
    Thank you.
    Monday, December 12, 2011 12:05 AM
  • It fails by design.

    Renee


    "MODERN PROGRAMMING is deficient in elementary ways BECAUSE of problems INTRODUCED by MODERN PROGRAMMING." Me
    Monday, December 12, 2011 12:08 AM
  • So, there is nothing I can do to supress that error when closing the program ?
    When I added Finalize() in the FormClosing, I don't get the error anymore, but the EXE stays in the Task Manager.


    Monday, December 12, 2011 12:22 AM
  • If course there is. You can fix the accvio your getting.

    Renee


    "MODERN PROGRAMMING is deficient in elementary ways BECAUSE of problems INTRODUCED by MODERN PROGRAMMING." Me
    Monday, December 12, 2011 12:44 AM
  • How can I do that ?
    Monday, December 12, 2011 2:51 AM
  • I did not even know this was possible, but have you installed the correct VB6 runtimes with your application and registered them all.

    Be aware I've never done this and also never heard this did run. Also be aware that if it runs, it will probably be a short while and fail on newer OS systems.

     

     


    Success
    Cor
    • Proposed as answer by Adam_Turner Monday, December 12, 2011 12:58 PM
    • Marked as answer by Mike Feng Tuesday, December 20, 2011 3:30 PM
    Monday, December 12, 2011 6:05 AM
  • Did you mean you didn't think a VB6 ActiveX controls would run in a VB.NET 2010 ?
    Monday, December 12, 2011 12:31 PM
  • I saw some replies from Paul about it, but since Windows 7 those replies have also more and more the content: "Forget it", but like I said, I'm not a specialist on this. I've only seen many messages around this in newsgroups and forums, which ended mostly that it did fail.

     


    Success
    Cor
    Monday, December 12, 2011 12:41 PM