Question VB6 Global string array declaration in ActiveX control and Package installation error

vishalkbhatt

Member
Joined
Oct 7, 2010
Messages
12
Programming Experience
Beginner
Hi friends, I have been working on an activeX control which works on serial port communication. Now I have completed the project and created its setup.exe using Visual studio 6 -> Tools -> Package and Deployment Wizard. Then I installed the control in another PC and in a new project included the control using project -> components. But when I click on the control in the toolbox and then include on the form it gives the following error : delete current link ? and on clicking OK, nothing happens. I tried searching a lot on google but didnt find anything. Another problem is that I have created a string array as a global array which can be accessed by all the methods.I am able to include the same activex control in my own pc when I have created the project. Here it works fine, I am able to access all the methods that I coded in the control, but the String array mentioned above can be accessed in other project. I tried writing Public before the array declaration but it give me the compile error : "Constants. fixed length strings, arrays, user defined types and Declare statements not allowed as Public members of object module."
I am posting the code below so you all can understand what m I trying to say. Plz help me guys if u have a solution to these two problems. thanks.

Option Explicit
Dim ReplyMessageArray() As String 'this the array i m not able to access in another project

Public Sub FillStringArray(ReplyString As String) ' the array is filled in this method
Dim i As Integer

If flg = False Then
ReDim ReplyMessageArray(0 To 0) As String
flg = True
Else
ReDim Preserve ReplyMessageArray(0 To UBound(ReplyMessageArray) + 1) As String
End If
ReplyMessageArray(UBound(ReplyMessageArray)) = ReplyString

End Sub
 
I sounds as you should be addressing a VB6 forum, this place is for VB.Net development.
 
Back
Top