tim 0

tim 0

  • NA
  • 1
  • 0

Passing data from a C# dll to a C# main application

May 18 2004 7:12 PM
I have been programming in C# for about 6 month now. Until now I have been able to learn everything I know from the internet, but now I am stuck and confused. I am the type of guy that won't stop for directions unless I am absolutly lost. Our voice mail has a way of calling a custom activex control and pass the CallerID, extension and a couple of other parameters to it. I have written a C# dll called TolNewCall.dll [code below]. To test the code, I had it open notepad, since I cannot open a message box in a dll. I works flawlessly. I can dial in to the office, get transferred to my extension and, viola, notpad opens. Now the stuck and confused part. How do I get my main application to read the parameters from the dll? Do I use Delegates and Events or Remoting? I have read up on both and still cannot figure out which to use. In addition, once it is determined which to use, I have no clue of what code goes where, the dll or the main appilcation. All of the examples that I have read for each are really confusing and they have no sample working code to download. Here is the code: using System; namespace TolNewCall { public interface MyNewCall { int NewCall(string sMailboxNumber, string sExtensionNumber, string sCallerIDNumber, string sCallerIDName); } public class Test { static void DLLMain() { } } public class clsNewCall : MyNewCall { public int NewCall(string sMailboxNumber, string sExtensionNumber, string sCallerIDNumber, string sCallerIDName) { System.Diagnostics.Process.Start(@"C:\windows\notepad.exe"); return 0; } } }