Use correct DDE callback signature in Win64 build

Don't use the deprecated since Win16 (!) and doing nothing
MakeProcInstance() and fix the signature of DDECallback() which was
actually wrong in Win64 build but the problem was hidden due to the
casts done inside and outside MakeProcInstance() before.

Remove this macro and fix the signature to actually conform to the real
callback one.

This also fixes another gcc8 -Wcast-function-type warning.
This commit is contained in:
Vadim Zeitlin
2018-05-27 23:25:15 +02:00
parent 0cda7c2f13
commit 004af0b963

View File

@@ -66,14 +66,14 @@ static void DDEDeleteConnection(HCONV hConv);
static wxDDEServer *DDEFindServer(const wxString& s);
extern "C" HDDEDATA EXPENTRY
_DDECallback(WORD wType,
WORD wFmt,
_DDECallback(UINT wType,
UINT wFmt,
HCONV hConv,
HSZ hsz1,
HSZ hsz2,
HDDEDATA hData,
DWORD lData1,
DWORD lData2);
ULONG_PTR lData1,
ULONG_PTR lData2);
// Add topic name to atom table before using in conversations
static HSZ DDEAddAtom(const wxString& string);
@@ -149,9 +149,7 @@ extern void wxDDEInitialize()
if ( !DDEInitialized )
{
// Should insert filter flags
PFNCALLBACK callback = (PFNCALLBACK)
MakeProcInstance((FARPROC)_DDECallback, wxGetInstance());
UINT rc = DdeInitialize(&DDEIdInst, callback, APPCLASS_STANDARD, 0L);
UINT rc = DdeInitialize(&DDEIdInst, _DDECallback, APPCLASS_STANDARD, 0L);
if ( rc != DMLERR_NO_ERROR )
{
DDELogError(wxT("Failed to initialize DDE"), rc);
@@ -773,14 +771,14 @@ bool wxDDEConnection::DoAdvise(const wxString& item,
#define DDERETURN HDDEDATA
HDDEDATA EXPENTRY
_DDECallback(WORD wType,
WORD wFmt,
_DDECallback(UINT wType,
UINT wFmt,
HCONV hConv,
HSZ hsz1,
HSZ hsz2,
HDDEDATA hData,
DWORD WXUNUSED(lData1),
DWORD WXUNUSED(lData2))
ULONG_PTR WXUNUSED(lData1),
ULONG_PTR WXUNUSED(lData2))
{
switch (wType)
{