Gfx and Win-API

Windows specific questions.
fsw
Posts: 260
Joined: May 27, 2005 6:02

Post by fsw »

In the code posted above I found a way to change this:

Code: Select all

Frame.Show (Frame, TRUE)
to that:

Code: Select all

Frame.Show (TRUE)
and it works great.

In the Show function I do:

Code: Select all

  DIM that as wxFrame ptr

  'EBX seems to be the end of allocated memory for the structure where this function belongs to 
  ASM mov [that], EBX              ' get value of ebx into the variable
  that =  that - len (wxFrame) - 4 ' - 4 bytes to get to the begin of the wxFrame structure
    ShowWindow ( byval that->wxOBJ , SW_SHOW)
to get the address of the caller structure.
And as I said, it works great.

Now I want get rid of '*' of this piece:

Code: Select all

   Frame  = *wxFrame (0, -1,"Welcome to WX-C...", wxPoint( 0, 0), wxSize( 400, 170), wxDEFAULT_FRAME_STYLE)
and do:

Code: Select all

   Frame  = wxFrame (0, -1,"Welcome to WX-C...", wxPoint( 0, 0), wxSize( 400, 170), wxDEFAULT_FRAME_STYLE)
but for this I declared Frame this way:

Code: Select all

DIM SHARED Frame AS wxFrame ptr
and have to call the show function this way:

Code: Select all

Frame->Show (TRUE)
but it doesn't work.

It seems that somehow the part with EBX doesn't work.
Why?

Where do I think wrong...
v1ctor
Site Admin
Posts: 3804
Joined: May 27, 2005 8:08
Location: SP / Bra[s]il
Contact:

Post by v1ctor »

You can't assume what register will be used, FB register allocator will use any free register, that go in and out the free list in no specific order, making it unpredictable.
fsw
Posts: 260
Joined: May 27, 2005 6:02

Post by fsw »

:(
Post Reply