problem passing a treeview object to a dll from vb 6 program
I have a Sheridan (now Infragistics) Treeview control on a VB 6 form. I try to pass the treeview control object to a dll that also has a treeview control on its form. Sometimes the dll recognizes the passed object as a treeview control and sometimes it does not. I have added the DLL to my VB 6 program's references. It always works when the calling VB 6 program and the DLL are part of the same project, but sometimes when the VB 6 code (or compiled VB 6 program) run, this part of the DLL displays the error message that indicates that the SSTree object is not an ssactivetreeview control. I put the "If typeof.." statement in because when the code does not function it does not raise an error message, it just does nothing. The message "Error in DMDialog/SearchFolders - bad TypeOf SSTree " is what displays when it does not work, which indicates the treeview object is not passing correctly.
I am also enclosing the VB 6 code that calls the DLL. Can anyone tell me what iswrong with this? Thanks!
DLL code (Called code)
Public Function SearchFolders(SSTree As Object, sCabinetType As String, sFolder As String)
On Error GoTo SF_Err
Dim sLine As String
sLine = " 1"
If TypeOf SSTree Is ssactivetreeview.SSTree Then
sLine = " 2"
Call LoadTree(SSTree, sCabinetType, sFolder)
MsgBox (" Error in DMDialog/SearchFolders - bad TypeOf SSTree ")
MsgBox ("Err in DMDialog/SearchFolders " & sLine)
VB 6 executable (.EXE) code that calls the DLL above:
Set moDialog = New DMDialog.DialogClass
.Cabinet = gsCabinetType
Set .Connection = Dmdb
Set .SamConnection = Anidb
Set .ParisConnection = ParisPdb
Set .ProspectConnection = Prospdb
sLastErr = .LastErr.Num
slastErrorDesc = .LastErr.Msg
sLastErrorLocation = .LastErr.Proc
Call .SearchFolders(SSTree1, .Cabinet, txtName)
Last Post: 05-20-2002, 09:28 AM
Last Post: 04-08-2002, 10:19 AM
By Derek Mooney in forum .NET
Last Post: 10-29-2001, 09:44 PM
By cksiow in forum VB Classic
Last Post: 06-20-2001, 12:39 AM
By Todd Mitchell in forum VB Classic
Last Post: 04-09-2000, 01:48 AM
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL