Re: C# - Problem to receive data from a C++ Dll
- From: "Robert" <robson_rj1@xxxxx>
- Date: Fri, 13 May 2005 08:10:36 +0200
Try this
private static extern void GetSN([MarshalAs(UnmanagedType.LPStr)] String s);
U¿ytkownik "Gandalf" <Gandalf@xxxxxxxxxxxxxxxxxxxxxxxxx> napisa³ w
wiadomo¶ci news:037A7653-13B5-40F2-BA79-8753FC81FF2D@xxxxxxxxxxxxxxxx
> Hi,
>
> I followed the document you showed me, but I have when I debug the
following
> message : System.MissingMethodException.
>
> I don't understand why, now I'm using the following code.
>
> Declaration of the dll in the C # program :
>
> ---------------------------------------------------------
> [DllImport("Intermec7xxInfo.dll",EntryPoint="GetSN")]
> private static extern void GetSN(StringBuilder s);
> .....
> // Call to the dll
> StringBuilder valueStr = new StringBuilder("");
> ...
> GetSN(valueStr);
> ...
> -----------------------------------------------------------
>
> And my dll function in C++ is the following.
> -------------------
> ...
> extern "C" void GetSN(LPTSTR str)
> ...
> -------------------
>
> Perhaps the problem is that I'm using a program destinated to Pocket PC ?
> However, I can download the dll on the device which is on Pocket PC 2003,
I
> have no error, so I suppose that there is no error with the dll...
>
> If you have any idea...
>
> Thanks in advance.
>
>
> "Tegdeep" wrote:
>
> > That's pretty strange. The problem could be with the way you try to
> > get the data. See if you find anything on this website :
> >
> > http://msdn.microsoft.com/msdnmag/issues/02/08/CQA/
> >
> > It discusses unmanaged DLL's in C# .
> > Let me know what the solution is, if you find it.
> >
> >
.
- Prev by Date: Re: Why can't overloads take into account the return type.
- Next by Date: Re: re help with array of functions more info
- Previous by thread: Confused about using Reflection to examine a collection
- Next by thread: Re: How to pass arguments to a property in C#?
- Index(es):
Relevant Pages
|