Thread: RE: [Quickfix-developers] Problem with VB.NET
Brought to you by:
orenmnero
From: <or...@qu...> - 2004-05-31 17:53:01
Attachments:
Application.h
|
<div>Ok, I've fixed this and was able to run your sample application with no problem. It appears that VB.NET got confused about const pointers that were declared in MC++. I've attached a new quickfix/src/.NET/Application.h file. If you replace the one you have with this one you should be all set. I'll check this into CVS and it will be in the next release as well.<BR></div> <div>Sam, I CC'd you on this because while researching this I noticed you posted the same problem earlier to the mailing list. Don't know if it is still of interest to you but here is the fix.</div> <div> </div> <div>--oren</div> <BLOCKQUOTE style="PADDING-LEFT: 8px; MARGIN-LEFT: 8px; BORDER-LEFT: blue 2px solid"><BR>-------- Original Message --------<BR>Subject: [Quickfix-developers] Problem with VB.NET<BR>From: "Ramprakash Umapathy" <ram...@ca...><BR>Date: Mon, May 24, 2004 5:43 am<BR>To: qui...@li...<BR><BR>Hi All,<BR><BR>I'm a newbie trying to use QuickFix in VB.NET<BR><BR>I ran into problems with my code here. Could anyone of help me to solve. I<BR>have seen a similar post with no answers. I use like this in my VB.NET code,<BR><BR><BR>Imports QuickFix<BR>Public Class QFapp<BR> Inherits QuickFix.MessageCracker<BR> Implements QuickFix.Application<BR><BR> Public Sub toApp(ByVal msg As QuickFix.Message, ByVal sid As<BR>QuickFix.SessionID) Implements QuickFix.Application.toApp<BR> End Sub<BR><BR> Public Sub fromAdmin(ByVal msg As QuickFix.Message, ByVal sid As<BR>QuickFix.SessionID) Implements QuickFix.Application.fromAdmin<BR> End Sub<BR><BR> Public Sub onCreate(ByVal sid As QuickFix.SessionID) Implements<BR>QuickFix.Application.onCreate<BR> End Sub<BR><BR> Public Sub onLogon(ByVal sid As QuickFix.SessionID) Implements<BR>QuickFix.Application.onLogon<BR> End Sub<BR><BR> Public Sub onLogout(ByVal sid As QuickFix.SessionID) Implements<BR>QuickFix.Application.onLogout<BR> End Sub<BR><BR> Public Sub toAdmin(ByVal msg As QuickFix.Message, ByVal sid As<BR>QuickFix.SessionID) Implements QuickFix.Application.toAdmin<BR> End Sub<BR><BR> Public Sub fromApp(ByVal msg As QuickFix.Message, ByVal sid As<BR>QuickFix.SessionID) Implements QuickFix.Application.fromApp<BR> End Sub<BR><BR>End Class<BR><BR>And then I call like this,<BR><BR>Imports QuickFix<BR><BR>Module Module1<BR><BR> Sub Main()<BR><BR> Try<BR><BR> 'Get Setting from ini file<BR> Dim ss As New SessionSettings("c:\client.ini")<BR> Dim sInit As SocketInitiator<BR> Dim sapp As New QFapp<BR><BR> Dim storeFactory As New FileStoreFactory(ss)<BR> Dim logFactory As New FileLogFactory("c:\test.log")<BR> Dim msgFactory As New DefaultMessageFactory<BR><BR><BR> 'Initiator Section<BR> sInit = New SocketInitiator(sapp, storeFactory, ss, msgFactory)<BR> 'sInit = New SocketAcceptor(sapp, storeFactory, ss, logFactory,<BR>msgFactory)<BR><BR> sInit.start()<BR><BR> sInit.stop()<BR><BR><BR><BR><BR><BR> Catch ex As System.Exception<BR><BR> Trace.WriteLine(ex.Message)<BR> Trace.WriteLine(ex.StackTrace)<BR><BR> End Try<BR><BR> End Sub<BR><BR>End Module<BR><BR><BR>The System throws an Error (doesn't even caught in Catch Block) with the<BR>following message,<BR><BR><BR>An unhandled exception of type 'System.TypeLoadException' occurred in<BR>Unknown Module.<BR><BR>Additional information: Signature of the body and declaration in a method<BR>implementation do not match. Type: TestFixEngine.QFapp. Assembly:<BR>TestFixEngine, Version=1.0.1605.20104, Culture=neutral, PublicKeyToken=null.<BR><BR>TIA,<BR><BR>Holy<BR><BR><BR>P.S: I could be helpful in anyone of you point out the QuickFix VB.NET<BR>Resources<BR><BR><BR><BR>-------------------------------------------------------<BR>This SF.Net email is sponsored by: Oracle 10g<BR>Get certified on the hottest thing ever to hit the market... Oracle 10g. <BR>Take an Oracle 10g class now, and we'll give you the exam FREE.<BR>http://ads.osdn.com/?ad_id149&alloc_id66&op=click<BR>_______________________________________________<BR>Quickfix-developers mailing list<BR>Qui...@li...<BR>https://lists.sourceforge.net/lists/listinfo/quickfix-developers </BLOCKQUOTE> |
From: Ramprakash U. <ram...@ca...> - 2004-06-04 08:12:52
|
Hi Oren, =20 The FIX works fine and thanks. =20 I looking for the code snippets to do the following, =20 1. How to check for a particular session user is already logged on or = the connection is alive? ( I see a method isLoggedOn in Acceptor and = Initiator classes but not sure how to use in my VB code) =20 2. How to handle a situation in case of application breakdown (with some code sample?!) ?=20 =20 3. How can I pass the parameters for SessionSettings from own customized application (not by using configuration files (*.cfg or whatsoever)? =20 TIA, Ramprakash =20 =20 P.S : The sender is a newbie (to both QuickFix and :NET Technologies) = and prefers to have code samples in VB.NET / C# =20 =20 -----Original Message----- From: qui...@li... [mailto:qui...@li...] On Behalf Of or...@qu... Sent: luned=EC 31 maggio 2004 19:53 To: Ramprakash Umapathy Cc: qui...@li...; sa...@uc... Subject: RE: [Quickfix-developers] Problem with VB.NET Ok, I've fixed this and was able to run your sample application with no problem. It appears that VB.NET got confused about const pointers that = were declared in MC++. I've attached a new quickfix/src/.NET/Application.h = file. If you replace the one you have with this one you should be all set. = I'll check this into CVS and it will be in the next release as well. Sam, I CC'd you on this because while researching this I noticed you = posted the same problem earlier to the mailing list. Don't know if it is still = of interest to you but here is the fix. =20 --oren -------- Original Message -------- Subject: [Quickfix-developers] Problem with VB.NET From: "Ramprakash Umapathy" <ram...@ca...> Date: Mon, May 24, 2004 5:43 am To: qui...@li... Hi All, I'm a newbie trying to use QuickFix in VB.NET I ran into problems with my code here. Could anyone of help me to solve. = I have seen a similar post with no answers. I use like this in my VB.NET = code, Imports QuickFix Public Class QFapp Inherits QuickFix.MessageCracker Implements QuickFix.Application Public Sub toApp(ByVal msg As QuickFix.Message, ByVal sid As QuickFix.SessionID) Implements QuickFix.Application.toApp End Sub Public Sub fromAdmin(ByVal msg As QuickFix.Message, ByVal sid As QuickFix.SessionID) Implements QuickFix.Application.fromAdmin End Sub Public Sub onCreate(ByVal sid As QuickFix.SessionID) Implements QuickFix.Application.onCreate End Sub Public Sub onLogon(ByVal sid As QuickFix.SessionID) Implements QuickFix.Application.onLogon End Sub Public Sub onLogout(ByVal sid As QuickFix.SessionID) Implements QuickFix.Application.onLogout End Sub Public Sub toAdmin(ByVal msg As QuickFix.Message, ByVal sid As QuickFix.SessionID) Implements QuickFix.Application.toAdmin End Sub Public Sub fromApp(ByVal msg As QuickFix.Message, ByVal sid As QuickFix.SessionID) Implements QuickFix.Application.fromApp End Sub End Class And then I call like this, Imports QuickFix Module Module1 Sub Main() Try 'Get Setting from ini file Dim ss As New SessionSettings("c:\client.ini") Dim sInit As SocketInitiator Dim sapp As New QFapp Dim storeFactory As New FileStoreFactory(ss) Dim logFactory As New FileLogFactory("c:\test.log") Dim msgFactory As New DefaultMessageFactory 'Initiator Section sInit =3D New SocketInitiator(sapp, storeFactory, ss, = msgFactory) 'sInit =3D New SocketAcceptor(sapp, storeFactory, ss, = logFactory, msgFactory) sInit.start() sInit.stop() Catch ex As System.Exception Trace.WriteLine(ex.Message) Trace.WriteLine(ex.StackTrace) End Try End Sub End Module The System throws an Error (doesn't even caught in Catch Block) with the following message, An unhandled exception of type 'System.TypeLoadException' occurred in Unknown Module. Additional information: Signature of the body and declaration in a = method implementation do not match. Type: TestFixEngine.QFapp. Assembly: TestFixEngine, Version=3D1.0.1605.20104, Culture=3Dneutral, = PublicKeyToken=3Dnull. TIA, Holy P.S: I could be helpful in anyone of you point out the QuickFix VB.NET Resources ------------------------------------------------------- This SF.Net email is sponsored by: Oracle 10g Get certified on the hottest thing ever to hit the market... Oracle 10g. = Take an Oracle 10g class now, and we'll give you the exam FREE. http://ads.osdn.com/?ad_id149&alloc_id=8166&op=3Dclick _______________________________________________ Quickfix-developers mailing list Qui...@li... https://lists.sourceforge.net/lists/listinfo/quickfix-developers=20 |
From: Oren M. <or...@qu...> - 2004-06-04 18:02:15
|
Ramprakash, The onLogoff and onLogon callbacks give you a sessionID. What I=20 usually do is keep a hash and add the sessionID in the onLogon call,=20 and remove it in the onLogoff call. Alternatively you can call the static lookupSession method on the=20 session class, and call isLoggedOn on the resulting Session object. =20 This way you can rely on QF to keep track of who is logged on for you. There isn't really anything special you need to do to handle an=20 application breakdown. QuickFIX will send you any messages that you=20 hadn't processed in the time you went down to when you come back up. =20 This should be transparent to you. One thing I would recommend for=20 high speed lines, is to send out a TestRequest message, and only begin=20= sending new messages when you get a response. In addition to taking a filename, the sessionsettings class can take=20 any stream in its constructor. So you can create a MemoryStream and=20 pass it in. Just make sure the contents of the stream are in the same=20= format as a configuration file. --oren On Jun 4, 2004, at 3:12 AM, Ramprakash Umapathy wrote: > Hi Oren, > =A0 > The FIX works fine and thanks. > =A0 > I looking=A0for the code snippets to do the following, > =A0 > 1. How to check for a particular session user=A0is already logged on = or=20 > the connection is alive? ( I see a method isLoggedOn in Acceptor and=20= > Initiator classes but not sure how to use in my VB code) > =A0 > 2. How to handle a situation in case of application breakdown (with=20 > some code sample?!) ? > =A0 > 3. How can I pass the parameters for SessionSettings from own=20 > customized application (not by using configuration files (*.cfg or=20 > whatsoever)? > =A0 > TIA, > Ramprakash > =A0 > =A0 > P.S : The sender is a newbie (to both QuickFix and :NET Technologies)=20= > and prefers to have code samples in VB.NET / C# > =A0 > =A0 > -----Original Message----- > From: qui...@li...=20 > [mailto:qui...@li...] On Behalf Of=20= > or...@qu... > Sent: luned=EC 31 maggio 2004 19:53 > To: Ramprakash Umapathy > Cc: qui...@li...; sa...@uc... > Subject: RE: [Quickfix-developers] Problem with VB.NET > > Ok, I've fixed this and was able to run your sample application with=20= > no problem.=A0 It appears that VB.NET got confused about const = pointers=20 > that were declared in MC++.=A0 I've attached a new=20 > quickfix/src/.NET/Application.h file.=A0If you replace the one you = have=20 > with this one you should be all set.=A0 I'll check this into CVS and = it=20 > will be in the next release as well. > Sam, I CC'd you on this because while researching this I noticed you=20= > posted the same problem earlier to the mailing list.=A0 Don't know if = it=20 > is still of interest to you but here is the fix. > =A0 > --oren > > -------- Original Message -------- > Subject: [Quickfix-developers] Problem with VB.NET > From: "Ramprakash Umapathy" <ram...@ca...> > Date: Mon, May 24, 2004 5:43 am > To: qui...@li... > > Hi All, > > I'm a newbie trying to use QuickFix in VB.NET > > I ran into problems with my code here. Could anyone of help me to=20 > solve. I > have seen a similar post with no answers. I use like this in my VB.NET=20= > code, > > > Imports QuickFix > Public Class QFapp > =A0 =A0Inherits QuickFix.MessageCracker > =A0 =A0Implements QuickFix.Application > > =A0 =A0Public Sub toApp(ByVal msg As QuickFix.Message, ByVal sid As > QuickFix.SessionID) Implements QuickFix.Application.toApp > =A0 =A0End Sub > > =A0 =A0Public Sub fromAdmin(ByVal msg As QuickFix.Message, ByVal sid = As > QuickFix.SessionID) Implements QuickFix.Application.fromAdmin > =A0 =A0End Sub > > =A0 =A0Public Sub onCreate(ByVal sid As QuickFix.SessionID) Implements > QuickFix.Application.onCreate > =A0 =A0End Sub > > =A0 =A0Public Sub onLogon(ByVal sid As QuickFix.SessionID) Implements > QuickFix.Application.onLogon > =A0 =A0End Sub > > =A0 =A0Public Sub onLogout(ByVal sid As QuickFix.SessionID) Implements > QuickFix.Application.onLogout > =A0 =A0End Sub > > =A0 =A0Public Sub toAdmin(ByVal msg As QuickFix.Message, ByVal sid As > QuickFix.SessionID) Implements QuickFix.Application.toAdmin > =A0 =A0End Sub > > =A0 =A0Public Sub fromApp(ByVal msg As QuickFix.Message, ByVal sid As > QuickFix.SessionID) Implements QuickFix.Application.fromApp > =A0 =A0End Sub > > End Class > > And then I call like this, > > Imports QuickFix > > Module Module1 > > =A0 =A0Sub Main() > > =A0 =A0 =A0 =A0Try > > =A0 =A0 =A0 =A0 =A0 =A0'Get Setting from ini file > =A0 =A0 =A0 =A0 =A0 =A0Dim ss As New SessionSettings("c:\client.ini") > =A0 =A0 =A0 =A0 =A0 =A0Dim sInit As SocketInitiator > =A0 =A0 =A0 =A0 =A0 =A0Dim sapp As New QFapp > > =A0 =A0 =A0 =A0 =A0 =A0Dim storeFactory As New FileStoreFactory(ss) > =A0 =A0 =A0 =A0 =A0 =A0Dim logFactory As New = FileLogFactory("c:\test.log") > =A0 =A0 =A0 =A0 =A0 =A0Dim msgFactory As New DefaultMessageFactory > > > =A0 =A0 =A0 =A0 =A0 =A0'Initiator Section > =A0 =A0 =A0 =A0 =A0 =A0sInit =3D New SocketInitiator(sapp, = storeFactory, ss,=20 > msgFactory) > =A0 =A0 =A0 =A0 =A0 =A0'sInit =3D New SocketAcceptor(sapp, = storeFactory, ss,=20 > logFactory, > msgFactory) > > =A0 =A0 =A0 =A0 =A0 =A0sInit.start() > > =A0 =A0 =A0 =A0 =A0 =A0sInit.stop() > > > > > > =A0 =A0 =A0 =A0Catch ex As System.Exception > > =A0 =A0 =A0 =A0 =A0 =A0Trace.WriteLine(ex.Message) > =A0 =A0 =A0 =A0 =A0 =A0Trace.WriteLine(ex.StackTrace) > > =A0 =A0 =A0 =A0End Try > > =A0 =A0End Sub > > End Module > > > The System throws an Error (doesn't even caught in Catch Block) with=20= > the > following message, > > > An unhandled exception of type 'System.TypeLoadException' occurred in > Unknown Module. > > Additional information: Signature of the body and declaration in a=20 > method > implementation do not match. =A0Type: TestFixEngine.QFapp. =A0Assembly: > TestFixEngine, Version=3D1.0.1605.20104, Culture=3Dneutral,=20 > PublicKeyToken=3Dnull. > > TIA, > > Holy > > > P.S: I could be helpful in anyone of you point out the QuickFix VB.NET > Resources > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: Oracle 10g > Get certified on the hottest thing ever to hit the market... Oracle=20 > 10g. > Take an Oracle 10g class now, and we'll give you the exam FREE. > http://ads.osdn.com/?ad_id149&alloc_id=8166&op=3Dclick > _______________________________________________ > Quickfix-developers mailing list > Qui...@li... > https://lists.sourceforge.net/lists/listinfo/quickfix-developers |
From: Ramprakash U. <ram...@ca...> - 2004-06-25 13:25:05
|
Hi Oren, =20 Long time back you suggested me before sending FIX Message to send ot = some TestRequest Message and begin sending messages when you get a response =20 I'm having a trouble in trapping the Response of the TestRequest = Message. =20 Right now In VB.NET code, I Send Test Request like this, =20 Public Sub GenerateTestRequest() Try Dim QFTest As New QuickFix42.TestRequest(New QuickFix.TestReqID("TEST MESSAGE")) =20 Session.sendToTarget(QFTest, "umapar1a", "s09183") Catch ex As System.Exception Throw (ex) End Try End Sub I got trap the response of the TestMessage in FromAdmin. I have = diffculting in trapping this response and then starting sending messages. Could = anyone of you help with a sample code in VB.NET? Is it a good practise to send = a testmessage before start sending messages or just check IsLoggedOn = property of the Session object returns True is enough? The code sample (or skeleton) should be like this, Just Send a Test Message and after the TestRequest Response is received start sending the messages. TIA, Ramprakash -----Original Message----- From: Oren Miller [mailto:or...@qu...]=20 Sent: venerd=EC 4 giugno 2004 20:02 To: Ramprakash Umapathy Cc: qui...@li... Subject: Re: [Quickfix-developers] Problem with VB.NET Ramprakash, The onLogoff and onLogon callbacks give you a sessionID. What I usually = do is keep a hash and add the sessionID in the onLogon call, and remove it = in the onLogoff call. Alternatively you can call the static lookupSession method on the = session class, and call isLoggedOn on the resulting Session object. This way you = can rely on QF to keep track of who is logged on for you. There isn't really anything special you need to do to handle an = application breakdown. QuickFIX will send you any messages that you hadn't processed = in the time you went down to when you come back up. This should be = transparent to you. One thing I would recommend for high speed lines, is to send out = a TestRequest message, and only begin sending new messages when you get a response. In addition to taking a filename, the sessionsettings class can take any stream in its constructor. So you can create a MemoryStream and pass it = in. Just make sure the contents of the stream are in the same format as a configuration file. --oren On Jun 4, 2004, at 3:12 AM, Ramprakash Umapathy wrote: Hi Oren, =20 The FIX works fine and thanks. =20 I looking for the code snippets to do the following, =20 1. How to check for a particular session user is already logged on or = the connection is alive? ( I see a method isLoggedOn in Acceptor and = Initiator classes but not sure how to use in my VB code) =20 2. How to handle a situation in case of application breakdown (with some code sample?!) ? =20 3. How can I pass the parameters for SessionSettings from own customized application (not by using configuration files (*.cfg or whatsoever)? =20 TIA, Ramprakash =20 =20 P.S : The sender is a newbie (to both QuickFix and :NET Technologies) = and prefers to have code samples in VB.NET / C# =20 =20 -----Original Message----- From: qui...@li... [mailto:qui...@li...] On Behalf Of or...@qu... Sent: luned=EC 31 maggio 2004 19:53 To: Ramprakash Umapathy Cc: qui...@li...; sa...@uc... Subject: RE: [Quickfix-developers] Problem with VB.NET Ok, I've fixed this and was able to run your sample application with no problem. It appears that VB.NET got confused about const pointers that = were declared in MC++. I've attached a new quickfix/src/.NET/Application.h = file. If you replace the one you have with this one you should be all set. = I'll check this into CVS and it will be in the next release as well. Sam, I CC'd you on this because while researching this I noticed you = posted the same problem earlier to the mailing list. Don't know if it is still = of interest to you but here is the fix. =20 --oren -------- Original Message -------- Subject: [Quickfix-developers] Problem with VB.NET From: "Ramprakash Umapathy" <ram...@ca...> Date: Mon, May 24, 2004 5:43 am To: qui...@li... Hi All, I'm a newbie trying to use QuickFix in VB.NET I ran into problems with my code here. Could anyone of help me to solve. = I have seen a similar post with no answers. I use like this in my VB.NET = code, Imports QuickFix Public Class QFapp Inherits QuickFix.MessageCracker Implements QuickFix.Application Public Sub toApp(ByVal msg As QuickFix.Message, ByVal sid As QuickFix.SessionID) Implements QuickFix.Application.toApp End Sub Public Sub fromAdmin(ByVal msg As QuickFix.Message, ByVal sid As QuickFix.SessionID) Implements QuickFix.Application.fromAdmin End Sub Public Sub onCreate(ByVal sid As QuickFix.SessionID) Implements QuickFix.Application.onCreate End Sub Public Sub onLogon(ByVal sid As QuickFix.SessionID) Implements QuickFix.Application.onLogon End Sub Public Sub onLogout(ByVal sid As QuickFix.SessionID) Implements QuickFix.Application.onLogout End Sub Public Sub toAdmin(ByVal msg As QuickFix.Message, ByVal sid As QuickFix.SessionID) Implements QuickFix.Application.toAdmin End Sub Public Sub fromApp(ByVal msg As QuickFix.Message, ByVal sid As QuickFix.SessionID) Implements QuickFix.Application.fromApp End Sub End Class And then I call like this, Imports QuickFix Module Module1 Sub Main() Try 'Get Setting from ini file Dim ss As New SessionSettings("c:\client.ini") Dim sInit As SocketInitiator Dim sapp As New QFapp Dim storeFactory As New FileStoreFactory(ss) Dim logFactory As New FileLogFactory("c:\test.log") Dim msgFactory As New DefaultMessageFactory 'Initiator Section sInit =3D New SocketInitiator(sapp, storeFactory, ss, = msgFactory) 'sInit =3D New SocketAcceptor(sapp, storeFactory, ss, = logFactory, msgFactory) sInit.start() sInit.stop() Catch ex As System.Exception Trace.WriteLine(ex.Message) Trace.WriteLine(ex.StackTrace) End Try End Sub End Module The System throws an Error (doesn't even caught in Catch Block) with the following message, An unhandled exception of type 'System.TypeLoadException' occurred in Unknown Module. Additional information: Signature of the body and declaration in a = method implementation do not match. Type: TestFixEngine.QFapp. Assembly: TestFixEngine, Version=3D1.0.1605.20104, Culture=3Dneutral, = PublicKeyToken=3Dnull. TIA, Holy P.S: I could be helpful in anyone of you point out the QuickFix VB.NET Resources ------------------------------------------------------- This SF.Net email is sponsored by: Oracle 10g Get certified on the hottest thing ever to hit the market... Oracle 10g. Take an Oracle 10g class now, and we'll give you the exam FREE. http://ads.osdn.com/?ad_id149&alloc_id=8166&op=3Dclick _______________________________________________ Quickfix-developers mailing list Qui...@li... https://lists.sourceforge.net/lists/listinfo/quickfix-developers |