I just received the following response from a vendor of .NET controls. I asked why do they have three DLLs, I was expecting just one (the equivalent ocx product which I use ctSchedule.ocx has just one) . Does the response mean that I just need to use StartDotNet, Set_Property AssemblyName and create_class_net with dbiSchedule or do I somehow have to do this with all three DLLs?
The response form the vendor follows:
The Dbi4 and dbiPim4 DLL files are base assembly files, these are used and inherited from by our .NET controls, and contain more general functionality and features which are used among multiple (if not all of) the controls (for example the Enumerations used for the FillTypes inside of our .NET controls comes from the Dbi4.dll. This allows us to make any additions to the FillTypes we need, but only have to change one file, it will then be reflected inside of all our other controls). The dbiTimeBarItem objects found inside of the dbiSchedule control, are in fact inherited dbiAppointmentItems from the dbiPim.dll, but they are then extended to have additional properties and features to better fit a multi-resource scheduling environment.The main control you will be interacting with is the dbiSchedule.dll. This is the one that will be drawn on your form and your users will be interacting with, just like the ctSchedule.ocx.
The tech is saying that the dbiSchedule.dll has dependencies on the other two files. The dbiSchedule.dll probably expects to instantiate objects and properties from the other two files.
Do the VB code examples show any direct interaction with the other two files?
Not that I can tell. Let me see what happens if I just start using this control. Unless I am missing something I think that all the interaction is "behind the scenes" and I shouldn't have to worry about it.
OK, I am starting to understand how this works I just need (I think) a little guidance on how to translate the VB code I am looking at into RBasic.
Following RBasic code correctly allows me retrieve the methods for a given class in the .NET control. So I think I understand this so far.
$Insert REVDOTNETEQUATES
myGantt=StartDotNet(@WINDOW:".DBISCHEDULE")
rslt=Set_Property.net(myGantt, "AssemblyName", "C:\Windows\System32\dbiSchedule.dll")
myClass=Dbi.WinControl.Schedule.dbiSchedule"
hndCtrl=create_class.net(myGantt, myClass)
mthds=get_info.net(hndCtrl, REVDOTNET_INFO_METHODS)
So how would I code the following VB code? I can see I will have to create two classes DbiScheduleItem and DbiSchedule. How do I code the rest?
Dim DbiScheduleItem1 As Dbi.WinControl.Schedule.dbiScheduleItem
DbiScheduleItem1=New Dbi.WinControl.Schedule.dbiScheduleItem
DbiScheduleItem1.Text=My Schedule Item"
Me.DbiSchedule1.Items.Add(DbiScheduleItem1)
Below are the VB lines commented out along with the corresponding RBasic lines.
*Dim DbiScheduleItem1 As Dbi.WinControl.Schedule.dbiScheduleItem
schedItemClass=Dbi.WinControl.Schedule.dbiScheduleItem"
*DbiScheduleItem1=New Dbi.WinControl.Schedule.dbiScheduleItem
hndSchedItem=create_class.net(myGnatt, schedItemClass)
*DbiScheduleItem1.Text=My Schedule Item"
rslt=set_property.net(hndSchedItem, "Text", "My Schedule Item")
*Me.DbiSchedule1.Items.Add(DbiScheduleItem1)
rslt=send_message.net(myGnatt, "Dbischedule1.Items.Add", hndSchedItem, schedItemClass)
I'm not positive the last line is correct. The Me.DbiSchedule1.Items.Add doesn't make sense and I'm not sure where DbiSchedule1 gets instantiated. The self reference "Me." code might not work in RevDotNet. Instead, a reference to the "Dbischedule1.Items" object inside of the "Dbi.WinControl.Schedule.dbiSchedule" class you created might be required.
Could you post the VB code where DbiSchedule1 is created?
In the example that was all of the code.
Let me play with this and see if I can figure it out. I think you might have given me enough of a idea to do this.
OK, getting there but still trying to understand how this works. What would the final line be in the below code?
$Insert CMCOMMON
$Insert REVDOTNETEQUATES
myGantt=StartDotNet(@WINDOW:".DBISCHEDULE")
rslt=Set_Property.net(myGantt, "AssemblyName", "C:\Windows\System32\dbiSchedule.dll")
* Dim DbiScheduleItem1 As Dbi.WinControl.Schedule.dbiScheduleItem
myClass=Dbi.WinControl.Schedule.dbiScheduleItem"
* DbiScheduleItem1=New Dbi.WinControl.Schedule.dbiScheduleItem
DbiScheduleItem1=create_class.net(myGantt, myClass)
* DbiScheduleItem1.Text=My Schedule Item"
rslt=Set_Property.net(DbiScheduleItem1, "Text", "This is a test")
* rslt below contains "This is a test" so we are good so far
rslt=Get_Property.net(DbiScheduleItem1, "Text")
* Me.DbiSchedule1.Items.Add(DbiScheduleItem1)
* ??? what goes here?
Return
OK I think last lines should read
* Me.DbiSchedule1.Items.Add(DbiScheduleItem1)
hndlItems=Get_Property.net(DbiSchedule, "Items", "1")
rslt=Send_Message.net(hndlItems, "Add", DbiScheduleItem1)
It doesn't work (or doesn't appear to anyway), does the above look correct?
Well I think I understand how this works, but the code doesn't do what it should (ie in this case add a column to the control)
Any ideas?
$Insert REVDOTNETEQUATES
myGantt=StartDotNet(@WINDOW:".DBISCHEDULE")
rslt=Set_Property.net(myGantt, "AssemblyName", "C:\Windows\System32\dbiSchedule.dll")
DbiSchedule1=Create_Class.net(myGantt, "Dbi.WinControl.Schedule.dbiSchedule")
* Dim objColumn As dbi.WinControl.dbiColumnItem
* objColumn=New dbi.WinControl.dbiColumnItem("Room", 150)
DbiScheduleColItem1=Create_Class.net(myGantt, "Dbi.WinControl.dbiColumnItem", "Test", 150)
* DbiSchedule1.Columns.Add(objColumn)
hndlCols=Get_Property.net(DbiSchedule1, "Columns", "1")
rslt=Send_Message.net(hndlCols, "Add", DbiScheduleColItem1)
I'm referring with a colleague on how to handle this .Net interaction. As soon as I have more information I'll post back.
According to the help file the line:
DbiScheduleColItem1=Create_Class.net(myGantt, "Dbi.WinControl.dbiColumnItem", "Test", 150)
appears to be incorrect. The function definition for create_class is:
CREATE_CLASS.NET(dotNetHandle, ClassName, {bIsVisible}, {CreateParams, ParamTypes})
It should probably be along the lines of:
DbiScheduleColItem1=Create_Class.net(myGantt, "Dbi.WinControl.dbiColumnItem","1", "Test" :@FM: 150, "System.String" :@FM: "System.Int32")
Notice, the "1" in the 3rd param. The 3rd param is a visible flag. I assume this control is displaying on the screen.
Also if you use the set/get status functions can you tell what is happening?
Call Set_Status(0)
hndlCal=create_class.net(DotNetHandle, ourClass)
If Get_Status(err) Then
err=err
debug
End
The following code at the debug err=Error in SetProperty: Could not find property 'Parent'
$Insert REVDOTNETEQUATES
myGantt=StartDotNet(@WINDOW:".DBISCHEDULE")
rslt=Set_Property.net(myGantt, "AssemblyName", "C:\Windows\System32\dbiSchedule.dll")
Call Set_Status(0)
DbiSchedule1=Create_Class.net(myGantt, "Dbi.WinControl.Schedule.dbiSchedule", "1")
* Dim objColumn As dbi.WinControl.dbiColumnItem
* objColumn=New dbi.WinControl.dbiColumnItem("Room", 150)
Call Set_Status(0)
DbiScheduleColItem1=Create_Class.net(myGantt, "Dbi.WinControl.dbiColumnItem", "1", "Test":@FM:150, "System.String":@FM:"System.Int32")
if Get_Status(err) then
err=errdebugend