StrPtr type mismatch in 64-bit-Modus

Ich folgenden code (habe es von der Website) in Access 2013. Es funktionierte ohne Problem.

Private Declare Function GdipCreateBitmapFromFile Lib "gdiplus.dll" (ByVal FileName As Long, bitmap As Long) As Long

If GdipCreateBitmapFromFile(StrPtr(sFileName), hPic) = 0 Then ....

Nachdem ich entfernen Sie 32-bit-Komponente für Access 2013 64-bit-Laufzeit, der installation, bekomme ich compiler Fehler. Ich füge PtrSafe nach Erklären und compiler OK.

Private Declare PtrSafe Function GdipCreateBitmapFromFile Lib "gdiplus.dll" (ByVal FileName As Long, bitmap As Long) As Long

If GdipCreateBitmapFromFile(StrPtr(sFileName), hPic) = 0 Then ....

Aber, wird es zu einem Laufzeitfehler - Typen unverträglich in der StrPtr. Weiß nicht, wie es zu lösen.

InformationsquelleAutor YellowLarry | 2015-11-23
Schreibe einen Kommentar