the directly accepting a structure in the arguments?
iv got the gurus at PB Forums on the case, if theres a solution, they will find it, but im guessing there going to tell me i need a pointer to the struct!
ProcedureCDLL.l _DrawDesign(ClassID ,HDC, hMainWnd, [B][COLOR="red"]left,top,right,bottom[/COLOR][/B], bVisible, bEnabled)
like you are doing now
ProcedureCDLL.l _DrawDesign(ClassID ,HDC, hMainWnd, *rcObRect.RECT, bVisible, bEnabled)
ProcedureCDLL.l _DrawDesign(ClassID ,HDC, hMainWnd, *rcObRect, bVisible, bEnabled) Protected *rc.RECT=*rcObRect Protected X = *rc\left Protected Y = *rc\top Protected Width = *rc\right-*rc\left Protected Height = *rc\bottom-*rc\top
, just a few teething problems to overcome
for (i=0 ; i < lengthof(array) ; i++)
{
if(array[i].ClassID == ClassID)
{
// do something with array[i].Text
}
}

struct OBJECT_INSTANCE
{
OBJECT_INSTANCE()
{
hObjectWnd = NULL;
ClassID = -1;
strText = NULL;
}
~OBJECT_INSTANCE()
{
delete[] strText;
}
HWND hObjectWnd;
long ClassID;
LPCTSTR strText;
};
struct OBJECT_INSTANCE
{
HWND hObjectWnd;
LPCTSTR strText;
long ClassID;
long ProgressMin;
long ProgressMax;
long ProgressCurrentPos;
};
OBJECT_INSTANCE * CreateNewInstance(long ClassID)
{
OBJECT_INSTANCE *pObject = new OBJECT_INSTANCE;
pObject->strText = NULL;
pObject->ClassID = ClassID;
pObject->ProgressMin = 0;
pObject->ProgressMax = 100;
pObject->ProgressCurrentPos = 0;
m_objectlist.push_back(pObject);
return pObject;
}
void DeleteInstance(long ClassID)
{
for(size_t i=0; i<m_objectlist.size(); ++i)
{
OBJECT_INSTANCE *pObject = m_objectlist.at(i);
if (pObject)
{
if(pObject->ClassID == ClassID)
{
if(::IsWindow(pObject->hObjectWnd))
{
::ShowWindow(pObject->hObjectWnd,SW_HIDE);
::DestroyWindow(pObject->hObjectWnd);
}
delete[] pObject->strText;
delete pObject;
m_objectlist.erase( m_objectlist.begin()+i );
return; // only for break
}
}
}
}
)tblPluginProperties ={}
function Getsomething(classid)
return tblPluginProperties[classid].Variable;
end
function Setsomething(classid,variable)
tblPluginProperties[classid].Variable = variable;
end
Leave a comment: