CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Mar 1999
    Location
    Nepal
    Posts
    540

    Surprising error

    Today, I got an error

    Method '~' of object '~' failed

    It had a long negative number and couldn't be trapped. Does it make sense?


  2. #2
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    Re: Surprising error

    I got same error with non-registered dll or activex.exe. Also it occurred with remote component on machines with which I did not have enough permission on login, and with machines where RPC protocol was not active.
    Hope this help
    Cesare Imperiali

    Special thanks to Lothar "the Great" Haensler. Come back soon, you Guru.
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

  3. #3
    Join Date
    Mar 1999
    Location
    Nepal
    Posts
    540

    Re: Surprising error

    My program also uses a DLL written in C++. When I tried to register it using regsvr32, it failed, telling that the dll was corrupt. But when I copied the DLL to the System folder, the program worked, and in one rare case, gave that error. I couldn't trap the error from the IDE. When I compiled the program and ran the EXE, the program just terminated at that point, without any notification.

    How can I solve it?


  4. #4

    Re: Surprising error

    Since you have a dll written in c++ I suppose that you declare the function you are using somewhere (often done in a separate module or at the Declarations level of any vb file). In that case you can add a path to the dll if it is not in the system directory (where it really should be).
    But it is surprising that you get the error even if the dll is in the system dir. The ~ character reminds me of the destructor function of a c++ class... If you have written the dll yourself or have got access to the source code I would recommend a debugging session with Visual C++ or another C++ IDE.

    -----------------------
    Daniel Andersson

  5. #5
    Join Date
    Mar 1999
    Location
    Nepal
    Posts
    540

    Re: Surprising error

    It works nicely inmost of the cases. But in the case of one file (it is quite large), I get that error. I don't know why. Is there an easy way to debug through DLLs?


  6. #6
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    Re: Surprising error

    Since you use a C dll, I think you should debug it with Vc debugger. Sorry, I do not know how (I am just a Vb developer)...

    Special thanks to Lothar "the Great" Haensler. Come back soon, you Guru.
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

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

Featured