I have used the free helper applications by Peter Cole to identify the functions and make changes to the declarations to accommodate moving to 64bit (in fact trying to make it able to generate the 32bit and 64 bit versions), however I have come to a stop when trying to upgrade the code borrowed from The Smiley Coder to capture the screen image when an error arises.
The particular function I am currently attempting to fix is: GdiplusStartup, which has the following 64 bit declaration:
On compiling the code it reports 'user-defined type not defined.
The relevant declarations are:
and the function is called through the following:
etc.
Any suggestions assistance is welcome..
Thankyou
The particular function I am currently attempting to fix is: GdiplusStartup, which has the following 64 bit declaration:
Code:
Private Declare PtrSafe Function GdiplusStartup Lib "GDIPlus" _
(token As LongPtr, inputbuf As GdipStartupInput, Optional ByVal outputbuf As Long = 0) As Long
On compiling the code it reports 'user-defined type not defined.
The relevant declarations are:
Code:
'Declare a UDT for GDI+
Private Type GdiplusStartupInput
#If VBA7 Then
GdiplusVersion As Long
DebugEventCallback As LongPtr
SuppressBackgroundThread As Boolean
SuppressExternalCodecs As Boolean
GdipToken As LongPtr
#Else
GdiplusVersion As Long
DebugEventCallback As Long
SuppressBackgroundThread As Boolean
SuppressExternalCodecs As Boolean
GdipToken As Long
#End If
and the function is called through the following:
Code:
' ----==== SaveJPG ====----
Private Sub SaveJPG(ByVal pict As StdPicture, ByVal FileName As String, Optional ByVal quality As Byte = 80)
Dim tSI As GdiplusStartupInput
Dim lRes As Long
Dim lGDIP As GdipToken
Dim lBitmap As Long
' Initialize GDI+
tSI.GdiplusVersion = 1
lRes = GdiplusStartup(lGDIP, tSI)
If lRes = 0 Then
' Create the GDI+ bitmap
' from the image handle
lRes = GdipCreateBitmapFromHBITMAP(pict.Handle, 0, lBitmap)
If lRes = 0 Then
Dim tJpgEncoder As GUID
Dim tParams As EncoderParameters
Any suggestions assistance is welcome..
Thankyou