public static int Initialize(Ddeml.DdeCallback pfnCallback, int afCmd) { lock (_Table) { // Initialize a DDEML instance. int instanceId = 0; Ddeml.DdeInitialize(ref instanceId, pfnCallback, afCmd, 0); if (instanceId != 0) { // Make sure this thread has an IMessageFilter on it. LocalDataStoreSlot slot = Thread.GetNamedDataSlot(DataSlot); if (Thread.GetData(slot) == null) { InstanceManager filter = new InstanceManager(); Application.AddMessageFilter(filter); Thread.SetData(slot, filter); } // Add an entry to the table that maps the instance identifier to the current thread. _Table.Add(instanceId, Ddeml.GetCurrentThreadId()); } return instanceId; } }
private WeakReferenceDictionary<string, DdemlServer> _ServerTable2 = new WeakReferenceDictionary<string, DdemlServer>(); // Active servers by service #endregion Fields #region Constructors public DdemlContext() { // Create the callback that will be used by the DDEML. _Callback = this.ODdeNetCallback; }
public DdemlContext() { // Create the callback that will be used by the DDEML. _Callback = this.OnDdeCallback; }