Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Visual Basic 6 COM interface errors

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    imported post

    Ray,

    Bad news for me but I can handle that!

    So I will use NT for sending/changing/cancelling Trades via VB 6 only. But for this I still need the functions in the NTDirect.dll to be able to control the trades. As I said, even in the very helpful sample program (thanks to MarlinTrader) they don't work!

    Still hope! Thanks!

    Vlado


    Comment


      #17
      I encountered the same problem. I tried to call DLL functions with VB 6.0. However, some functions don't work. The functions "OrderStatus" and "NewOrderId" return nothing. I guess the reason is that for those functions return a string, the Ninja Trader DLL return the data type as LPSTR instead of LPCTSTR.

      May I suggest to solve this problem in the next version, say NT 6.5?
      Perhaps, you can add some new functions such "OrderStatusVB" and "NewOrderIdVB", etc., which return the data type as LPCTSTR.

      Comment


        #18
        I suggest trying the DLL interface if you encounter problems on the COM interface.

        Comment


          #19
          Thank you for your reply.
          I've tried the DLL interface. However, the functions, which return string such as "OrderStatus" and "NewOrderId", don't work. I'm pretty sure this is because of the return data type problem as I explained in the previous post.

          Comment


            #20
            Interfaces do work, since they work in e.g. in the TradeStation context.

            Comment


              #21
              yes, the DLL functions do work for Tradestation but not for VB 6.0
              As I have explained earlier, that's because of the difference of the string data type between VC and VB.

              For example, you may have used these parameters in your Win32 DLL function "OrderStatus":

              LPSTR _stdcall OrderStatus(LPSTR orderId)
              {
              ......
              ......
              }

              However, from my experience, this won't work for VB. The function should be modified as:

              LPCTSTR _stdcall OrderStatus(LPSTR orderId)
              {
              ......
              ......
              }

              However, the modified function will work for VB but may not work properly for Tradestation. The same applies for all functions, which return the string data type. So may I suggest to add some new functions for VB in the next version as follows:

              LPCTSTR _stdcall OrderStatusVB(LPSTR orderId)
              LPCTSTR _stdcall NewOrderIdVB()
              LPCTSTR _stdcall OrdersVB(LPSTR account)
              LPCTSTR _stdcall StrategiesVB(LPSTR account)

              Comment


                #22
                Thanks for clarification and suggestion. I suggest going by TradeStation or eSignal logic and you will be fine.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by jaybedreamin, Today, 05:56 PM
                0 responses
                3 views
                0 likes
                Last Post jaybedreamin  
                Started by DJ888, 04-16-2024, 06:09 PM
                6 responses
                18 views
                0 likes
                Last Post DJ888
                by DJ888
                 
                Started by Jon17, Today, 04:33 PM
                0 responses
                1 view
                0 likes
                Last Post Jon17
                by Jon17
                 
                Started by Javierw.ok, Today, 04:12 PM
                0 responses
                6 views
                0 likes
                Last Post Javierw.ok  
                Started by timmbbo, Today, 08:59 AM
                2 responses
                10 views
                0 likes
                Last Post bltdavid  
                Working...
                X