Einzelnen Beitrag anzeigen

Reinhard Kern

Registriert seit: 22. Okt 2006
772 Beiträge
 
#17

Re: C++ DLL in Delphi einbinden

  Alt 12. Feb 2007, 15:10
Noch eine Ergänzung zu Bool (Zitat MSDN):

Microsoft Specific
In Visual C++4.2, the Standard C++ header files contained a typedef that equated bool with int. In Visual C++ 5.0 and later, bool is implemented as a built-in type with a size of 1 byte. That means that for Visual C++ 4.2, a call of sizeof(bool) yields 4, while in Visual C++ 5.0 and later, the same call yields 1. This can cause memory corruption problems if you have defined structure members of type bool in Visual C++ 4.2 and are mixing object files (OBJ) and/or DLLs built with the 4.2 and 5.0 or later compilers.

END Microsoft Specific

Wie man sieht, ist sich nicht einmal MS einig mit MS. Man muss also wohl oder übel wissen, wo die Library herkommt und womit sie erstellt wurde. Und dabei ist das noch der einfachste aller Datentypen. Meistens wird dann die genaue Typdefiniton noch durch 5fach verschachtelte Präprozessoranweisungen versteckt.

Delphi hat doch auch Vorteile.

Gruss Reinhard
  Mit Zitat antworten Zitat