本文整理汇总了C++中UserData::loadName方法的典型用法代码示例。如果您正苦于以下问题:C++ UserData::loadName方法的具体用法?C++ UserData::loadName怎么用?C++ UserData::loadName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserData
的用法示例。
在下文中一共展示了UserData::loadName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: insertFile
int Container::insertFile(FILE *in,int num_items,int *so_far,int *stopping)
{
UserData *ud;
UserData *first;
char buffer[1024];
int i;
int STEP = 50;
PRECORDCORE pr;
// monitored by external thread
*so_far = 0;
// Build up insertion information
RECORDINSERT ri;
memset(&ri,0,sizeof(RECORDINSERT));
ri.cb = sizeof(RECORDINSERT);
ri.zOrder = CMA_END; // add on top of siblings
ri.fInvalidateRecord = TRUE; // re-arrange after insert
ri.pRecordParent = (PRECORDCORE)NULL; // set tree hierarchy
ri.pRecordOrder = (RECORDCORE*)CMA_END; // add to end of list
while (!(*stopping) && num_items > STEP)
{
first = allocateRecords(STEP);
ud = first;
if (ud)
{
for (i=0; i<STEP; i++)
{
// objects[num_objects] = ud; // keep a pointer to the block
num_objects++;
// fgets(buffer,1024,in);
// trimCR(buffer);
// ud->setName(buffer);
ud->loadName(in);
// ud->setType(TYPE_FILE);
// ud->setIcons(WinLoadPointer(HWND_DESKTOP,0,ICON_GROUP_O),
// WinLoadPointer(HWND_DESKTOP,0,ICON_GROUP_C));
pr = (PRECORDCORE)ud;
ud = (UserData*)pr->preccNextRecord;
}
ri.cRecordsInsert = STEP; // number of records to insert
// MRESULT rc = WinSendDlgItemMsg(dialog,id,CM_INSERTRECORD,MPFROMP((PRECORDCORE)first),MPFROMP(&ri));
MRESULT rc = WinSendMsg(cont,CM_INSERTRECORD,MPFROMP((PRECORDCORE)first),MPFROMP(&ri));
if (rc == 0)
message("CM_INSERTRECORD returned %d",rc);
}
num_items -= STEP;
*so_far += STEP;
if (STEP < 1000)
STEP += 50;
// arrange();
}
if (!(*stopping) && num_items > 0)
{
ri.cRecordsInsert = num_items; // number of records to insert
first = allocateRecords(num_items);
ud = first;
if (ud)
{
for (i=0; i<num_items; i++)
{
// objects[num_objects] = ud; // keep a pointer to the block
num_objects++;
// fgets(buffer,1024,in);
// trimCR(buffer);
// ud->setName(buffer);
ud->loadName(in);
// ud->setType(TYPE_FILE);
// ud->setIcons(WinLoadPointer(HWND_DESKTOP,0,ICON_GROUP_O),
// WinLoadPointer(HWND_DESKTOP,0,ICON_GROUP_C));
pr = (PRECORDCORE)ud;
ud = (UserData*)pr->preccNextRecord;
}
*so_far += num_items;
// MRESULT rc = WinSendDlgItemMsg(dialog,id,CM_INSERTRECORD,MPFROMP((PRECORDCORE)first),MPFROMP(&ri));
MRESULT rc = WinSendMsg(cont,CM_INSERTRECORD,MPFROMP((PRECORDCORE)first),MPFROMP(&ri));
if (rc == 0)
message("CM_INSERTRECORD returned %d",rc);
return 1;
}
}
// arrange();
return 0;
}