Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Compile error: Types of intolerance (need help)

Status
Not open for further replies.

R_a_i_n_e_r_8

Technical User
Feb 19, 2024
2
0
0
DE
Hello everyone,
after switching from 32 to 64-bit access version, i get the error message:

Compile error: Types of intolerance

Unfortunately i can't switch back, can someone help me please?
How the new string should look like?

Old string:

[highlight #FCE94F]Function LoadPictureGDIP(sFileName As String) As StdPicture[/highlight]
Dim hBmp As Long
Dim hPic As Long

If lGDIP = 0 Then InitGDIP: If lGDIP = 0 Then Exit Function
If GdipCreateBitmapFromFile(StrPtr(sFileName), hPic) = 0 Then
GdipCreateHBITMAPFromBitmap hPic, hBmp, 0&
If hBmp <> 0 Then
Set LoadPictureGDIP = BitmapToPicture(hBmp)
GdipDisposeImage hPic
End If
End If

End Function



Kind regards,
Rainer
 
>2 to 64-bit access version

If it is Access, then you really want the VBA forum: forum707

That being said, why do you need a custom function to load a picture? If iot is to load a picture in a format not supported by the LoadPicture function, then there are other ways to do this than trying to move to the lowlevel Gdi+ API. For example, my code in thread222-1651299
 
Hi strongm,

sorry for the post in the wrong forum.

The problem is, that my chief wrote the program and he is died for 2 years. That is why i don't can say why he did it that way.
The programm still works since his dead and after the change from Access 2016 (32-bit) to Acces M365 (64-bit) this function does not work any more.
I have no IT know how, and learn everything by doing, but this problem i can't fix.
Thats why i need help.
 
If your old boss was using the API then the switch to 64bit is going to cause you a world of pain, as many of the API declarations will have to be rewritten, and many parameter and variable declarations may also have to be changed, I'm afraid.

Microsoft's headline comment on the subject:

Microsoft MSDN said:
For code to run in 64-bit versions of Microsoft Office, all Declare statements must include the PtrSafe keyword, and all data types in the Declare statement (parameters and return values) that need to store 64-bit quantities must be updated to use LongLong for 64-bit integrals or LongPtr for pointers and handles.

Here's a page that includes some of the gdi+ API redeclared fort 64bit (Dan_W's post, about halfway down), which may help:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top