|
Can you explain co-ordinates of HDC
|
|
|
|
|
Left, right, top and bottom of device context or window which is associated with that device context.
|
|
|
|
|
Can you use of hWnd of window?
|
|
|
|
|
in my application i have made XML file .
i have read it and stored content in the string after cheking the tokens i fetched the values according to the tokens and put that values in the listview.
as per following.(first folder is selected , and then file selected)
LISTVIEW
---------------------------------------------------------------------------------------------------
File | Extension | size | Duration | Bitrate | Type | ModifiedDate | protected
D:\amit\ - - - - - - -
amit.wmv wmv 296KB 00:30:00 495kbps Window 7/7/2007 completed
Media
File
====================================================================================================
xml file is below.
------------------------------
<filelist>
<listitem type="dir" order="0">
<path>D:\amit\</path>
</listitem>
<listitem type="file" order="1">
<filename>C:\Documents and Settings\Amit\Desktop\MediaFiles\TT.wmv</filename>
<extension>wmv</extension>
<size>494 KB</size>
<Duration>00:00:38</Duration>
<Bitrate>103 Kbps</Bitrate>
<Type>Windows Media Audio/Video file</Type>
<modifydated>11/22/2005</modifydated>
</listitem>
</filelist>
=============================================================
Code for that is below
when user logged.
at first time the xml file will be read.
switch (message)
{
case WM_INITDIALOG:
{
int i;
char Temp[255];
char * buff = new char[5000];
string xmlbuffer,Pathforfile,PATH;
Registry objReg;
ifstream in;
Utility util;
hList=GetDlgItem(hDlg,IDC_LIST4); // get the ID of the ListView
memset(&plvbki,0,sizeof(plvbki));
SendMessage(hList,LVM_SETEXTENDEDLISTVIEWSTYLE,0,LVS_EX_FULLROWSELECT); // Set style
memset(&LvCol,0,sizeof(LvCol)); // Reset Coluom
LvCol.mask=LVCF_TEXT|LVCF_WIDTH|LVCF_SUBITEM; // Type of mask
LvCol.cx=0x58; // width between each coloum
LvCol.pszText=_T("File"); // First Header
LvCol.cx=0x52;
// Inserting Couloms as much as we want
SendMessage(hList,LVM_INSERTCOLUMN,0,(LPARAM)&LvCol); // Insert/Show the coloum
LvCol.pszText=_T("Extension"); // Next coloum
SendMessage(hList,LVM_INSERTCOLUMN,1,(LPARAM)&LvCol); // ...
LvCol.pszText=_T("Size"); //
SendMessage(hList,LVM_INSERTCOLUMN,2,(LPARAM)&LvCol); //
LvCol.pszText=_T("Duration"); //
SendMessage(hList,LVM_INSERTCOLUMN,3,(LPARAM)&LvCol); //
LvCol.pszText=_T("Bit Rate"); //
SendMessage(hList,LVM_INSERTCOLUMN,4,(LPARAM)&LvCol); //
LvCol.pszText=_T("Type"); //
SendMessage(hList,LVM_INSERTCOLUMN,5,(LPARAM)&LvCol); //
LvCol.pszText=_T("Modified Date"); //
SendMessage(hList,LVM_INSERTCOLUMN,6,(LPARAM)&LvCol); //
LvCol.pszText=_T("Progress"); //
SendMessage(hList,LVM_INSERTCOLUMN,7,(LPARAM)&LvCol);//
LvCol.pszText=_T("Protected"); //
SendMessage(hList,LVM_INSERTCOLUMN,8,(LPARAM)&LvCol);//
memset(&LvItem,0,sizeof(LvItem)); // Reset Item Struct
// Setting properties Of Items:
LvItem.mask=LVIF_TEXT; // Text Style
LvItem.cchTextMax = 256; // Max size of test
ListView_SetItemState(hList,0,LVIS_SELECTED ,LVIF_STATE);
Pathforfile = objReg.GetRegistryKeyEntryValue(TEXT("SOFTWARE\\DRM"),TEXT("InstallDIR"));
PATH=Pathforfile+"Encoder"+username+SITE_ID+".xml";
in.open((PATH.c_str()), ios::in);
char str[2000];
string outstring;
bool onoff=in.is_open();
if(onoff)
{
//xmlbuffer.c_str();
//in.read((char *)&xmlbuffer, sizeof(xmlbuffer));
while(in >> str)
outstring+=str;
char *token;
char *tok = strtok_s((char*)outstring.c_str(),"<>",&token);
while(tok)
{
if(tok == NULL)
break;
else
{
string tmp = tok;
// Check for the <Profile> Node.
if(tmp.find("type") != -1)
{
//Get the profile Name and store in the vector;
{
size_t pos1 = tmp.find_first_of("=");
if(pos1 != -1)
{
string tmpType = tmp.substr(pos1 + 2); //value of tmpProName would be: profileName" ID="ENCRYPTEDID">
size_t pos2 = tmpType.find_first_of("\"");
if(pos2 != -1)
{
string inputtype = tmpType.substr(0,pos2);
if(inputtype=="dir")
{
if(tmp.find("order") != -1)
{
size_t pos1 = tmp.find_last_of("=");
string tmporder = tmp.substr(pos1 + 2);
size_t pos2 = tmporder.find_last_of("\"");
string inputorder = tmporder.substr(0,pos2);
int i=atoi(inputorder.c_str()); //find the order for display in the list view
tok = strtok_s(NULL,"<>",&token);
tmp=tok;
if(tmp.find("path") != -1)
{
tok = strtok_s(NULL,"<>",&token);
string filename=tok;
WCHAR* DIRPATH=util.ConvertStringToWCHAR(tok);
LvItem.pszText=(LPWSTR)DIRPATH;
//SendMessage(hList,LVM_SETITEM,0,(LPARAM)&LvItem);
ListView_SetItemText(hList,i,0,(LPWSTR)&LvItem); // put the listview value from here
}
/*
if(inputtype=="file")
{
if(tmp.find("order") != -1)
{
size_t pos1 = tmp.find_last_of("=");
string tmporder = tmp.substr(pos1 + 2);
size_t pos2 = tmporder.find_last_of("\"");
string inputorder = tmporder.substr(0,pos2);
int i=atoi(inputorder.c_str());
tok = strtok_s(NULL,"<>",&token);
tmp=tok;
if(tmp.find("filename") != -1)
{
tok = strtok_s(NULL,"<>",&token);
string filename=tok;
}
tok = strtok_s(NULL,"<>",&token);
tmp=tok;
if()
*/
}
}
}
}
}
/*
if(tmp.find("order") !=-1)
{
size_t pos1 = tmp.find_first_of("=");
}
*/
}
//tok = strtok_s(NULL,"<>",&token);
}
//////////////////////////end add by amit
tok = strtok_s(NULL,"<>",&token);
}
}
in.close();
//DeleteFile(mainfilename);
}
break;
|
|
|
|
|
What is the problem?
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
the value Lvitem is initalize at the time of debugging but it couldn't display in the list view.
E.g.
WCHAR* DIRPATH=util.ConvertStringToWCHAR(tok); LvItem.pszText=(LPWSTR)DIRPATH;
ListView_SetItemText(hList,i,0,(LPWSTR)&LvItem);<code>
|
|
|
|
|
amitmistry_petlad wrote:
WCHAR* DIRPATH=util.ConvertStringToWCHAR(tok); LvItem.pszText=(LPWSTR)DIRPATH;
//SendMessage(hList,LVM_SETITEM,0,(LPARAM)&LvItem); //this is not working
ListView_SetItemText(hList,i,0,(LPWSTR)&LvItem); //this is not working
Use strcpy or memcpy instead of
LvItem.pszText=(LPWSTR)DIRPATH;
Regards
Anil
|
|
|
|
|
_anil_ wrote: Use strcpy or memcpy instead of
LvItem.pszText=(LPWSTR)DIRPATH;
Just to be certain, do NOT strcpy(...) ,wcscpy(...) or memcpy(...) into pszText. pszText is a pointer, not an array. You have to assign the pointer such that it points to a valid memory location.
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
You haven't put anything in the list control - this code isn't sending LVM_INSERTITEM anywhere.
|
|
|
|
|
what does it mean?
I am going to put the string which i fetched from the xml file.
Amit
|
|
|
|
|
then how can i resolve this problem? can you please help me
as U refer my code i had write the value even assign left had side inspite it will not work.
what should i do?
Amit
|
|
|
|
|
You need to add items to the list with LVM_INSERTITEM before you can change the text or state of anything.
|
|
|
|
|
oh!!!
sorry i done it after your first sent, but it was my absent mide then i had read it properly and solve it.
Thnaks
ok i want to ask you the order management of list view .
when i read the file it will display the record but the first read goes bottom down .
e.g Means
if the read 0 number listitem it should be zero in order . then first and second but it display in reverse so is there any standard function is there
to manage list.
|
|
|
|
|
When you send LVM_INSERTITEM , you tell the control what position the new item should have. Remember to turn off the sort style of the control since you don't want it to sort the items automatically.
|
|
|
|
|
ya thanks Dear Mike .
your name is lovely mike...
i like it. i think this name is comman in US . isn't it?
|
|
|
|
|
Hello All
I am using VC6 to get an Image data type from SQL server.
I am using the bellow statement.
<br />
RFX_Binary(pFX, _T("[@File]"), mFileParam, 800000);
The statement works fine when I am trying to get the data from DB.
And also it works fine when I insert data of size is bellow 8KB. But when the data size exceed I an not able to insert data into SQL server using it.
Can you please give me any clue to search.
Regards
Anil
|
|
|
|
|
_anil_ wrote: But when the data size exceed I an not able to insert data...
Do you receive an error?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
thanks for the respond.
yes i am getting exception. it says that Right side data truncated. Actual error message may be different, Since its on japanese. But the meaning is this.
Regards
Anil
|
|
|
|
|
Hello,
I am currently working on a simple program with the Windows API that will be drawing polygons in a dialog box to provide the user with a guide to the values that are being graphed over them. My question is this:
I would like to be able to draw two shapes (bascially using the LineTo function and connecting all the lines) and then shade in the area between them. To give an example, think of a bullseye, I would like a large ring with a smaller ring inside it, with the larger ring colored in.
Anyone have any suggestions on where to start? I am fairly new to the drawing functions in Windows.
Thanks guys,
Joe
|
|
|
|
|
|
Can any one explain in brief the bind function in SDK for Socket programming
"Assigns a local name to an unnamed socket"
VIBIN
Sim Infosys
|
|
|
|
|
VIBIN wrote: Can any one explain in brief the bind function in SDK for Socket programming
"Assigns a local name to an unnamed socket"
The bind function is used on an unconnected socket before subsequent calls to the connect or listen functions. It is used to bind to either connection-oriented (stream) or connectionless (datagram) sockets. When a socket is created with a call to the socket function, it exists in a namespace (address family), but it has no name assigned to it. Use the bind function to establish the local association of the socket by assigning a local name to an unnamed socket.
ref: from MSDN 2005.
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
yeah, bind simply finds and open and available socket to commense ethernet communication. Without a binded socket, (an address through which the computer knows it can send data) it is impossible to process function like send and recv.
|
|
|
|
|
Hi,
I have a position within a listCtrlView
POSITION pos = listCtrl.GetFirstSelectedItemPosition();
and want to select thr row 'pos - 1'. Is there any command to do this?
Thanks, Gerhard
|
|
|
|
|
ensger wrote: listCtrl.GetFirstSelectedItemPosition();
I think the CListCtrl::GetNextItem() is more easy to use than the GetFirstSelectedItemPosition function. Cause it reurns the index of item
ensger wrote: and want to select thr row 'pos - 1'. Is there any command to do this?
you can use CListCtrl::SetItemState() to make the previous item selected.
nave
|
|
|
|
|