none
Cannot pass a GCHandle across AppDomains when running my web application asp.net vs2005 RRS feed

  • Question



  • Hi everybody,

    I have implemented quickfix engine using asp.net and C#. and i am calling quickfix_net.dll which is written in unmanaged C++. but i am getting error like "Cannot pass a GCHandle across AppDomains" when calling quickfix_net.dll.

    but the same thing is running in console application but not under IIS 5.1 i.e asp.net

    please anybody look into matter. thanks in advance

    Following are my code:

    SessionSettings settings = new SessionSettings(tradeClientPath);
    
            ApplicationMessage application = new ApplicationMessage();
            FileStoreFactory storeFactory = new FileStoreFactory(settings);
            FileLogFactory logFactory = new FileLogFactory(settings);
            MessageFactory messageFactory = new DefaultMessageFactory();
    
            SocketInitiator initiator = new SocketInitiator
             (application, storeFactory, settings, logFactory, messageFactory);
            initiator.start();
    
            Message message = new Message();
    
            OrdType ordType = new OrdType(OrdType.MARKET);
    
            QuickFix42.NewOrderSingle newOrderSingle = new QuickFix42.NewOrderSingle(new ClOrdID("1"), new HandlInst('1'), new Symbol("WAKEN\00110048=2")
                     , new Side(Side.BUY), new TransactTime(), new OrdType(OrdType.MARKET));
    
            newOrderSingle.set(new OrderQty(10));
            newOrderSingle.set(new TimeInForce(TimeInForce.DAY));
    
            Message.Header header = newOrderSingle.getHeader();
            header.setField(new SenderCompID("CLIENT1"));
            header.setField(new TargetCompID("EXECUTOR"));
    
            message = newOrderSingle;
    
            **QuickFix.Session.sendToTarget(message);** // here i am getting exception
    
            initiator.stop();

    Document i reffered from http://www.quickfixengine.org/quickfix/doc/html/index.html 

    I also downloaded sp1 for vs2005 by reading some blog (VS80sp1-KB926601-X86-ENU) .. but problem still occur..

     

    Wednesday, July 7, 2010 9:01 AM

Answers

  • Hi,

      I am no expert of quick fix engine.  Is there any unmanaged code involved? I have found some posts with the same symptoms. It seems it's related to callbacks into managed code from unmanaged code. This artilce proposed a solution with the delegate.

     

     


    Please mark the right answer at right time.
    Thanks,
    Sam
    • Marked as answer by SamAgain Thursday, July 15, 2010 5:25 AM
    Wednesday, July 14, 2010 7:49 AM

All replies

  • Hi,

      I am no expert of quick fix engine.  Is there any unmanaged code involved? I have found some posts with the same symptoms. It seems it's related to callbacks into managed code from unmanaged code. This artilce proposed a solution with the delegate.

     

     


    Please mark the right answer at right time.
    Thanks,
    Sam
    • Marked as answer by SamAgain Thursday, July 15, 2010 5:25 AM
    Wednesday, July 14, 2010 7:49 AM
  • We temporarily mark a reply, please remember to click "Mark as Answer" on the post that helps you, and to click "Unmark as Answer" if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    Please mark the right answer at right time.
    Thanks,
    Sam
    Thursday, July 15, 2010 5:25 AM