Re: [fpc-pascal] Custom NewInstance allocator

2024-06-05 Thread Olivier Sannier via fpc-pascal
Could it be because you do not zero out the allocated memory? Le 04/06/2024 à 10꞉54, Hairy Pixels via fpc-pascal a écrit : In the manual it athttps://www.freepascal.org/docs-html/ref/refse38.html it says "Calling the constructor will provoke a call to the virtual class method NewInstance, wh

Re: [fpc-pascal] Type-casting a class variable

2024-05-02 Thread Olivier Sannier via fpc-pascal
Hello, You should cast to TWindowClass as TWindow is used to cast an instance, not a class reference. Note that you may not have TWindowClass, in which case you need to declare it like this: type     TWindowClass = class of TWindow; Note that CreateNewWindow would have to be virtual for de