different minds about different platforms

a blog of Dirk Eisenberg (>)

  Home  |   Contact  |   Syndication    |   Login
  47 Posts | 4 Stories | 7 Comments | 17 Trackbacks

News

Ich hoffe das jeder Besucher in diesem Blog das ein oder andere interessante Thema findet. Als Autor der Beiträge freue ich mich besonders über Feedback in Form von Kommentaren oder auch persönlicher als E-Mail. Dankbar nehme ich Anregungen und Korrekturen von fehlerhaften Inhalten entgegen.

Article Categories

Archives

Post Categories

Image Galleries

Blogs

Links

Wenn sich nach dem letzten Artikel vielleicht jemand fragt warum funktioniert das, sollte einen kurzen Blick auf die verschiedenen Bestandteile von Platform Invoke werfen. Daraus wird deutlich warum in einem Assembly DllImport-Verweise auf nicht existierende Dll vorhanden sein können und wann das .NET-Framework wie auf die native DLL zugreift.

Check this out: http://msdn2.microsoft.com/en-us/library/h50dxzwx.aspx

There are three parts to a .NET Compact Framework platform invoke:

  1. At design-time, the developer provides a description of the unmanaged function to call. This includes the module name (DLL file), entry point name, and calling convention.

  2. At just-in-time (JIT) compile time, the common language runtime extracts this information from the metadata, locates the DLL containing the function, loads the DLL into memory and retrieves the address of the function. If the module or function is not found, the common language runtime throw a MissingMethodException.

  3. At run time, the common language runtime marshals the parameters from managed format to unmanaged format before the unmanaged function is called. The common language runtime

  4. determines how to marshal each parameter based upon the managed declaration of the method.

Weiterhin sie auf das HowTo - Get the Device Platform verwiesen. Dadurch lässt sich der Platform Runtime Check auf sichere Beine stellen.

posted on Sunday, March 05, 2006 8:21 PM