Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
B

bob2k_03

@bob2k_03
About
Posts
8
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Building a new computer
    B bob2k_03

    AnandTech publishes system buyers guides: [Mid-Range to High-End Buyer's Guide]

    The Lounge visual-studio csharp database sql-server com

  • Here it comes!
    B bob2k_03

    I love a reasoned and thought out retort. ;P

    The Back Room html com question discussion announcement

  • Here it comes!
    B bob2k_03

    A more accurate statistic would be a country whose economy is over 30% of the world economy produces 25% of the greenhouse gases.

    The Back Room html com question discussion announcement

  • Reconnecting to a remote server using DCOM
    B bob2k_03

    Thank you for the suggestion and I apologize for not being clearer. I do use try/catch blocks. I am attempting to implement some retry logic to handle the occasional network glitch. The CreateObject() method in the code below wraps the Type.GetTypeFromProgID() and Activator.CreateInstance() calls. The CreateObject() method is also the method I call to intially create the remote object (crudq in this code). What I do to create this problem is set a breakpoint on the crudq.DatabaseQuery call. When the breakpoint is reached (and the remote object crudq is successfully created), I unplug the network cable and hit F10 to execute the call. The crudq.DatabaseQuery() throws a RPC_S_CALL_FAILED COMException. I then plug the network cable back in then F10 through the code. Every call to CreateObject() throws a RPC_S_CALL_FAILED COMException when it calls Activator.CreateInstance(). Below is the code: public void DatabaseQuery(string databaseName, int instance, Object input, Object filter, ref Object output, ref int result) { bool retry = true; int count = 0; int r = 0; Object o; do { try { crudq.DatabaseQuery(databaseName, instance, timeout, input, filter, out o, out r); retry = false; result = r; output = o; } catch(COMException c) { if (count < retryAttempts && (c.ErrorCode == RPC_S_CALL_FAILED || c.ErrorCode == RPC_S_SERVER_UNAVAILABLE)) { x.Info("DatabaseQuery: Retry count: " + count.ToString() + ", Exception: " + c.Message); Thread.Sleep(delayBetweenRetry); //Recreate COM object Object obj; try { CreateObject(progID, server, out obj); crudq = (AMSLib.ICRUDQ)obj; } catch { } ++count; } else { x.Error("DatabaseQuery: Exception caught: " + c.Message, c); throw; } } catch(Exception e) { x.Error("DatabaseQuery: Exception caught: " + e.Message, e); throw; } } while(retry); } Thank you, Bob

    C# sysadmin csharp com help tutorial

  • Reconnecting to a remote server using DCOM
    B bob2k_03

    Hello all, I am writing a client for a remote windows service using C#. I first instantiate the remote object ... Type t = Type.GetTypeFromProgID(progId, serverName); APPLib.IApp obj = (APPLib.IApp)Activator.CreateInstance(type); Then I use the method and it works great .. obj.SomeMethod(); But if I unplug the network cable between the object creation and its use, I get a 0x800706BF COMException (The remote procedure call failed.) which is expected. The problem I have is after I reconnect the network cable and then try to recover by calling the Type.GetTypeFromProgID() and Activator.CreateInstance(type) methods, I repeatedly get "The remote procedure call failed." COM Exceptions in the Activator.CreateInstance() call. I can even start another instance of my client that connects to the remote server just fine while this instance is still throwing execptions. Any suggestions on how to recover gracefully? Thank you, Bob

    C# sysadmin csharp com help tutorial

  • Newfoundland
    B bob2k_03

    That would explain why the ball was round rather than a tear drop shape and did not distort when it hit the sand. :)

    The Lounge python com question learning

  • About AMD 64
    B bob2k_03

    Anandtech.com also thinks highly of the ASUS SK8V. Buyer's Guide: High End System - May 2004

    The Lounge

  • Memory formats and portable drives
    B bob2k_03

    The SimpleTech Bonzai (www.simpletech.com) also uses a removable SD (or MMC) card.

    The Lounge question php html com performance
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups