Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How can I use this DLL (sample code in VB)?
Message
 
 
To
06/08/2007 14:52:19
Elyse Pomerantz
Dynamic Data Concepts, Inc.
Brooklyn, New York, United States
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
01246237
Message ID:
01246240
Views:
32
>I'm struggling to use a DLL that I purchased in my VFP application. Here is some of the sample code from the VB example (the name of the dll is "kaluachcom.dll"). I am specifically interested in using the GetParshaFirst function. It returns a number, but accepts no parameters. It's value is always based on a date, so I understand that the date is set on the object (k.Today()) and the function uses that date. How can I replicate this is VFP? Can I instantiate an object based on a dll? If not, and I need to DECLARE the functions, how do I pass parameters to a parameter-less function? Any help greatly appreciated.
>
>Inherits System.Windows.Forms.Form
>Public k As KALUACHCOMLib.KaluachS
>Public lngHDay As Integer
>Public lngHMonth As Integer
>Public lngHYear As Integer
>Public lngCDay As Integer
>Public lngCMonth As Integer
>Public lngCYear As Integer
>Public intOldVscroll As Short
>
>Private Sub Form1_Load(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles MyBase.Load
>   intOldVscroll = 0
>   k = New KALUACHCOMLib.KaluachS
>   k.Today()
>   GetDates((0))
>End Sub
>
>Public Sub GetDates(ByRef intMove As Short)
>   Dim i As Object
>   Dim dateCivil As Object
>   Dim intI As Short
>   Dim strRet As String
>	
>   k.MoveDay((intMove))
>	
>   lngHDay = k.GetHebrewDay
>   lngHMonth = k.GetHebrewMonth
>   lngHYear = k.GetHebrewYear
>	
>   lngCDay = k.GetCivilDay
>   lngCMonth = k.GetCivilMonth
>   lngCYear = k.GetCivilYear
>	
>   dateCivil = DateSerial(lngCYear, lngCMonth, lngCDay)
>   Me.strHebrew.Text = lngHDay & " " & HebrewMonth(lngHMonth) & " " & lngHYear
>   Me.strCivil.Text = VB6.Format(dateCivil, "dd mmmm yyyy")
>	
>   If k.GetParshaFirst <> 0 Then
>      strRet = "Shabbat - Parshat " & Parsha(k.GetParshaFirst) & " " & Parsha(k.GetParshaSecond) & " " & SpecialShabbat(k.GetParshaSpecial)
>   Else
>      strRet = "Shabbat " & Parsha(k.GetParshaFirst) & " " & Parsha(k.GetParshaSecond) & " " & SpecialShabbat(k.GetParshaSpecial)
>   End If
>	
>   Me.Text1.Text = strRet
>End Sub
>
Did you try after registering this DLL
k = createobject('KALUACHCOMLib.KaluachS')
k.MoveDay(0)
etc. and see if Intellisense will kick in?
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform