>Problem is on unmanaged calls. For example i'm using:
> [DllImport("sphapihd.dll", CharSet = CharSet.Ansi)]
[quoted text clipped - 9 lines]
>Is there an certain option or something witch i have to set in the
>compiler or such thing?

Signature
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
On 27 sep, 22:33, Mattias Sj?gren <mattias.dont.want.s...@mvps.org>
wrote:
> >Problem is on unmanaged calls. For example i'm using:
> > [DllImport("sphapihd.dll", CharSet = CharSet.Ansi)]
[quoted text clipped - 18 lines]
> Mattias Sj?gren [C# MVP] mattias @ mvps.orghttp://www.msjogren.net/dotnet/|http://www.dotnetinterop.com
> Please reply only to the newsgroup.
Hi Mattias,
Thanx for your reply.
I'm not sure where I can find this native code signature, I don't have
the source of my dll. I only got the dll itself. If you mean setting
the callingconvention, I've tried all that are available. Funny thing
still is that it works in VS and not in runtime. I'm calling the
function as:
swDataDescriptor wrParam = new swDataDescriptor();
SPHRET ret = new SPHRET();
wrParam.Bytes = Encoding.Default.GetBytes(string.Format("{0}\0",
myString));
SphSetDataDescr_ArrayINT8(ref wrParam, ref wrParam.Bytes);
The string on myString is both in runtime and debugging set to an
array of around 140bytes, and through the SphSetDataDes.. passed
through the dll to my com object. The last part does not work in
runtime, because when i'm getting the string i've set I get some thing
like 4bytes instead of 140.
Cheers,
Willy Denoyette [MVP] - 28 Sep 2007 08:45 GMT
On 27 sep, 22:33, Mattias Sjögren <mattias.dont.want.s...@mvps.org>
wrote:
> >Problem is on unmanaged calls. For example i'm using:
> > [DllImport("sphapihd.dll", CharSet = CharSet.Ansi)]
[quoted text clipped - 19 lines]
> mvps.orghttp://www.msjogren.net/dotnet/|http://www.dotnetinterop.com
> Please reply only to the newsgroup.
Hi Mattias,
Thanx for your reply.
I'm not sure where I can find this native code signature, I don't have
the source of my dll. I only got the dll itself. If you mean setting
the callingconvention, I've tried all that are available. Funny thing
still is that it works in VS and not in runtime. I'm calling the
function as:
swDataDescriptor wrParam = new swDataDescriptor();
SPHRET ret = new SPHRET();
wrParam.Bytes = Encoding.Default.GetBytes(string.Format("{0}\0",
myString));
SphSetDataDescr_ArrayINT8(ref wrParam, ref wrParam.Bytes);
The string on myString is both in runtime and debugging set to an
array of around 140bytes, and through the SphSetDataDes.. passed
through the dll to my com object. The last part does not work in
runtime, because when i'm getting the string i've set I get some thing
like 4bytes instead of 140.
Cheers,
IMO none of the function arguments should NOT be passed byref, that is they
are "In" arguments not "In Out".
Willy.