Sorry,
string[] GetUnitStrings(string unitGroup, bool useUnicode, ref int
nrOfStrings)
should be the right methode.
Now I resolved the problem. When I use
"Dim sizeOf as Long" in VBA everything works fine
But:
1. Is it the right way using
"[ClassInterface(ClassInterfaceType.AutoDual)]"? I read something that
someone should avoid using "ClassInterfaceType.AutoDual".
2. Do I have to define interfaces as I have done?
3. What do I have to do when I want to use the class library on another
computer (registration, gac, ...)?
Thanks
Josef
"Willy Denoyette [MVP]" wrote:
"Josef" <Jo***@discussions.microsoft.com> wrote in message
news:8E**********************************@microsof t.com... the c# code look like this:
public string GetLabel(ref int nrOfStrings)
VBA Code:
----------------------
Set Units As KUnits.Units
Dim str as String
Dim sizeOf as Integer
str = Units.GetLabel(sizeOf)
...
----------------------
VBA error message at "str = Units.GetLabel(sizeOf)":
"Argument type ByRef incompatible" (I hope this is the right translation
to
english)
Dim sizeOf as Long
int in .NET are 32bit entities, Integer in VBA are 16bit, Long is 32 bit.
Willy.