I have an application which has been working fine under various PowerBuilder releases, 2017, 2019 & 2021. The application is compiled 64bit.
However, it will not run properly when compiled in PB 2022 R2 Build 2819.
The crash is when a function calls Windows API ReportEvent().
The crash is:
PowerBuilder application execution error (R0015)
Application terminated.
Error: Error calling external function %s at line 74 in function of_log2windows of object of_log2windows.
Function of_log2windows line 74 is:
if not ReportEvent(lul_eventsource, li_messagelevel, lul_category, aul_identifier, 0, UpperBound(ls_errmsg), 0, ls_errmsg, 0) then...
The ReportEvent prototype is:
FUNCTION boolean ReportEvent (ulong hEventLog, uint wType, uint wCategory, ulong dwEventID, ulong lpUserSid, uint wNumStrings, ulong dwDataSize, string lpStrings[], ulong lpRawData) Library "advapi32.dll" Alias For "ReportEventW"
Is there something wrong with my prototype? I notice it has an alias "ReportEventW". Should this be "ReportEventA:ansi"? What is the difference? Why is this only a problem with PB 2022 R2 but fine in earlier versions?
TIA
Larry