Dynamic creating a Object
-
Hi! I'm trying to create a static box into a FormView derived class, i tryed like this: void CUnits_Sold::OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint) { //This lines had the propose of initialize the pointer, i could not find another way to do it! CStatic estatico; CStatic* estatico2; estatico2=&estatico; estatico2->Create("Olá", WS_CHILD|WS_VISIBLE|SS_NOPREFIX|SS_LEFTNOWORDWRAP, CRect(30, 30, 100, 100), this); estatico2->ShowWindow(SW_SHOW); } Anyone have a clue why this isn't working? Thank you
-
Hi! I'm trying to create a static box into a FormView derived class, i tryed like this: void CUnits_Sold::OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint) { //This lines had the propose of initialize the pointer, i could not find another way to do it! CStatic estatico; CStatic* estatico2; estatico2=&estatico; estatico2->Create("Olá", WS_CHILD|WS_VISIBLE|SS_NOPREFIX|SS_LEFTNOWORDWRAP, CRect(30, 30, 100, 100), this); estatico2->ShowWindow(SW_SHOW); } Anyone have a clue why this isn't working? Thank you
When the estatico variable goes out of scope, it destroys the window too. --Mike-- Just released - RightClick-Encrypt - Adds fast & easy file encryption to Explorer My really out-of-date homepage Sonork-100.19012 Acid_Helm