I work on an app that has an activeX server and several clients. I have a
problem that only occurrs on Windows ME. It works fine on XP, 2000 and 98.
It occurs on a function call where the client client is sending an array of
user defined types to the server.
I've created small client and server apps that demonstrate the problem.
Server code (file: clsBlockHandler.cls) Compiled to and ActiveX exe
Option Explicit
Public Type BlockType
intVal As Integer
vals%(0 To 9)
End Type
Public Sub HandleTypeBlock(blk() As BlockType)
Dim i%, j%
Dim tstr$
Form1.Text1.Text = ""
For j = LBound(blk) To UBound(blk)
tstr = "Block " & j & ": IntVal = " & blk(j).intVal & " Vals: "
For i = 0 To 9
tstr = tstr & blk(j).vals(i) & " "
Next i
tstr = tstr & vbCrLf
Form1.Text1.Text = Form1.Text1.Text & tstr
Next j
End Sub
(The server also contains a form form1 with a text box Text1 to display the
results)
Client Code: (Form1.frm) (project contains a reference to the above server)
Private Sub Command1_Click()
Dim svr As clsBlockHandler
Dim blk() As BlockType
Dim i%, j%
ReDim blk(0 To Int((20 * Rnd) + 1))
For i = 0 To UBound(blk)
blk(i).intVal = Int((100 * Rnd) + 1)
For j = 0 To 9
blk(i).vals(j) = Int((1000 * Rnd) + 1)
Next j
Next i
Set svr = New clsBlockHandler
Call svr.HandleTypeBlock(blk)
Set svr = Nothing
End Sub
the client fails on the line:
Call svr.HandleTypeBlock(blk)
with "Run-time error '429': ActiveX component can't create object" only
when installed on a machine running WindowsME.
Is there a bug in ME that causes this?
Archived from group: microsoft>public>vb>ole