Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C# (http://www.go4expert.com/forums/c-sharp/)
-   -   how to call function in a DLL (http://www.go4expert.com/forums/function-dll-t20958/)

pmann461 11Feb2010 19:36

how to call function in a DLL
 
Question from Newbie:
I want to create a DLL called AddOne.DLL that has one function in it called "OneMore" that accepts an integer as input and returns the next greatest integer value (ie: if i pass it 212, i want it to return 213). I then want to call this from a windows forms application.

My question is:
1) how do i create a function that returns a value.
2) how do i call this external function from another C# windows forms app.

This is probably the dumbest question ever posted, but i am an old VB programmer and all this is new to me.

shabbir 12Feb2010 09:00

Re: how to call function in a DLL
 
Not actually.

Import the DLL and use it.

It should be just like System. statements and then function call would be like any other in built function call

blackrubybarb 29Oct2010 13:34

Re: how to call function in a DLL
 
create a class library and write your functions in that class library
then import the .DLL file to windows forms app and then you can create an object using that class in the dll file. using that object you can call any function


All times are GMT +5.5. The time now is 16:02.