I have plugin DLL I have written in VB.NET that I am using to test some ideas I have. I have gotten the commands to work in DBPRo to show a message box when I use the command.
I am now working on a concept test command to send the handle of a BlueGUI2 panel control to the DLL, and then I want to add controls manually using .NETs System.Windows.Forms.Control.Add() function.
The problem I am stuck at, is how to pass the handle. VB.NET wants the value as a System.IntPtr value. I try the following code in the DLL:
Public Class Class1
Shared Sub TestIt(ByVal hwnd As System.IntPtr)
Dim frm As System.Windows.Forms.Control
Dim bt As System.Windows.Forms.Button
frm = System.Windows.Forms.Control.FromHandle(hwnd)
bt = New System.Windows.Forms.Button
bt.Text = "Booya"
bt.Width = 100
bt.Height = 50
bt.Top = 50
bt.Left = 50
frm.Controls.Add(bt)
End Sub
End Class
And the sub is called in DBPro as such:
pnlBottom=createPanel(200,320,392,205,0)
setPanelBorderStyle pnlBottom,BORDER_3D
testit pnlBottom
Unfortunately the whole thing compiles just fine, but pukes on me when it trys to run the program. Any clue how I might pass this handle so that .NET can utilize it? I am using .NET 2005
Design documents?!? What design documents??? I thought we were just going to wing it!!!