|
hiii
I know
VCNs(Virtual cluster number) are clusters within a particular file,
LCNs(Logical cluster number) are clusters on the volume.
Thus VCN 0 of a file may map to LCN 2394 of a volume, VCN 1 may map to LCN 104227, and so on.
So my doubt is the the LCN of a particular volume (say G: drive) will start with 0x00...?
Thanking you..
Krish+
krishnampkkm@gmail.com
|
|
|
|
|
HI
I have a large string which is basically a path.. eg. C:\programfiles\Test\Drv\wince4.0\armv4
I need to find for \Drv in above string. Drv can be DRV or Drv . I need to find for \Drv irrespective of its case.. ie., case insensitiveness.
Can I have a api or any code snippet for this.
Thanks,
Venkat
|
|
|
|
|
It depends which which type of strings you are manipulating.
For C-style strings (simple char arrays), take a look at strstr[^].
For a CString object, take a look at CString::Find[^].
For std::string, take a look at string::find[^].
|
|
|
|
|
I am using CStrings.. I tried with CString::Find.. But it is case sensitive. I want an api which can find substring irrespective of the case.
|
|
|
|
|
If you read the docs of CString (some people do this) you find the functions MakeUpper(). With that you can make both strings with big chars so you can find it.
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
StrStrI[^]
However....what you're doing is looking for an element of a path. I'd be tempted to use the Path functions[^] in shlwapi to go through the path, component by component, looking for the one you want:
bool ContainsAnElement(LPCTSTR path, LPCTSTR lookFor)
{
LPCTSTR componentEnd = PathFindNextComponent(path);
while (componentEnd)
{
if (0 == StrCmpNI(path, lookFor, componentEnd-path-1)) return true;
path = componentEnd;
componentEnd = PathFindNextComponent(path);
}
return false;
}
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
first given string input string(C:\programfiles\Test\Drv\wince4.0\armv4) and string to be identified (Drv) convert to either upper case and lower case letters. Then use string find operation to identify sting.
here is some sample
#include<cctype>;
#include<algorithm>;
#include<string>;
#include<iostream>
using namespace std;
int string_to_upper(int ch)
{
return toupper(ch);
}
int main()
{
string s = "C:\\programfiles\\Test\\Drv\\wince4.0\\armv4";
string s1 ="\\Drv";
transform(s.begin(), s.end(), s.begin(), string_to_upper);
transform(s1.begin(),s1.end(),s1.begin(),string_to_upper);
if(s.find(s1)!=string::npos)
cout<<"string found"<
|
|
|
|
|
Hi,
I have created MFC application.I have used ListControl in it.I need to use multiple selection in ListControl.I have made single selection false.But it does not work.I have added following line.
m_lcSample.ModifyStyle(LVS_SINGLESEL, 0);
But it does not work.Can anyone help me.
|
|
|
|
|
All I can do is confirm that your code is correct and works for me - one other thing, though, the documentation for LVS_SINGLESEL states By default, multiple items may be selected, so you shouldn't need to do that anyway, unless you've explicitly selected "Single Selection" for the control in the dialog editor.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Thanks for your reply.If I select muiltiple items with "ctrl" button then I can able to do multiple selection. But for ListBox this is not the case. Previously I thought I
can do multiple selection without "ctrl" button as Listbox.Can I do that?
|
|
|
|
|
Oh, I see (I think) - you want to add to the selection whenever you click on an item? Nah, can't do that with a standard list control. However, I'm sure you could use the notifications that a list control sends (LVN_ITEMCHANGING, LVN_ITMECHANGED, NM_CLICK) to implement your selection logic.
e.g. here's some code handling notifications from a list control (list_). This inverts a particular item's selection when it's clicked on, not affecting any other control's selection state. canChangeSel_ is a bool member of the dialog, and is used to tell the LVN_ITEMCHANGING handler if it can allow selection changes or not.
void CaaaDlg::OnNMClickList1(NMHDR *pNMHDR, LRESULT *pResult)
{
LPNMITEMACTIVATE itemActivate = (LPNMITEMACTIVATE)pNMHDR;
const int hit = list_.HitTest(LPNMITEMACTIVATE(pNMHDR)->ptAction);
if (hit != -1)
{
canChangeSel_ = true;
list_.SetItemState(hit, ~(list_.GetItemState(hit, LVIS_SELECTED)), LVIS_SELECTED);
canChangeSel_ = false;
}
}
void CaaaDlg::OnItemChangingList1(NMHDR *pNMHDR, LRESULT *pResult)
{
LPNMLISTVIEW pLV = LPNMLISTVIEW(pNMHDR);
*pResult = FALSE;
if ((pLV->uChanged&LVIF_STATE) && LVIS_SELECTED==((pLV->uNewState^pLV->uOldState)&LVIS_SELECTED))
*pResult = canChangeSel_?FALSE:TRUE;
}
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
hemlat wrote: But for ListBox this is not the case.
For a listbox, you must send it a LBS_MULTIPLESEL message.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
I want to load multiple images in my progg. from sample database. So for ease i have saved my database serially. So in the given progg. i want str to b replaced by by 1.bmp, 2.bmp, 3.bmp and so on...but it is reading only str. Can you plzz tell how to do the same and what's the prob. in doing as i have done.
//Progg. for taking the names serially.
#include"stdio.h"
#include"string.h"
#include"conio.h"
#include"CImg.h"
using namespace cimg_library;
int main()
{
int i;
char str[10],string[10],fmt[]=".bmp";
for(i=1;i<=10;i++)
{
sprintf(str,"%d",i);
strcat(str,fmt);
CImg<double> image("C:/Users/Shree Hari/Desktop/trial/str");
CImgDisplay main_display(image,"Image",0);
//printf("\n\n%s\n",str);
}
getch();
return 0;
}
|
|
|
|
|
shyampasari wrote: but it is reading only str.
Well, obviously because you hard-coded it that way. If you want to concatenate the str variable to the string "C:/Users/Shree Hari/Desktop/trial/", you will need to call strcat:
char fullPath[MAX_PATH];
strcpy(fullPath,"C:/Users/Shree Hari/Desktop/trial/");
strcat(fullPath,str);
|
|
|
|
|
Thankkyou Cedric for your reply.
I have implemented what you have write.As follows but again ma progg run and a window popped with a mssg
CImg<double>::load():File 'path' cannot be opened.
Plzz reply!!!
//Progg. for taking the names serially.
#include"stdio.h"
#include"string.h"
#include"conio.h"
#include"CImg.h"
using namespace cimg_library;
int main()
{
int i;
char str[10],string[10],fmt[]=".bmp",path[]="C:/Users/Shree Hari/Desktop/trial/";
for(i=1;i<=10;i++)
{
sprintf(str,"%d",i);
strcat(str,fmt);
strcat(path,str);
CImg<double> image("path");
CImgDisplay main_display(image,"Image",0);
//printf("\n\n%s\n",str);
}
getch();
return 0;
}
|
|
|
|
|
Hum, I think you need some serious tutorial on string manipulation because it seems you don't understand at all what you are doing.
First:
shyampasari wrote: CImg<double> image("path");
Because of the quotes, you are passing a string litteral and not the path variable. Remove the quotes.
Second:
Each time in your loop you will concatenate a new string to the previous string (which already contains the full path). So, it will work for the first image but not for the second anymore. You could simplify everything by simply doing this:
char path[255];
for(i=1;i<=10;i++)
{
sprintf(path,"C:/Users/Shree Hari/Desktop/trial/%d.bmp",i);
....
|
|
|
|
|
How to set the checkbox in CListView to be disable for user to change?
But user can not only double click and click the item in CListView,but also can multiple select by shift and control.
|
|
|
|
|
Well, i don't know how you could change its appearance aside of drawing the items yourself but you can avoid the changing of the check state by handling the LVN_ITEMCHANGING[^] notification.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
hi all,
i have a folder named "test" which is installed in windows directory when my program gets installed.if windows installed in D then my folder path is D:\\test
can i have some example code, in which i can open this folder and write a file with admin privileges.
i want a code example to open the folder "test" in windows directory and write a file...
thanks...
|
|
|
|
|
|
Subrat Patnaik wrote: i have a folder named "test" which is installed in windows directory...
Which implies:
d:\windows\test
If you have d:\test instead, the test folder resides off the root of the Windows volume.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
I'm trying to copy the used clusters of a hard disk partition(NTFS,windows os) to another partition.
I used the "FSCTL_GET_VOLUME_BITMAP" to get the cluster usage details.
And I'm getting the used and free cluster counts correctly.And the cluster number I got is continuous.
This makes problem for me. I wanna copy the used clusters to a different partition.
What type of cluster number I'm getting.? ; but the answer is correct.
It makes confusion to me.
Sometimes my question may be totally wrong.....
with regards Krish
modified on Friday, June 12, 2009 3:09 AM
|
|
|
|
|
how to realize scrolling text in a dialog,like the <maquee><\maquee> in html?I use double buffering to draw the text,and change the text position in Ontimer() function.However,I found the effect is not so good.I heard about that can use the Multi-threaded to realize it?How?Thanks!
|
|
|
|
|
|
CWaitCursor changes back to normal cursor on mouse move event, before the end of the function
CWaitCursor wait;
|
|
|
|