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
  1. Home
  2. General Programming
  3. C#
  4. CSharp equivalent functions

CSharp equivalent functions

Scheduled Pinned Locked Moved C#
6 Posts 4 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.
  • B Offline
    B Offline
    BINOVAR
    wrote on last edited by
    #1

    1.What is the equivalent settings for option strict on and option explicit on in c# ? 2.I have a class in another project ( VC++). I want to access the methods and properties in VC++ class from my project in C#. The VC++ is a standalone EXE project and hence I cant add any reference to my project. But in VB I found a method named GetObject( "AssemblyName") to retrieve the object in runtime. As VB.Net supports early binding by setting option explicit ON , the methods and properties of the VC++ class can be accessed by creating an instance of system.object. Can anyone please tell me how can we do the same in C#.net ? 3.Is there any C# equivalent function for "ON ERROR RESUME NEXT" in VB ? We can use Try catch but catch block will be excuted if any error occur in try block.

    D S C 3 Replies Last reply
    0
    • B BINOVAR

      1.What is the equivalent settings for option strict on and option explicit on in c# ? 2.I have a class in another project ( VC++). I want to access the methods and properties in VC++ class from my project in C#. The VC++ is a standalone EXE project and hence I cant add any reference to my project. But in VB I found a method named GetObject( "AssemblyName") to retrieve the object in runtime. As VB.Net supports early binding by setting option explicit ON , the methods and properties of the VC++ class can be accessed by creating an instance of system.object. Can anyone please tell me how can we do the same in C#.net ? 3.Is there any C# equivalent function for "ON ERROR RESUME NEXT" in VB ? We can use Try catch but catch block will be excuted if any error occur in try block.

      D Offline
      D Offline
      Dan Neely
      wrote on last edited by
      #2

      BINOVAR wrote:

      1.What is the equivalent settings for option strict on and option explicit on in c# ?

      There isn't one. These constraints are always enforced and cannot be disabled.

      BINOVAR wrote:

      2.I have a class in another project ( VC++). I want to access the methods and properties in VC++ class from my project in C#. The VC++ is a standalone EXE project and hence I cant add any reference to my project. But in VB I found a method named GetObject( "AssemblyName") to retrieve the object in runtime. As VB.Net supports early binding by setting option explicit ON , the methods and properties of the VC++ class can be accessed by creating an instance of system.object. Can anyone please tell me how can we do the same in C#.net ?

      Look into p/invoke; I know you can access native dll's that way, I've never tried abusing an exe like that. Worst case would be writing a VB.net wrapper dll and calling that from C#.

      BINOVAR wrote:

      3.Is there any C# equivalent function for "ON ERROR RESUME NEXT" in VB ? We can use Try catch but catch block will be excuted if any error occur in try block.

      No. And you shouldn't be using it in VB either unless you like corrupting your state and data.

      Today's lesson is brought to you by the word "niggardly". Remember kids, don't attribute to racism what can be explained by Scandinavian language roots. -- Robert Royall

      1 Reply Last reply
      0
      • B BINOVAR

        1.What is the equivalent settings for option strict on and option explicit on in c# ? 2.I have a class in another project ( VC++). I want to access the methods and properties in VC++ class from my project in C#. The VC++ is a standalone EXE project and hence I cant add any reference to my project. But in VB I found a method named GetObject( "AssemblyName") to retrieve the object in runtime. As VB.Net supports early binding by setting option explicit ON , the methods and properties of the VC++ class can be accessed by creating an instance of system.object. Can anyone please tell me how can we do the same in C#.net ? 3.Is there any C# equivalent function for "ON ERROR RESUME NEXT" in VB ? We can use Try catch but catch block will be excuted if any error occur in try block.

        S Offline
        S Offline
        Skymir
        wrote on last edited by
        #3

        BINOVAR wrote:

        3.Is there any C# equivalent function for "ON ERROR RESUME NEXT" in VB ? We can use Try catch but catch block will be excuted if any error occur in try block.

        Someone will slap me for saying this, but you can also nest try catch blocks, and there's no requirement to have code inside the catch portion of the try block. At some point you will be causing the hari kari of whatever dev has to look at the code later though.

        The true man wants two things: danger and play. For that reason he wants woman, as the most dangerous plaything.

        C 1 Reply Last reply
        0
        • S Skymir

          BINOVAR wrote:

          3.Is there any C# equivalent function for "ON ERROR RESUME NEXT" in VB ? We can use Try catch but catch block will be excuted if any error occur in try block.

          Someone will slap me for saying this, but you can also nest try catch blocks, and there's no requirement to have code inside the catch portion of the try block. At some point you will be causing the hari kari of whatever dev has to look at the code later though.

          The true man wants two things: danger and play. For that reason he wants woman, as the most dangerous plaything.

          C Offline
          C Offline
          Colin Angus Mackay
          wrote on last edited by
          #4

          Skymir wrote:

          Someone will slap me for saying this

          You know already it is a bad thing. You obviously don't need someone to tell you. I've just had my dinner and not feeling energetic enough to slap anyone so, if you don't mind, could you do it yourself.

          *Developer Day Scotland - Free community conference Delegate Registration Open

          S 1 Reply Last reply
          0
          • B BINOVAR

            1.What is the equivalent settings for option strict on and option explicit on in c# ? 2.I have a class in another project ( VC++). I want to access the methods and properties in VC++ class from my project in C#. The VC++ is a standalone EXE project and hence I cant add any reference to my project. But in VB I found a method named GetObject( "AssemblyName") to retrieve the object in runtime. As VB.Net supports early binding by setting option explicit ON , the methods and properties of the VC++ class can be accessed by creating an instance of system.object. Can anyone please tell me how can we do the same in C#.net ? 3.Is there any C# equivalent function for "ON ERROR RESUME NEXT" in VB ? We can use Try catch but catch block will be excuted if any error occur in try block.

            C Offline
            C Offline
            Colin Angus Mackay
            wrote on last edited by
            #5

            BINOVAR wrote:

            We can use Try catch but catch block will be excuted if any error occur in try block.

            If I find out you have written a try-catch-ignore block I will reprogram your software with a large and very blunt axe.

            *Developer Day Scotland - Free community conference Delegate Registration Open

            1 Reply Last reply
            0
            • C Colin Angus Mackay

              Skymir wrote:

              Someone will slap me for saying this

              You know already it is a bad thing. You obviously don't need someone to tell you. I've just had my dinner and not feeling energetic enough to slap anyone so, if you don't mind, could you do it yourself.

              *Developer Day Scotland - Free community conference Delegate Registration Open

              S Offline
              S Offline
              Skymir
              wrote on last edited by
              #6

              No worries, I forgot what I'm picking up at the store on the way home tonight. The wife will take care of the slapping.

              The true man wants two things: danger and play. For that reason he wants woman, as the most dangerous plaything.

              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