Dllimport works only in Visual Studio
- From: bram@xxxxxxxx
- Date: Thu, 27 Sep 2007 06:38:27 -0700
Hi all,
I have a (for me) strange problem which drives me crazy. I've created
a c# desktop app in visual studio 2005, which uses through dllimports,
methods of an old dll. Afther some tweaking this works fine.
Now my project is finished and i run the 'exe' the dll imports behave
strange, for example i use a unmanaged method that sets a string in my
dll object. This works fine in visual studio but not in the
debugger...
Problem is on unmanaged calls. For example i'm using:
[DllImport("sphapihd.dll", CharSet = CharSet.Ansi)]
static extern void SphSetDataDescr_ArrayINT8([In, Out,
MarshalAs(UnmanagedType.Struct)] ref swDataDescriptor dataDescriptor,
[In, Out, MarshalAs(UnmanagedType.SafeArray)] ref byte[] Values);
Which works under vs.net only not in normal executable. In v.s. this
call sets a certain string value(byte[]) in memory. lateron this
string is used for the rpc call, only the place is empty (not in
debugging mode).
Is there an certain option or something witch i have to set in the
compiler or such thing?
I'm hoping someone has an suggestion...
cheers
Bram Hoefnagel
.
- Follow-Ups:
- Re: Dllimport works only in Visual Studio
- From: Mattias Sjögren
- Re: Dllimport works only in Visual Studio
- Prev by Date: Re: Future of C#
- Next by Date: Re: Future of C#
- Previous by thread: Replacing an event
- Next by thread: Re: Dllimport works only in Visual Studio
- Index(es):
Relevant Pages
|