C# Classes in DLL files
-
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.
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 -
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.
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 newClassFullOfVariables
Sends instance over to MyOtherDllMySharedDll
Contains the type
class ClassFullOfVariables { ... }
MyOtherDll - referencesMySharedDll
Contains a method:DoCalculations(ClassFullOfVariables input)
-
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.
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"
-
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.
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?
-
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?
What makes you think this will not work?
You can only be young once. But you can always be immature. - Dave Barry
-
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?
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.