Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to receive structure from external object?
Message
 
 
À
21/02/2005 19:10:26
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
00988932
Message ID:
00989168
Vues:
23
Hi Peter,

Your code looks correct to me. Did you verify that lnHistory isn't zero? If nothing else works, you can write a wrapper DLL in VB6 and use it in VFP.
BTW, It looks to me like GetBar returns an object.

>Sure. The following VFP code crashes on the last line where I try to get goBar:
>
>
>LOCAL lcSymbol
>lcSymbol="IBM"
>
>PUBLIC goESignal
>goESignal=NEWOBJECT("IESignal.Hooks")
>goESignal.SetApplication ("**********") && UserID
>goESignal.RequestSymbol(lcSymbol,.T.)
>
>LOCAL lnHistory
>lnHistory=goESignal.RequestHistory(lcSymbol,"D", 1, 20, -1, -1)
>
>PUBLIC goBar as IESignal.BarData
>goBar=goESignal.GETBAR(lnHistory,1)
>
>
>
>The example code from the vendor was in VB. I extracted the following. It runs correctly in VB6:
>
>
>Dim WithEvents eSignal As IESignal.Hooks
>Private Sub cmdRequestHistory_Click()
>
>    Dim sLastSymbol As String
>    Dim lHistoryHandle As Long
>    Dim lLastHistoryCount As Long
>
>    Set eSignal = New IESignal.Hooks
>    eSignal.SetApplication ("peterbennett")
>
>    Dim sSymbol As String
>
>    sSymbol = "SIRI"
>
>    If lHistoryHandle <> 0 Then
>        eSignal.ReleaseHistory lHistoryHandle
>        lHistoryHandle = 0
>        lLastHistoryCount = 0
>    End If
>
>    lstHistory.Clear
>
>    lHistoryHandle = eSignal.RequestHistory(sSymbol, "D", 2, 20, -1, -1)
>
>    Dim BarItem As IESignal.BarData
>    BarItem = eSignal.GetBar(lHistoryHandle, -10)
>
>    Dim sRet As String
>    sRet = Str$(BarItem.dtTime)
>    sRet = sRet + ": " + Str$(BarItem.dOpen)
>    sRet = sRet + ", " + Str$(BarItem.dHigh)
>    sRet = sRet + ", " + Str$(BarItem.dLow)
>    sRet = sRet + ", " + Str$(BarItem.dClose)
>    Text1.Text = sRet
>
>End Sub
>
>
>The structure I'm trying to get back is of type IESignal.BarData
> which is defined as:
>
>
>Bar Time             datetime
>Open                 double
>High                 double
>Low                  double
>Close                double
>Volume               double
>Open Interest        double
>Bar Flags            bit
>Bid                  double
>Ask                  double
>Trade                double
>
>
>
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform