When I run the code in the IDE, I get an error message called "EXTERNAL:
SIGSEV" and an empty assembler window pops up, with adresses starting at
If I run the program "normally", it closes immediately and I get no
error message or anything else.
So I've tried to debug the code, but the debugger crashes after the
first run in the TstMainWindow.FWndProc(...) function.
Does anyone have an idea, how i can get this to work?
> Hi there,
> this is my first posting to the fpc-mailinglist, so please don't slap me if I
> do anything wrong. :)
> I'm currently re-writing a program I've written in Delphi some months ago.
> Due to the now missing free version, I've decided to switch over to
> Freepascal. But now, I'm somehow stuck.
> The application is Windows-only, and I'm using WindowsAPI-calls to create the
> main window. But I would like to program in an object-oriented way, so I
> decided to create a class, TstMainWindow.
> To get Messages from your Window, you need a Callback. Unfortunately, a
> pointer to a method is <> a pointer to a function.
> So i tried this workaround, I've posted it at the german lazarus forum:
You cannot use a method as a window message handler.
You must use a plain function for this. You can see in the lazarus
file win32callback.inc, function CallDefaultWindowProc or WindowProc
how to do this and how to transfer the code to your objects.
I'm surprised the code at Delphipraxis works at all. Probably because
the delphi compiler uses a different calling convention.