Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Visual Basic
  4. reference problem

reference problem

Scheduled Pinned Locked Moved Visual Basic
help
6 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Ashraf Fathy
    wrote on last edited by
    #1

    hiii i made a dll to check on hdd serial number on application start,but if earase this dll the program just give an error but i can press continue so it will work normaly, i use try-catch when i define an object of that reference, but it always give me unhadled exception i want to this in case the user erease that file i don't want the program to run:omg:

    D 1 Reply Last reply
    0
    • A Ashraf Fathy

      hiii i made a dll to check on hdd serial number on application start,but if earase this dll the program just give an error but i can press continue so it will work normaly, i use try-catch when i define an object of that reference, but it always give me unhadled exception i want to this in case the user erease that file i don't want the program to run:omg:

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      Are you getting this Continue because your running a debug version of your code in the debugger? Try running a Release compiled version outside the development environment. Also, are you trying to handle specific exceptions in your try/catch block? Just use a catch block like this:

      Try
      ...some code that might fail...
      Catch ex As Exception
      ...exception handling code...
      Finally
      ...If you need to run code that must run in all cases...
      End Try

      RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

      A 1 Reply Last reply
      0
      • D Dave Kreskowiak

        Are you getting this Continue because your running a debug version of your code in the debugger? Try running a Release compiled version outside the development environment. Also, are you trying to handle specific exceptions in your try/catch block? Just use a catch block like this:

        Try
        ...some code that might fail...
        Catch ex As Exception
        ...exception handling code...
        Finally
        ...If you need to run code that must run in all cases...
        End Try

        RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

        A Offline
        A Offline
        Ashraf Fathy
        wrote on last edited by
        #3

        not working....i think when i try to call a reference not exist it not look to the try catch... Try Dim any_name As New reference1.class1 Catch ex As Exception MessageBox.Show("error") End Try when the reference1 is not aviliable it gives me the default error, not my custom error on the catch :confused::confused:

        D 1 Reply Last reply
        0
        • A Ashraf Fathy

          not working....i think when i try to call a reference not exist it not look to the try catch... Try Dim any_name As New reference1.class1 Catch ex As Exception MessageBox.Show("error") End Try when the reference1 is not aviliable it gives me the default error, not my custom error on the catch :confused::confused:

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          I don't think your going to be able to do what you want. When the reference is being bound to the .DLL, the file is missing? This would be a catastrophics failure (I think!)you can not catch. I take it this is part of a copy protection scheme? RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

          A 1 Reply Last reply
          0
          • D Dave Kreskowiak

            I don't think your going to be able to do what you want. When the reference is being bound to the .DLL, the file is missing? This would be a catastrophics failure (I think!)you can not catch. I take it this is part of a copy protection scheme? RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

            A Offline
            A Offline
            Ashraf Fathy
            wrote on last edited by
            #5

            i think i found some solution, if i made my call into a sub, then i call that sub between try and catch ;):)

            D 1 Reply Last reply
            0
            • A Ashraf Fathy

              i think i found some solution, if i made my call into a sub, then i call that sub between try and catch ;):)

              D Offline
              D Offline
              Dave Kreskowiak
              wrote on last edited by
              #6

              Apparently, I had my head somewhere it should not have been. I think you looking at this:

              Dim myFunction As myNamespace.myClass
              Try
              myFunction(myParameters)
              Catch
              ' Call failed code goes here...
              End Try

              RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups