Re: [fpc-pascal] Problem compiling DLL for 64Bit Windows - complete example attached

2009-12-18 Thread Lukas Gradl
rMonitor=packed record ... end; rMonitorEx=packed record dwMonitorSize:DWORD; Monitor:rMonitor; end; Are you sure the C record is packed too ? This would mean that all function pointers in rMonitor are not aligned. I'm not shure about that as I'm not that good at C. The

Re: [fpc-pascal] Problem compiling DLL for 64Bit Windows - complete example attached

2009-12-18 Thread Jonas Maebe
On 18 Dec 2009, at 13:39, Lukas Gradl wrote: rMonitor=packed record ... end; rMonitorEx=packed record dwMonitorSize:DWORD; Monitor:rMonitor; end; Are you sure the C record is packed too ? This would mean that all function pointers in rMonitor are not aligned. I'm not shure

Re: [fpc-pascal] Problem compiling DLL for 64Bit Windows - complete example attached

2009-12-18 Thread Lukas Gradl
Jonas Maebe schrieb: You must never use a packed record for a C record, unless it is declared in C using __attribute__((__packed__)). The fact that it worked in 32 bit was pure coincidence. You also have to add {$packrecords c} to your source file to tell the compiler to lay out records the

Re: [fpc-pascal] Problem compiling DLL for 64Bit Windows - complete example attached

2009-12-18 Thread Reimar Grabowski
On Fri, 18 Dec 2009 13:39:45 +0100 Lukas Gradl f...@ssn.at wrote: I'm not shure about that as I'm not that good at C. The packed record works at 32bit -so I thought that should be correct. If it works on 32bit it should be correct. Is there a difference between 64Bit and 32Bit? Yes. Some

Re: [fpc-pascal] Problem compiling DLL for 64Bit Windows - complete example attached

2009-12-18 Thread Reimar Grabowski
On Fri, 18 Dec 2009 14:58:10 +0100 Reimar Grabowski reimg...@web.de wrote: On Fri, 18 Dec 2009 13:39:45 +0100 Lukas Gradl f...@ssn.at wrote: I'm not shure about that as I'm not that good at C. The packed record works at 32bit -so I thought that should be correct. If it works on 32bit it

[fpc-pascal] Problem compiling DLL for 64Bit Windows - complete example attached

2009-12-17 Thread Lukas Gradl
Hi! I'm having serious troubles compiling a DLL for 64bit Windows. I'm using FPC svn 1 (Ver 2.5.1) on all machines. I tried on WinXP 32bit (works), Vista 64bit (doesn't work), Win7 32Bit (works) and Win7 64bit (doesn't work). The DLL works as a print-monitor, providing a virtual printer

Re: [fpc-pascal] Problem compiling DLL for 64Bit Windows - complete example attached

2009-12-17 Thread Marc Weustink
Lukas Gradl wrote: Hi! I'm having serious troubles compiling a DLL for 64bit Windows. I'm using FPC svn 1 (Ver 2.5.1) on all machines. I tried on WinXP 32bit (works), Vista 64bit (doesn't work), Win7 32Bit (works) and Win7 64bit (doesn't work). rMonitor=packed record ... end;