Hi guys, i have this peace of code:
//-------------------------------------------------------------------------------//
#include <QtGui>
#include <windows.h>
#include <lm.h>
.................................................. ...................
PSHARE_INFO_502 BufPtr,p;
NET_API_STATUS res;
DWORD er=0,tr=0,resume=0, i;
QString *str = new QString;
QTreeWidgetItem *rootItem = new QTreeWidgetItem(SharesTree);
rootItem->setText(0,"My Shares");
QTreeWidgetItem *item;
do
{
res = NetShareEnum (NULL, 502, (LPBYTE *) &BufPtr, -1, &er, &tr, &resume);
if(res == ERROR_SUCCESS || res == ERROR_MORE_DATA)
{
p=BufPtr;
for(i=1;i<=er;i++)
{
item = new QTreeWidgetItem(rootItem);
str->fromStdWString(p->shi502_netname);
item->setText(0,str);
p++;
}
NetApiBufferFree(BufPtr);
}
}
while (res==ERROR_MORE_DATA);
SharesTree->expandItem(rootItem);
.................................................. ............................
//----------------------------------------------------------------------------------------//
I'm using Qt4.1.1_opensource_mingw on Windows. It was configured like this:
configure -stl
and then
make
The program is building with success, but the fromStdWString function doesn't work ...What's wrong ??
Thanks a lot ...
Bookmarks