C# COM server events "lost" when raising events while Excel is in edit mode

I posted this question on StackOverflow (http://stackoverflow.com/questions/23798443/c-sharp-com-server-events-lost-when-raising-events-while-excel-is-in-edit-mode) but did not receive a good answer, so I'm trying my luck here.
I have an in-proc COM server written in C# (using .NET Framework 3.5) that raises COM events based on this example: http://msdn.microsoft.com/en-us/library/dd8bf0x3(v=vs.90).aspx
Excel VBA is the most common client of my COM server.  I’ve found that when I raise COM events while Excel is in edit mode (e.g. a cell is being edited) the event is “lost”.  Meaning, the VBA event handler is never called (even after the Excel
edit mode is finished) and the call to the C# event delegate passes through and fails silently with no exceptions being thrown.  Do you know how I can detect this situation on my COM server?  Or better still, make the event delegate call block until
Excel is out of edit mode?
I have tried:
Inspecting the properties of the event delegate – could not find any property to indicate that the event failed to be raised on the client.
Calling the event delegate directly from a worker thread and from the main thread – event not raised on the client, no exceptions thrown on the server.
Pushing the event delegate onto a worker thread’s Dispatcher and invoking it synchronously – event not raised on the client, no exceptions thrown on the server.
Pushing the event delegate onto the main thread’s Dispatcher and invoking it synchronously and asynchronously – event not raised on the client, no exceptions thrown on the server.
Checking the status code of the Dispatcher.BeginInvoke call (using DispatcherOperation.Status) – the status is always ends with “Completed”, and is never in “Aborted” state.
Creating an out-of-proc C# COM server exe and tested raising the events from there – same result, event handler never called, no exceptions.
Since I get no indication that the event was not raised on the client, I cannot handle this situation in my code.
I have tested this with Excel 2010 and Excel 2013.
Here is a simple test case.  The C# COM server:
namespace ComServerTest
public delegate void EventOneDelegate();
// Interface
[Guid("2B2C1A74-248D-48B0-ACB0-3EE94223BDD3"), Description("ManagerClass interface")]
[InterfaceType(ComInterfaceType.InterfaceIsDual)]
[ComVisible(true)]
public interface IManagerClass
[DispId(1), Description("Describes MethodAAA")]
String MethodAAA(String strValue);
[DispId(2), Description("Start thread work")]
String StartThreadWork(String strIn);
[DispId(3), Description("Stop thread work")]
String StopThreadWork(String strIn);
[Guid("596AEB63-33C1-4CFD-8C9F-5BEF17D4C7AC"), Description("Manager events interface")]
[InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
[ComVisible(true)]
public interface ManagerEvents
[DispId(1), Description("Event one")]
void EventOne();
[Guid("4D0A42CB-A950-4422-A8F0-3A714EBA3EC7"), Description("ManagerClass implementation")]
[ComVisible(true), ClassInterface(ClassInterfaceType.None)]
[ComSourceInterfaces(typeof(ManagerEvents))]
public class ManagerClass : IManagerClass
private event EventOneDelegate EventOne;
private System.Threading.Thread m_workerThread;
private bool m_doWork;
private System.Windows.Threading.Dispatcher MainThreadDispatcher = null;
public ManagerClass()
// Assumes this is created on the main thread
MainThreadDispatcher = System.Windows.Threading.Dispatcher.CurrentDispatcher;
m_doWork = false;
m_workerThread = new System.Threading.Thread(DoThreadWork);
// Simple thread that raises an event every few seconds
private void DoThreadWork()
DateTime dtStart = DateTime.Now;
TimeSpan fiveSecs = new TimeSpan(0, 0, 5);
while (m_doWork)
if ((DateTime.Now - dtStart) > fiveSecs)
System.Diagnostics.Debug.Print("Raising event...");
try
if (EventOne != null)
// Tried calling the event delegate directly
EventOne();
// Tried synchronously invoking the event delegate from the main thread's dispatcher
MainThreadDispatcher.Invoke(EventOne, new object[] { });
// Tried asynchronously invoking the event delegate from the main thread's dispatcher
System.Windows.Threading.DispatcherOperation dispOp = MainThreadDispatcher.BeginInvoke(EventOne, new object[] { });
// Tried synchronously invoking the event delegate from the worker thread's dispatcher.
// Asynchronously invoking the event delegate from the worker thread's dispatcher did not work regardless of whether Excel is in edit mode or not.
System.Windows.Threading.Dispatcher.CurrentDispatcher.Invoke(EventOne, new object[] { });
catch (System.Exception ex)
// No exceptions were thrown when attempting to raise the event when Excel is in edit mode
System.Diagnostics.Debug.Print(ex.ToString());
dtStart = DateTime.Now;
// Method should be called from the main thread
[ComVisible(true), Description("Implements MethodAAA")]
public String MethodAAA(String strValue)
if (EventOne != null)
try
// Tried calling the event delegate directly
EventOne();
// Tried asynchronously invoking the event delegate from the main thread's dispatcher
System.Windows.Threading.DispatcherOperation dispOp = System.Windows.Threading.Dispatcher.CurrentDispatcher.BeginInvoke(EventOne, new object[] { });
// Tried synchronously invoking the event delegate from the main thread's dispatcher
System.Windows.Threading.Dispatcher.CurrentDispatcher.Invoke(EventOne, new object[] { });
catch (System.Exception ex)
// No exceptions were thrown when attempting to raise the event when Excel is in edit mode
System.Diagnostics.Debug.Print(ex.ToString());
return "";
return "";
[ComVisible(true), Description("Start thread work")]
public String StartThreadWork(String strIn)
m_doWork = true;
m_workerThread.Start();
return "";
[ComVisible(true), Description("Stop thread work")]
public String StopThreadWork(String strIn)
m_doWork = false;
m_workerThread.Join();
return "";
I register it using regasm:
%SystemRoot%\Microsoft.NET\Framework\v2.0.50727\regasm /codebase ComServerTest.dll /tlb:ComServerTest.tlb
Excel VBA client code:
Public WithEvents managerObj As ComServerTest.ManagerClass
Public g_nCounter As Long
Sub TestEventsFromWorkerThread()
Set managerObj = New ComServerTest.ManagerClass
Dim dtStart As Date
dtStart = DateTime.Now
g_nCounter = 0
Debug.Print "Start"
' Starts the worker thread which will raise the EventOne event every few seconds
managerObj.StartThreadWork ""
Do While True
DoEvents
' Loop for 20 secs
If ((DateTime.Now - dtStart) * 24 * 60 * 60) > 20 Then
' Stops the worker thread
managerObj.StopThreadWork ""
Exit Do
End If
Loop
Debug.Print "Done"
End Sub
Sub TestEventFromMainThread()
Set managerObj = New ComServerTest.ManagerClass
Debug.Print "Start"
' This call will raise the EventOne event
managerObj.MethodAAA ""
Debug.Print "Done"
End Sub
' EventOne handler
Private Sub managerObj_EventOne()
Debug.Print "EventOne " & g_nCounter
g_nCounter = g_nCounter + 1
End Sub
This problem also occurs for a C++ MFC Automation server that raises COM events.  If I raise the COM event from the main thread when Excel is in edit mode, the event handler is never called.  No errors or exceptions are thrown on the server,
similar to my C# COM server.  However, if I use the Global Interface Table to marshal the event sink interface from the main thread
back to the main thread, then invoking the event - it will block while Excel is in edit mode.  (I also used COleMessageFilter to disable the busy dialog and not responding dialogs, otherwise I'd receive the exception:
RPC_E_CANTCALLOUT_INEXTERNALCALL It is illegal to call out while inside message filter.)
Knowing that, I tried to do the same on my C# COM server.  I could instantiate the Global Interface Table (using the definition from pinvoke.net) and the message filter (using the IOleMessageFilter definition from MSDN).  However, the event still
gets "lost" and does not block while Excel is in edit mode.
Here's my additional C# code to try to make use of the Global Interface Table:
namespace ComServerTest
// Global Interface Table definition from pinvoke.net
ComImport,
InterfaceType(ComInterfaceType.InterfaceIsIUnknown),
Guid("00000146-0000-0000-C000-000000000046")
interface IGlobalInterfaceTable
uint RegisterInterfaceInGlobal(
[MarshalAs(UnmanagedType.IUnknown)] object pUnk,
[In] ref Guid riid);
void RevokeInterfaceFromGlobal(uint dwCookie);
[return: MarshalAs(UnmanagedType.IUnknown)]
object GetInterfaceFromGlobal(uint dwCookie, [In] ref Guid riid);
ComImport,
Guid("00000323-0000-0000-C000-000000000046") // CLSID_StdGlobalInterfaceTable
class StdGlobalInterfaceTable /* : IGlobalInterfaceTable */
public class ManagerClass : IManagerClass
//...skipped code already mentioned in earlier sample above...
//...also skipped the message filter code for brevity...
private Guid IID_IDispatch = new Guid("00020400-0000-0000-C000-000000000046");
private IGlobalInterfaceTable m_GIT = null;
public ManagerClass()
//...skipped code already mentioned in earlier sample above...
m_GIT = (IGlobalInterfaceTable)new StdGlobalInterfaceTable();
public void FireEventOne()
// Using the GIT to marshal the (event?) interface from the main thread back to the main thread (like the MFC Automation server).
// Should we be marshalling the ManagerEvents interface pointer instead? How do we get at it?
uint uCookie = m_GIT.RegisterInterfaceInGlobal(this, ref IID_IDispatch);
ManagerClass mgr = (ManagerClass)m_GIT.GetInterfaceFromGlobal(uCookie, ref IID_IDispatch);
mgr.EventOne(); // when Excel is in edit mode, event handler is never called and does not block, event is "lost"
m_GIT.RevokeInterfaceFromGlobal(uCookie);
I’d like my C# COM server to behave in a similar way to the MFC Automation server.  Is this possible?  I think I should be registering the ManagerEvents interface pointer in the GIT but I don't know how to get at it? I tried using Marshal.GetComInterfaceForObject(this,
typeof(ManagerEvents)) but that just throws an exception: System.InvalidCastException: Specified cast is not valid.
Thanks.

Hi Jason-F,
I’ve found that when I raise COM events while Excel is in edit mode (e.g. a cell is being edited) the event is “lost”.  Meaning,
the VBA event handler is never called (even after the Excel edit mode is finished) and the call to the C# event delegate passes through and fails silently with no exceptions being thrown.
Do you mean you didn't raise EventOne event? EventOne handler like following?
' EventOne handler
Private Sub managerObj_EventOne()
Debug.Print "EventOne " & g_nCounter
g_nCounter = g_nCounter + 1
End Sub
After test your code, here is my screenshot
And here is my execute log in C# ComServerTest.
ManagerClass1/1/2015 5:48:11 PM
DoThreadWork()1/1/2015 5:48:12 PM
ManagerClass_EventOne()1/1/2015 5:48:17 PM
ManagerClass_EventOne()1/1/2015 5:48:22 PM
ManagerClass_EventOne()1/1/2015 5:48:27 PM
ManagerClass_EventOne()1/1/2015 5:48:32 PM
ManagerClass_EventOne()1/1/2015 5:48:37 PM
ManagerClass_EventOne()1/1/2015 5:48:42 PM
ManagerClass1/1/2015 5:49:56 PM
DoThreadWork()1/1/2015 5:49:56 PM
ManagerClass_EventOne()1/1/2015 5:50:01 PM
ManagerClass1/1/2015 5:50:04 PM
If i misunderstand you, please feel free to let me know.
Best regards,
kristin
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.

Similar Messages

  • Multiple iCal icloud errors. One saying username and password incorrect the other Server 500 error when removing event

    Good day all
    One of my clients is having intermitting issues with her iCal on her Macbook. Her iCal is connected to her iCloud account along with her contacts, she access the iCloud data via her iPhone and her iPad.
    The syncing between her devices with the iCloud gives her no issues when it comes to her contacts but her iCloud on her Macbook is causing a lot of grief. She can accept and add iCal events most of the time but every now and then she gets the error "iCal can't log into your iCloud account becasue your password may be incorrect. The server did not recognize your username or password for the account iCloud. Make sure you enter them correctly". Here is a picture of the error.
    I can confirm her username and password is correct by clicking ok to the error and making an event in the calander or making a new contact in her contacts and confirm on icloud.com that the new additions did make it to the iCloud.
    On top of the above error she also gets the following error intermittently (seems to happen the most when she attempts to remove a calander item). The error is "The server responded with an error. The request for "Meeting name" in "category" in account iCloud failed. The server responded with 500 to operation CalDAVWriteEntityQueueableOperation. Stay offline/Revert to Server/Go Online" once more below is a picture
    Any help on this subject would be greatly appreshated
    Thanks

    Good day all
    One of my clients is having intermitting issues with her iCal on her Macbook. Her iCal is connected to her iCloud account along with her contacts, she access the iCloud data via her iPhone and her iPad.
    The syncing between her devices with the iCloud gives her no issues when it comes to her contacts but her iCloud on her Macbook is causing a lot of grief. She can accept and add iCal events most of the time but every now and then she gets the error "iCal can't log into your iCloud account becasue your password may be incorrect. The server did not recognize your username or password for the account iCloud. Make sure you enter them correctly". Here is a picture of the error.
    I can confirm her username and password is correct by clicking ok to the error and making an event in the calander or making a new contact in her contacts and confirm on icloud.com that the new additions did make it to the iCloud.
    On top of the above error she also gets the following error intermittently (seems to happen the most when she attempts to remove a calander item). The error is "The server responded with an error. The request for "Meeting name" in "category" in account iCloud failed. The server responded with 500 to operation CalDAVWriteEntityQueueableOperation. Stay offline/Revert to Server/Go Online" once more below is a picture
    Any help on this subject would be greatly appreshated
    Thanks

  • Server connection lost when connected via WAP200

    Hi,
    I have a small Windows SBS 2011 network where two WAP200 (hw-ver 1.0 sw-ver 2.0.6.0-ETSI) provides WLAN access to the network for my Win7 clients. If I connect one of the Win7 clients via one the the WAP200, open a pdf-file and leave it for one hour, and then try to scroll the document, then Acrobat reports an IO-error after 20 seconds. This does not occur if I connect directly to the LAN or via a 3Com AP instead. Similar problems occur if I open Outlook or IE.
    It seems like a SMB2 session is created when I open the pdf-file, and that this session is lost for some reason. Is there some PM that kicks in and makes the client inaccessible from the server so that it considers the client gone ?
    Regards
    MatsW

    Hi Jeffrey,
    There's definitely something fishy with the WAP200. I can see the following: If I take a network trace on both my server and the client attached via WAP200 then I can see that suddenly ARP Requests from server doesn't reach the client. This lasts for about 5 minutes when traffic starts to pass thru.
    So then I started "ping client -n 10000000' on the server to make sure I had a continous flow of traffic between client and server. Now the problem doesn't occur. But what is odd is that I can see that another client which is attached to the same WAP200 suddenly stops responding to ARP Requests, just as the first client when it didn't have ping running.
    This may explain why the SMB2 session fails because if client doesn't respond to ARP Requests (because WAP200 drops connection for 5 minutes) then eventually the file handle is closed.
    Do you have some suggestion on how to debug this ?
    Kind regards
    Mats

  • Mouse/keyboard events lost during sound events

    I have a new MacbookPro (October 2011, MacBookPro8,2) with 4Gb RAM running latest 10.6.8, and I am extremely frustrated by periodic loss of mouse events (movement freezes, then jumps) and keyboard events (loss of keystrokes) whenever a sound alert is made. Am I the only person experiencing this?

    I should also add a related behavior, repeated keypresses. I do a lot of work on connected unix/linux machines using terminal. Sometimes I will be navigating directories and hit <tab> for command completion, and unexpectedly get the screen scrolling as if I had typed it 100 times!

  • How to stop an event action when other event happen ?

    This is my first swing program
    I want to design an application with two buttons,"start" and "stop"
    Pressing "start" will start listing data
    Pressing "stop" will stop listing data immediate
    What should I do??
    I try to use a flag like the following:
    ==============================
    btnStartActionPerformed() {
    while(1) {
    if (loop_break) break;
    btnStopActionPerformed() {
    loop_break = true;
    ==============================
    but btnStopActionPerformed() will not start until btnStartActionPerformed() is finished
    What should I do?

    I agree with the thread comment...
    But if you are going to use a while loop, you can do this:
    loop_break = false;
    while(!loop_break) {
    }But if you need to stop anywhere inside the loop, you need to use if statements to check that flag between every action the while loop contains. Otherwise, you're limited to breaking whenever you check the flag, of course, or as above, before the next loop iteration.

  • Connection to Discoverer Plus (10g) lost when exporting workbook to Excel

    I have a user who was exporting a workbook to Excel and it showed that the export failed. When she closed that box, she got a message that her Connection to Discoverer was lost.
    Anyone experienced this one? Any ideas why this is happening?
    Cindy

    Hi Kevin
    It will do this if you change the parameters away from the default and you have told Discoverer to remember parameter settings. This is controlled by an entry called SaveLastUsedParamValue in pref.txt on the server.
    If this is the cause then its not a bug. All Discoverer thinks is that you have changed something. Even switching an item in Page Items could trigger this.
    If you have users who only need to View reports why not use Viewer? You can turn off saving altogether there if you so wish.
    Best wishes
    Michael

  • How is the e-mail body text determined when e-mail sent from PO in edit mod

    We have an e-mail that is sent to the supplier when the buyer edits the po then goes to header-output - create and send immediately.   We want to remove the SAP default Salutation
    Best Regards,
    Your Purchasing Company
    The problem is we cannot find where this e-mail body is being created.   Any ideas?
    Sandra

    Hello,
    The email body text that you get at SOST is from the cover form BBP_OUTPUT_COVER.
    When you Order a PO, the following is the text is seen in SOST.
    "&LV_TITLE&
    Please find enclosed the purchase order &IV_PO_HEADER-OBJECT_ID& &IV_PO_
    Kind regards,
    Your purchasing company"
    You can create your own cover form in order to substitute the standard BBP_OUTPUT_COVER.
    Regards,
    Ricardo

  • "Connectio​n to Yahoo server was lost" error

    When doing a sync in Desktop Manager I get the error "Connection to Yahoo server was lost" when it moves from the Device to checking Yahoo and then Desktop Manger crashes.  It will do the Address List OK but the Calendar and the other two give this error.  I'm of course using Yahoo two way sync on all items.  I've tried reinstalling Desktop Manager and the device software with no luck.  My software is v4.5.0.110 on the phone and 4.7 for Desktop Manager.  Any ideas?
    Solved!
    Go to Solution.

    skrol: if thats the mentality you expect, then maybe bb should also remove 95% of all the 3rd party applications that you can download and install sicne they dont make those either and dont suport them. bb does support syncing with yahoo, but to a certain degree. if they can prove that DTM works, bb works, database works... their job is done. then its up to yahoo or your pc manufacturer.
    also these forums arent supported by bb technicians... just bb enthusiasts helping each other. And also having an attitude isnt going to get you far here.
    as for syncing with ANY calendar database and it fails at a certain point, its usually a bad entry. Advanced logging should be able to track down which one it is. turn off syncing for all but calendar and follow below instrcutions, the culprit will be the last SUBJECT entry in the tif.log file
    http://www.blackberry.com/btsc/search.do?cmd=displ​ayKC&docType=kc&externalId=KB01451&sliceId=1&docTy​...

  • Disable column when in edit mode.

    Hallo,
    I want the user to be able to input data in some columns of my ALV Grid, but not in all. How can I disable some columns for input, when the ALV Grid is in Input/Edit mode?
    Thank you,
    Manuel

    Hi,
    Step 1.
    Add this feild in ur Internal table.
    field_style TYPE lvc_t_styl, "FOR DISABLE
    FORM build_layout.
    Set layout field for field attributes(i.e. input/output)
    gd_layout-no_input          = 'X'.
      gd_layout-cwidth_opt = 'X'.
      gd_layout-stylefname = 'FIELD_STYLE'.
      gd_layout-zebra = 'X'.
      gd_layout-info_fname = 'LINE_COL'.
    ENDFORM. " BUILD_LAYOUT
    *step-2 * Call this Subroutine before Fieldcatalog........
    FORM set_specific_field_attributes .
      DATA ls_stylerow TYPE lvc_s_styl .
      DATA lt_styletab TYPE lvc_t_styl .
    clear : ls_stylerow.
    clear : wa_final-field_style.
    refresh WA_FINAL-FIELD_STYLE[].
    Populate style variable (FIELD_STYLE) with style properties
    The following code sets it to be disabled(display only)
    if child deal Ticket Number Approved or rejected.
      LOOP AT it_final INTO wa_final.
        IF wa_final-apprd = 'X' or wa_final-rejct = 'X'.
            ls_stylerow-fieldname = 'APPRD' .   
            ls_stylerow-style = cl_gui_alv_grid=>mc_style_disabled.
            APPEND ls_stylerow TO wa_final-field_style.
            MODIFY it_final FROM wa_final.   "my Internal table, Replace ur internal table.
            ls_stylerow-fieldname = 'REJCT' .    " ur field name
            ls_stylerow-style = cl_gui_alv_grid=>mc_style_disabled.
            APPEND ls_stylerow TO wa_final-field_style.
            MODIFY it_final FROM wa_final.
       endif.
    like this u have to add for all colunms in ur report which u
    want to disable.
    Note the stylerow appending should be in Alphabetic order
      ENDLOOP.
    ENDFORM. " set_specific_field_attributes
    Thanx
    bgan.

  • When running in edit mode get error

    When I sgtart Premiere Elements in the edit mode I get an error. The error "There Is No Disk In Drive. Please Insert A Disk in Drive \Device\Harddisk\DR". I am running on Windows 7 X 64. I have no such drive on the system. Any ideas as what is happenong. I have tried reinstalling the program but the error persists. Thanks for any help.

    Dbritt26
    This is an old story which may have a solution if your program is Premiere Elements 13.
    If your program is version 13, then delete or rename the OldFilm.AEX file from OldFilm.AEX to OldFilm.AEXOLD.
    That file is found
    Local Disk C
    Program Files
    Adobe
    Adobe Premiere Elements 13
    Plug-Ins
    Common
    NewBlue
    and in the NewBlue Folder is the OldFilm.AEX file.
    Please let us know the outcome.
    Thanks.
    ATR

  • Raise an event with no arguments from a COM server to be consumed by a COM client

    In VB.net I can declare and raise an event like this
    Public Event SomeEvent()
    Public Sub SomeMethod
    RaiseEvent SomeEvent()
    End Sub
    I need to work out how to do this in c# however all of the examples of raising events include event handlers.  This won't work for me as I am raising this event over a COM interface, and so I can't send eventargs or non basic types through the interface
    to the client application.
    In my previous question it was suggested that I use Action and do the following
    public class MyClass
    public event Action MyEvent;
    public void RaiseMyEvent() {
    if(MyEvent != null) {
    MyEvent();
    MyClass myObject = new MyClass();
    myObject.MyEvent += () =>
    //handle...
    myObject.RaiseMyEvent();
    However when I tried this over the COM interface I got the following error
    An exception of type 'System.InvalidCastException' occurred in AdtakerInterfaceSampleCsharp.exe but was not handled in user code
    Additional information: Unable to cast object of type 'System.__ComObject' to type 'System.Action'."
    The reason that I need to do this is that I am registering application A on the running object table so that I can use
    Marshal.GetActiveObject in Application B to attach to the currently running process.  This is currently working fine for one way communication, however I need to be able to raise events from Application A that will be received by Application B.

    @CoolDadTX -That's because I've written com servers in the past using VB.net, however they were not registered with the Running object table.
     What I'm trying to do in this case is have an application that will be started by the user, and then they will start another application written in .Net to connect to that first application.  The reason for this is that we have an application
    written in an old version of smalltalk that doesn't seem to support getObject but can create an IUknown, and we already have base classes to attach to COM objects written in .Net.  As this new application needs to be started first it can't be tightly
    coupled to the legacy application, so we are trying to register the new application and then connect a Dotnet Client that is being started through a  COM Interface from the legacy application.  I know it's convoluted but we need to keep the legacy
    application alive for a bit longer while we rewrite it as an add-in for the new application.
    The article that you linked to has been very helpful on the server side, but do you have any ideas as to how I can connect the sink on the client side in C#?

  • Object does not match target type when raising an event from c# to VB6

    I have a c# .net DLL that I use from a VB6 app. It exposes an event,
    and the VB6 app is sinking it.
    The VB6 app is receiving the event, as long as it is raised from the
    main thread of the .net DLL.
    I have an aync task being handled inside the DLL (delegate BeginInvoke). Any
    attempt to raise the event from within that thread casuses the reported
    error, even from within the AsyncCallback function, when the thread is ending.
    I noticed that the delegate for the event is not declared inside the
    interface. It's in that module, but above the interface definition:
        [ComVisible(false)]
        public delegate void LoggingEventHandler( string logData );
    The event is declared in the class itself as:
        public class Processor : _Processor
            public event LoggingEventHandler        LogNotification;
    Finally, to raise the event:
    if ( this.Completed != null )
        this.Completed( true );
    If I open the tlb with OLEVIEW, I can see the public event just fine. Of course, I expected to, as it's working up until the helper thread kicks in.
    Now for the REAL WIERD PART! This DOES work on several servers that have
    been in production for months. It's just this one server that it won't work
    on. Same code. Resinstalled/registered it 1,000 times. It took me a while to
    find that an error was even occuring, since it was being raised in the
    seperate thread. In other words, I'm receiving the event just fine on a series of servers. This is a new machine we're trying to bring online. I suspect it's environmental, but I can't figure it out.
    I don't understand why the publisher would be expecting a certain type of
    subscriber in the first place... unless the error is really triggered by the client when the event reaches it. I've put logging into the client, though, and the first line of code inside the event is not being executed.
    For the VB6 app, I reference the tlb file that is automatically created when
    I compile (Interop is checked). I unregistered and re-registered the tlb on
    the server. I regasm'd the dll itself. All dlls are in the same folder - not
    in the GAC.
    The stack trace is as follows:
       at System.RuntimeType.InvokeDispMethod(String name, BindingFlags
    invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32
    culture, String[] namedParameters)
       at System.RuntimeType.InvokeMember(String name, BindingFlags invokeAttr,
    Binder binder, Object target, Object[] args, ParameterModifier[] modifiers,
    CultureInfo culture, String[] namedParameters)
       at System.RuntimeType.ForwardCallToInvokeMember(String memberName,
    BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData&
    msgData)
       at HPFS.Queue.IProcessorEvents.LogNotification(String logData))

    This is driving me nuts!
    I sure would appreciate any suggestions.
    I got this working on one of the two machines. The other machine had some other issues, so I had it re-imaged. It's been so long since I fixed the first one, that I can't remember exactly how I did it. Plus, I did so many things to it over two weeks, that I never really felt confident, anyway. But ... I could *swear* that the last thing I did back then to get this event to flow was to re-register the DLL's TLB.
    So ... This is win 2k with FW 1.1 + SP1.
    Completed is the delagate I'm trying to invoke.
    this.Completed.Target.GetType().Name = "__comobject"
    I've tried everything. Unregistered the .tlb. Unregistered the .net DLL. Verified that the app completely failed while unregistered. Created the TLB using RegAsm /tlb syntax.
    I tried using CLR SPY. It registers nothing. It only lets me pick an EXE. This is a DLL tring to raise to an EXE.
    I've looked at the TLB in OLE VIEW and I just don't know what I'm looking at.
    Is there any other tool or technique I can use to audit/monitor/trap this? .net is giving me *** for details about what's failing. I wish I could somehow debug into exactly what it's trying to do and get more details on the failure.
    Here's the error I'm getting:
    (Code -1) Object does not match target type.<Source:mscorlib>(Stack:    at System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters)
       at System.RuntimeType.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParameters)
       at System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData& msgData)
       at HPFS.Queue.IProcessorEvents.Completed(Boolean success)
       at HPFS.Queue.Processor.RequestDone())
    Processor = the DLL I'm trying to raise the event from.
    IProcessor = the event interface that's exposed through COM.

  • Button executing CloseWindow Java Script and raising event on server

    Hi All.
    Somebody can help me with this:
    <b>What i'm needing:</b> an 'END' button on a BSP, when the user click on this button just show an aswer box asking if the user wants to close the windows, in case to click yes close the current window and execute a business logic in the controller.
    <b>What i have:</b> a button with the event onClientClick invoking a Java Script function which is showing the answer box and the event onClick which raise the event on the server side. The thing is if the user click on yes then i'm closing the current window and the server event never is triggered. This is not working !!!
    Any ideas ? some sample code ?
    Thanks in advance.
    Armando.

    Hi Armando,
    The 'Yes' on the <i>Confirm dialog box</i> (Client Side Scripting) has to tell the application (Server side scripting) to call your METHOD XXX. This is done by passing querystring <i>exit=X</i> to the URL.
    1. Comment onClick event of the button.
    2. Modify the code the JS function of your End button as follows
       func_end()
    //if no
      // your original code
    // if yes
    document.location.href = document.location.href + '?exit=X';
    3. Add following code to DO_REQUEST
      IF REQUEST->GET_FORM_FIELD( NAME = 'exit' )  ne space.
    *your method will be called only when there is an exit=x in the url
           call method XXX.
    *set a page attrib as follows
           l_exit = 'X'.
      ENDIF.
    4. Add following code to your layout
    <%if l_exit = 'X'.%>
    <script>
    window.close();
    </script>
    <%endif.%>      
    Regards,
    Alwyn

  • I have 15000 photos in my 1Phooto library in 58 events. I have also made 27 slide shows from some of these events. When opening iPhoto, the photoscome up slmost instantly but the side bar seems to take forever to come up.  Is there s limit to the amount o

    I have 15000 photos in my 1Phooto library in 58 events. I have also made 27 slide shows from some of these events. When opening iPhoto, the photoscome up slmost instantly but the side bar seems to take forever to come up.  Is there s limit to the amount of photos yu can have or to the amount if items in the side bar?

    Try this basic troubleshooting technique:  make a temporary, backup copy (if you don't already have a backup copy) of the library and try the following:
    1 - delete the iPhoto preference file, com.apple.iPhoto.plist, that resides in your
         User/Home()/Library/ Preferences folder.
    2 - delete iPhoto's cache file, Cache.db, that is located in your
         User/Home()/Library/Caches/com.apple.iPhoto folder. 
    Click to view full size
    3 - reboot
    4 - launch iPhoto and try again.
    NOTE: If you're moved your library from its default location in your Home/Pictures folder you will have to point iPhoto to its new location when you next open iPhoto by holding down the Option key when launching iPhoto.  You'll also have to reset the iPhoto's various preferences.
    OT

  • Error in Event viewer - COM Server application security Issue

    Dear All,
    I am installing one software on windows cluster environment. But while installing I am getting continuous error in System in Event Viewer as 'The application-specific permission settings do not grant Local Activation permission for the COM Server application
    with CLSID {xxxxxxxxxxxxx} and APPID {xxxxxxxxxxxxx} to the user NT SERVICE\SQL Server Distributed Replay Client SID (S-1-5-80-3249811479-4343554-65656-65665) from address LocalHost (Using LRPC). The security permission can be modified using the Component
    Services administrative tool.'
    I have seen in component services, that app ID I am getting for DReplayController service. On security tab if I want to give permission to that particular user then to which user I want to add in 'Launch and Activate permissions'. I am not getting 'SQL Server
    Distributed Replay Controller' user in list.
    So, please help me.
    Thanks in advance.

    Hi,
    Please try to add this account: NT AUTHORITY\SYSTEM.
    More information for you:
    The application-specific permission settings do not grant Local Activation permission for the COM Server application with CLSID 2012
    https://social.technet.microsoft.com/forums/systemcenter/en-US/cd8a2c95-70db-4df6-b7f5-eedcc5d898c7/the-applicationspecific-permission-settings-do-not-grant-local-activation-permission-for-the-com
    Event ID 10016 issue in SQL Cluster Server
    https://social.technet.microsoft.com/Forums/sqlserver/en-US/c5a27692-05c0-4ee4-b97f-1ea438b4e5f7/event-id-10016-issue-in-sql-cluster-server?forum=sqldisasterrecovery
    In addition, if there are any further requirements regarding SQL, here are some SQL forums below for you:
    https://social.technet.microsoft.com/Forums/sqlserver/en-US/home?category=sqlserver&filter=alltypes&sort=lastpostdesc
    Best Regards,
    Amy
    Please remember to mark the replies as answers if they help and un-mark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact [email protected]

Maybe you are looking for

  • Adding custom fields to Embedded Search

    Hi All, I have read the post [here|How to add custom fields to Embedded Search; about adding custom fields to Embedded Search. I am looking to add Employee Subgroup for use in Talent Management (specifically the STVN SuccessionPlanning component) and

  • HT1766 how do i back up my iphone

    i need to bavk up my iphone and then upload a new software and dont have a clue how to do this? need help

  • Palm 130 - Desktop application won't open

    Hi,  I am new to the help forum.  I have had a palm 130 for years and never had trouble until recently.  My palm died, and I got a new one, actually a couple for different family members (from e-bay).  Once the new ones were put on the computer, now

  • Sales office wise sales orders

    Hi, How to find the area or sales office wise sales orders created by users in CRM can anyone give the table name ? i was checked in CRMD_ORDERADM_H i am not getting... Regards MVN

  • Link to remote external page

    How would I create a page in Muse that links to a remote external link? This is for a real estate website that links to an MLS search function. So far, I've pasted this URL into a text box with no luck. Here's the URL I'm trying to link to: IDX Prope