Hi,
I'm trying to fix Scintilla, with the aim of creating a new release of this
module. The problem is that Scintilla defines and uses it's own
PERLWIN32GUI_USERDATA structure. As this structure has changed over time in
Win32-GUI it creates all kinds of problems with this module (Scintilla
subclasses Win32-GUI, and uses the PERLWIN32GUI_USERDATA structure passed to
it by Win32-GUI). The most extreme behaviour is with perl 5.8.x where the
Scintilla does not process events - there is also cases where Scintilla
crashes.
I've managed to get a build of Scintilla working, but I've got several
issues. Instead of defining it's own version of PERLWIN32GUI_USERDATA it now
picks it up from GUI.h - which I think is the best solution (?).
1) The original Scintilla:
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
#include <windows.h>
#include "./include/Scintilla.h"
changed to:
#include "../Win32-GUI/GUI.h"
#include "./include/Scintilla.h"
However, when compiling with VC I get two errors:
*** Using Preserved Perl context.
../Win32-GUI/GUI.h(439) : error C2143: syntax error : missing ')' before '='
../Win32-GUI/GUI.h(439) : error C2072: 'DoHook' : initialization of a
function
../Win32-GUI/GUI.h(439) : error C2059: syntax error : ')'
../Win32-GUI/GUI.h(809) : error C2059: syntax error : 'string'
NMAKE : fatal error U1077: 'C:\WINDOWS\system32\cmd.exe' : return code '0x2'
Stop.
this is with the line:
void DoHook(NOTXSPROC LPPERLWIN32GUI_USERDATA perlud, UINT uMsg, WPARAM
wParam, LPARAM lParam, int* PerlResult, int notify = 0);
removing " = 0" fixes that issue.
The second error:
*** Using Preserved Perl context.
../Win32-GUI/GUI.h(809) : error C2059: syntax error : 'string'
NMAKE : fatal error U1077: 'C:\WINDOWS\system32\cmd.exe' : return code '0x2'
Stop.
this is with:
extern "C" BOOL WINAPI
GetWindowInfo(
HWND hwnd,
PWINDOWINFO pwi
);
Commenting out this code removes the error.
In both cases I don't understand why they cause errors?
2) I'm confused about the Perl context and how it's used within Win32-GUI -
and how Scintilla should handle things.
I've got it working by doing:
dTHX; /* fetch context */
in the Scintilla event handlers, but had to remove NOTXSCALL/NOTXSPROC in
some functions where the context isn't used/needed.
If it would help, I can check in what I've got, with the idea of fixing
things once I've got my head around these issues?
Cheers,
jez.