Hi,
I have a problem using an COM-Object from Access
(tested with Office 2000 and XP).
The VB Code calls a function in an C# dll via COM Wrapper.
This function opens a Dialog and returns 3 values.
The same Code works fine when called from a EXCEL Sheet-VB.
In Access VB a Error "wrong ParameterTypes" occures. What is wrong there ?
Where is the difference beetween Excel and Access VB?
#### Function in C#
int DoDialog(int posx, int posy, string id, ref string out1, ref string out2)
#### VB - Code
Private Sub CommandButton1_Click()
Dim theInt As Object
Dim input3 As String
Dim input2 As Integer
Dim input1 As Integer
Dim res3 As String
Dim res2 As String
Dim res As Integer
Set theInt = CreateObject("TheInterface.TheInterface")
input1 = 0
input2 = 0
input3 = "abcd"
res = theInt.DoDialog(input1, input2, input3, res2, res3)
Set theInt = Nothing
End Sub
Thank you
Gregor
Douglas J. Steele - 23 Dec 2003 11:26 GMT
Change the declaration of Input1 and Input2 from Integer to Long in your VBA
code.
In the .Net world, Int are 32 bit integer values, the same as Long in VBA
(and VB "Classic").

Signature
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(No private e-mails, please)
> Hi,
>
[quoted text clipped - 36 lines]
>
> Gregor
Gregor - 29 Dec 2003 12:05 GMT
> Hi,
>
> I have a problem using an COM-Object from Access
> (tested with Office 2000 and XP).
Hi,
during further debugging i have found the error. The opened Dialog
uses the
TransparencyKey Property. When i set this property to null my COM Obj.
works fine from Access.
Gregor