Click to See Complete Forum and Search --> : writting a dll and want to return a result back to the calling code.


MarkBrend
July 5th, 2010, 07:56 AM
Hi,

I am writting a dll and want to return a result back to the calling code.
I have tried putting:-
public string oSQL2XStreamBridge( string Name)
public class string oMyDll
both of which it does not like...

the code below errors because there is a return statment and it says you can't have a return statement when it is set to void. but it will not let me set it to string (as above)


public class oMyDll
{
public oSQL2XStreamBridge( string Name)
{
string ResultMess = "";

// work code goes here

return "Test";
}
}

How do I get the result back to the calling code?

Thanks

harrisunderwork
December 23rd, 2010, 01:14 AM
You need to use reflection to load the dll at run time and invoke its method.