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. C# Classes in DLL files

C# Classes in DLL files

Scheduled Pinned Locked Moved C#
csharphelpquestion
7 Posts 5 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.
  • C Offline
    C Offline
    Cozmo23
    wrote on last edited by
    #1

    Im trying to send a class full of variables to a DLL Method and then have that method do some calculations and then send the class back to the client. IS that possible? Im getting an error that the current argument cant be converted.

    realJSOPR A J C 4 Replies Last reply
    0
    • C Cozmo23

      Im trying to send a class full of variables to a DLL Method and then have that method do some calculations and then send the class back to the client. IS that possible? Im getting an error that the current argument cant be converted.

      J Offline
      J Offline
      Judah Gabriel Himango
      wrote on last edited by
      #2

      Yes this will work just fine, so long as the "class full of variables" is a class that's visible to both sides.

      e.g. MyProgram - references MySharedDll
                Creates new ClassFullOfVariables
                Sends instance over to MyOtherDll

      MySharedDll
                Contains the type
               class ClassFullOfVariables { ... }

      MyOtherDll - referencesMySharedDll
                Contains a method: DoCalculations(ClassFullOfVariables input)

      1 Reply Last reply
      0
      • C Cozmo23

        Im trying to send a class full of variables to a DLL Method and then have that method do some calculations and then send the class back to the client. IS that possible? Im getting an error that the current argument cant be converted.

        A Offline
        A Offline
        Abhijit Jana
        wrote on last edited by
        #3

        Cozmo23 wrote:

        IS that possible?

        Yes. are you passing the object ? does dll file have the defination of that class? can you put the code over here

        Best Regards ----------------- Abhijit Jana "Success is Journey it's not a destination"

        1 Reply Last reply
        0
        • C Cozmo23

          Im trying to send a class full of variables to a DLL Method and then have that method do some calculations and then send the class back to the client. IS that possible? Im getting an error that the current argument cant be converted.

          realJSOPR Offline
          realJSOPR Offline
          realJSOP
          wrote on last edited by
          #4

          The class you're passing back and forth would have to be defined in another DLL, that your other DLL would then "use".

          "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
          -----
          "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001

          1 Reply Last reply
          0
          • C Cozmo23

            Im trying to send a class full of variables to a DLL Method and then have that method do some calculations and then send the class back to the client. IS that possible? Im getting an error that the current argument cant be converted.

            C Offline
            C Offline
            Cozmo23
            wrote on last edited by
            #5

            What I have done so far is included the Class "PumpTest" (Class full of variables) in both the client and the DLL and attempted to use the code "pTest = Calc.TableIIcalc(pTest); " to pass the PumpTest pTest to the DLL. My DLL looke like this public PumpTest TableIIcalc(PumpTest pTest) { calculations return pTest; } I planned on making the PumpTest class its own DLL, would that solve the problem?

            J C 2 Replies Last reply
            0
            • C Cozmo23

              What I have done so far is included the Class "PumpTest" (Class full of variables) in both the client and the DLL and attempted to use the code "pTest = Calc.TableIIcalc(pTest); " to pass the PumpTest pTest to the DLL. My DLL looke like this public PumpTest TableIIcalc(PumpTest pTest) { calculations return pTest; } I planned on making the PumpTest class its own DLL, would that solve the problem?

              J Offline
              J Offline
              Jason McBurney
              wrote on last edited by
              #6

              What makes you think this will not work?

              You can only be young once. But you can always be immature. - Dave Barry

              1 Reply Last reply
              0
              • C Cozmo23

                What I have done so far is included the Class "PumpTest" (Class full of variables) in both the client and the DLL and attempted to use the code "pTest = Calc.TableIIcalc(pTest); " to pass the PumpTest pTest to the DLL. My DLL looke like this public PumpTest TableIIcalc(PumpTest pTest) { calculations return pTest; } I planned on making the PumpTest class its own DLL, would that solve the problem?

                C Offline
                C Offline
                Cozmo23
                wrote on last edited by
                #7

                Well I get two errors with the "pTest = Calc.TableIIcalc(pTest);" line of code The first is a invalid arguments error, the second is Argument '1', cannont convert from 'Namespace.PumpTest' to 'Namespace2.PumpTest' they aren t actually called namespace but I cant post too much info about the program on the web. Namespace is the name of the client and namespace two is the name of the DLL.

                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