Bhagyshree Dakshinkar
New member
- Joined
- Jun 4, 2013
- Messages
- 1
- Programming Experience
- 5-10
I want to convert VB6 project to VB.Net. I an facing some problems.
I have separated huge VB6 project into separate dlls based in functionality. All business logic is in dll and UI is in exe program.
Out of all dlls, one dll only caontains UDT(User Defined Types) and it's used by Main exe program and all other dlls. Now I want to Convert all dlls and main program in VB.Net STEP BY STEP. I have decided to convert all dlls first and then main program.
If I convert other dll to .Net I ran into Case1 error
If I convert UDT dll to .Net using Structure, I got case 2 error
I am giving my dummy code for both the cases and problem/error description below.
Case 1:
UDT dll is in VB6 -->Name: Dll_EmployeeType
Type Employee_Properties
Employee_Id as integer
Employee_Name as String
Employee_Address as string
End Type
.Net Dll -->Name: Dll_Employee_Methods --> this refers vb6 dll Dll_EmployeeType
Class Cls_Employee
Function Display_NoOf_Employees(byval arr_employee as Dll_EmployeeType. Employee_Properties)
Msgbox ubound(arr_employee)
End Class
VB6 Exe: main program --> this refers vb6 dll Dll_EmployeeType and Dll_Employee_Methods
This program has form and button on it.
On Button_Click
Dim arr_employee() as Dll_EmployeeType. Employee_Properties
Redim arr_employee(1 to 2)
arr_employee(1). Employee_Id = 1
arr_employee(1). Employee_Name = ?name1?
arr_employee(1). Employee_Address = ?address1?
arr_employee(2). Employee_Id = 2
arr_employee(2). Employee_Name = ?name2?
arr_employee(2). Employee_Address = ?address2?
dim obj as new Dll_Employee_Methods. Cls_Employee
call obj. Display_NoOf_Employees(arr_employee)
error occurs at above line is ?Class does not support an automation or does not support expected interface?
Note: If .Net dll code is in normal class ? no intellicense is displayed in main program
If .Net dll code is in COM class ? intellicense is displayed in main program
But the error is same as above
Case 2:
Vb6 UDT dll is converted to .Net having structure
?Build tlb using COM checkbox as checked
?Add reference of it to Main exe program
?Run program
Throws an error ?Variable uses an automation type not supported in Visual basic? at first line(dim arr_employee() as?..)
I have separated huge VB6 project into separate dlls based in functionality. All business logic is in dll and UI is in exe program.
Out of all dlls, one dll only caontains UDT(User Defined Types) and it's used by Main exe program and all other dlls. Now I want to Convert all dlls and main program in VB.Net STEP BY STEP. I have decided to convert all dlls first and then main program.
If I convert other dll to .Net I ran into Case1 error
If I convert UDT dll to .Net using Structure, I got case 2 error
I am giving my dummy code for both the cases and problem/error description below.
Case 1:
UDT dll is in VB6 -->Name: Dll_EmployeeType
Type Employee_Properties
Employee_Id as integer
Employee_Name as String
Employee_Address as string
End Type
.Net Dll -->Name: Dll_Employee_Methods --> this refers vb6 dll Dll_EmployeeType
Class Cls_Employee
Function Display_NoOf_Employees(byval arr_employee as Dll_EmployeeType. Employee_Properties)
Msgbox ubound(arr_employee)
End Class
VB6 Exe: main program --> this refers vb6 dll Dll_EmployeeType and Dll_Employee_Methods
This program has form and button on it.
On Button_Click
Dim arr_employee() as Dll_EmployeeType. Employee_Properties
Redim arr_employee(1 to 2)
arr_employee(1). Employee_Id = 1
arr_employee(1). Employee_Name = ?name1?
arr_employee(1). Employee_Address = ?address1?
arr_employee(2). Employee_Id = 2
arr_employee(2). Employee_Name = ?name2?
arr_employee(2). Employee_Address = ?address2?
dim obj as new Dll_Employee_Methods. Cls_Employee
call obj. Display_NoOf_Employees(arr_employee)
error occurs at above line is ?Class does not support an automation or does not support expected interface?
Note: If .Net dll code is in normal class ? no intellicense is displayed in main program
If .Net dll code is in COM class ? intellicense is displayed in main program
But the error is same as above
Case 2:
Vb6 UDT dll is converted to .Net having structure
?Build tlb using COM checkbox as checked
?Add reference of it to Main exe program
?Run program
Throws an error ?Variable uses an automation type not supported in Visual basic? at first line(dim arr_employee() as?..)
Last edited: