I resolved my access violation problem by including at the begin of wndProc
inside Window class, the following code:
//
private dword wndProc(ptr o_hwnd, dword o_msg, ...
{
asm{
push 0x;
push [o_hwnd];
call [user
Zarathustra wrote:
Don Wrote:
It isn't. Tfunc2 is a function pointer, which is typically the same as
size_t. So any int can be stored inside it. It's generally a very bad
idea to do so, of course.
Never mind what is stored inside func2. 0x00 is only to simplify the code.
Tfunc1 - pointer to f
Phil Deets Wrote:
> I don't know what the problem is, but I would try checking to see if the
> pointer at window construction and the this pointer before calling
> onMouseDown are the same. Maybe there is a problem with using the result
> of getWindowLong as a pointer. For example, one value
On Mon, 19 Oct 2009 02:39:57 -0500, Zarathustra
wrote:
Function is never called but why?
look at: window.Window.wndProc : case WM.LBUTTONDOWN
//__
module window;
private import base;
private import structs;
private static import user32;
private st
Don Wrote:
> It isn't. Tfunc2 is a function pointer, which is typically the same as
> size_t. So any int can be stored inside it. It's generally a very bad
> idea to do so, of course.
Never mind what is stored inside func2. 0x00 is only to simplify the code.
Tfunc1 - pointer to function without
Kagamin wrote:
Zarathustra Wrote:
Oh, I just find out cause of this behaviour in other module I had:
extern (Windows) alias dword function() Tfunc1;
extern (Windows) alias dword function(wstr) Tfunc2;
const Tfunc2 func2;
static this(){
func2 = cast(Tfunc1)0x0; // for DMD2 It is not error!!!
Zarathustra Wrote:
> Oh, I just find out cause of this behaviour in other module I had:
> extern (Windows) alias dword function() Tfunc1;
> extern (Windows) alias dword function(wstr) Tfunc2;
> const Tfunc2 func2;
> static this(){
> func2 = cast(Tfunc1)0x0; // for DMD2 It is not error!!!
>
Oh, I just find out cause of this behaviour in other module I had:
extern (Windows) alias dword function() Tfunc1;
extern (Windows) alias dword function(wstr) Tfunc2;
const Tfunc2 func2;
static this(){
func2 = cast(Tfunc1)0x0; // for DMD2 It is not error!!!
// but it do
In addition I tested the code in DMD1.050 and DMD2.035. In DMD 1 It works
correctly, but in DMD2 line: 'this.onMouseDown(l_mea);' works like 'break' (no
exceptions, neither compilation nor linking warnings, just like break). Is it
DMD2 bug?
Daniel Keep Wrote:
> It shouldn't even COMPILE.
>
> You can't use member functions as Windows callbacks. You haven't even
> used the correct calling convention on it.
>
> Callbacks for Win API functions have to be, I believe, extern(Windows),
> and they have to be free functions or static membe
Zarathustra wrote:
> Function is never called but why?
It shouldn't even COMPILE.
You can't use member functions as Windows callbacks. You haven't even
used the correct calling convention on it.
Callbacks for Win API functions have to be, I believe, extern(Windows),
and they have to be free f
Function is never called but why?
look at: window.Window.wndProc : case WM.LBUTTONDOWN
//__
module window;
private import base;
private import structs;
private static import user32;
private static import kernel32;
private static import gdi32;
private:
12 matches
Mail list logo