Quote:
Originally Posted by thaidu0ngpr0
I want to show some text on the form. but I wrote this code it does not show anything. you can see if it helps me where it is wrong
thank you
|
Kinda depends on what your resinfo looks like. Right now your code expects the CIFStatic to be in CGInterface (ginterface.txt). I guess that isn't the case. It's inside your own gui.
You need to query the control from your interface class. You have to make a function that returns a pointer to the element.
Code:
CIFflorian0 *pMyWnd = g_pCGInterface->m_IRM.GetResObj<CIFflorian0>(GDR_FLORIAN0, 1);
CIFStatic *pSlot1 = pMyWnd->GetSlot1();
The function can look like this:
Code:
CIFStatic *CIFflorian0::GetSlot1() const {
return m_IRM.GetResObj<CIFStatic>(ELECTUSDPS_PLAYER_SLOT1, 1);
// -- OR --
return m_slot1; // where m_slot1 is set in OnCreate() accordingly.
}
I would recommend making a function for getting the pointer to your window aswell. It makes the code a lot more readable.
Code:
// So this
CIFflorian0 *pMyWnd = g_pCGInterface->m_IRM.GetResObj<CIFflorian0>(GDR_FLORIAN0, 1);
// becomes this
CIFflorian0 *pMyWnd = g_pCGInterface->GetMyWindow();
You can also make everything public. But that often leads to messy code. Keep it readable, don't be lazy.