Code:
#define event(EventName, ... ) std::function<void(__VA_ARGS__ )> EventName
if i do:
Code:
event(Create) =NULL;
on form procedure:
Code:
static LRESULT CALLBACK WndProcForm(HWND HandleWindow, UINT msg, WPARAM wParam, LPARAM lParam)
{
static bool blnInstCreated=false;
static POINT PreviousLocation, Location;
static bool Tracking = false;
static MouseButtons MBButtons=MouseButtons::None;
static bool blControl = false;
static bool blShift = false;
static bool blResize = false;
static int xPos = 0;
static int yPos = 0;
const UINT_PTR timerid=0;
const UINT_PTR KeyBoardTimer=2;
const UINT_PTR JoystickTimer=1;
static HMENU menuhandle=NULL;
static bool blnDrag = false;
static bool KeyPressed=false;
static bool JoystickIsConneted=false;
static bool blnMouseDown=false;//testing the mouse down
form *inst = (form *)GetWindowLongPtr(HandleWindow, GWLP_USERDATA);
if(inst!=NULL && inst->Create )
{
static bool i=true;
if(i==true)
{
blnInstCreated=true;
i=false;
inst -> Create();
}
}
the Create is called.
but if i do:
Code:
event(Create) =[](){;};
the Create isn't called... why?
(i use a macro for be more easy)