Re: DllImport - Problem

From: Thomas Scheidegger [MVP] (spam.netmaster_at_swissonline.ch)
Date: 06/20/04


Date: Sun, 20 Jun 2004 20:10:55 +0200

Hallo Andreas

> Der Datentyp "unsigned short" aus C++ entspricht in C# dem "ushort"
> (bzw. System.UInt16) und besteht aus 16 Bits. Du verwendest stattdessen
> den Typ "int", welcher 32-bittig ist.

dies stimmt zwar, aber auf einer 32-Bit Windows-Maschine
werden sowieso alle Argumente auf 32-Bit erweitert:
   http://msdn.microsoft.com/library/en-us/vclang/html/_core_Argument_Passing_and_Naming_Conventions.asp

Und nicht zuletzt ist auf einem 32-Bit Pentium ein
16-Bit oft langsamer in der Verarbeitung als native 32-Bit....

> Vielleicht führt das zur Exception?

nicht absolut ausgeschlossen (=> Bug in DLL),
aber eher unwahrscheinlich...

-- 
 Thomas Scheidegger - MVP .NET - 'NETMaster'
 http://www.cetus-links.org/oo_dotnet.html - http://dnetmaster.net/


Relevant Pages

  • Re: Linux vs MS Security
    ... This code will lock up any P5 machine, even usermode Linux! ... ] problem doesn't show itself for the Pentium Pro or Pentium 2. ... Nov 1997 16:38:48 -0700 announcing the BSDi fix. ... Pentium bug workaround, please test! ...
    (comp.os.linux)
  • Re: Memory increasing even when in debug-break
    ... another test machine that is running the app under .Net 1.1 is still ... I'm left wondering whether this bug is even related. ... leak occurs in a process that uses Corperfmonext.dll in the .NET Framework ... to do this whole DLL injection thing for apps that query performance data... ...
    (microsoft.public.vsnet.debugging)
  • Problem with locales in unloaded DLLs
    ... We are making a plugin (DLL) for some application. ... locale crash") didn't come up with something. ... this bug. ... I'm Schobi at suespammers dot org ...
    (microsoft.public.dotnet.languages.vc)
  • Problem with locales in unloaded DLLs
    ... We are making a plugin (DLL) for some application. ... locale crash") didn't come up with something. ... this bug. ... I'm Schobi at suespammers dot org ...
    (microsoft.public.vc.stl)
  • Re: c code reusability
    ... Program X uses DLL Y. DLL Y is "improved", and a bug is introduced. ... At least one OS I use has deprecated static linking for all ... It's way easier to fix a library bug with a patch ...
    (comp.lang.c)