|
denghp wrote: ...but that's not what I want.
You asked, "How can I get file record like using DeviceIoControl function with the control code FSCTL_GET_NTFS_FILE_RECORD to retrieve the file record?" The link I provided had an example of such.
"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
|
|
|
|
|
Hi All,
I'm tearing my hear out over this one. I am subclassing controls dynamically at runtime. I run through each child control of a window, and check it's class. If the class is "BUTTON" I want to subclass it to one of four controls:
CThemedButton : public CButton
CThemedRadioButton : public CButton
CThemedGroupBox : public CButton
CThemedCheckBox : public CButton
However, I cannot for the life of me get the correct combination of window styles to make this work in every case. My code is as below:
bool bGroupBox = (dwControlStyle&BS_GROUPBOX);<br />
bool bRadioButton = (dwControlStyle&BS_RADIOBUTTON);<br />
bool bAutoRadioButton = (dwControlStyle&BS_AUTORADIOBUTTON);<br />
bool bCheckBox = (dwControlStyle&BS_CHECKBOX);<br />
bool bAutoCheckBox = (dwControlStyle&BS_AUTOCHECKBOX);<br />
bool bPushLike = (dwControlStyle&BS_PUSHLIKE);
But I'm getting bizarre results. It seems that BS_AUTORADIOBUTTON for example is a combination of other flags, as is BS_GROUPBOX. The end result is I get some buttons that are subclassed, unless they're the default buttons, group boxes aren't picked up, check boxes are missed. The button styles aren't proper flags it seems, so I'm getting cases where bRadioButton, bAutoRadioButton and bGroupBox are all true!
Please can anyone help me here? This should be simple but it's been causing me no end of problems.
Thanks in advance,
Dave Kerr
|
|
|
|
|
Aren't Group Boxes actually Statics, not Buttons? That should help you a little, but I don't have answers for the others.
|
|
|
|
|
hello guys. I have finished my project and its working perfectly fine. however, my output is not aligned properly and needs some minor adjustment. I have played around with the setw function but i really do not know what is causing the problem. I mean, the output does not look very bad. i just feel it could be much better. anyways
1) i need to right justify the values on the far right colum(difference column).
2) i need to align the columns perfectly as they are not aligned. you could try putting in the values and you will see what i am talkin about.
how can i send the code so you can take a look at it?
|
|
|
|
|
some more clarity is required in your question.
kumamako wrote: my output is not aligned properly
where is it output to?
kumamako wrote: far right colum
column in which control?
kumamako wrote: how can i send the code so you can take a look at it?
donot put your whole code here.
just post that code where you suspect problem(not more than 10 to 12 lines).
--------------------------------------------
Suggestion to the members:
Please prefix your main thread subject with [SOLVED] if it is solved.
thanks.
chandu.
|
|
|
|
|
You may post a relevant code snippet (don't forget to use the code block button).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
kumamako wrote: however, my output is not aligned properly and needs some minor adjustment. I have played around with the setw function...
Which is the right manipulator to use.
kumamako wrote: ...but i really do not know what is causing the problem.
What problem?
"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
|
|
|
|
|
#ifndef BYTE // For OS X -ers
#define unsigned char BYTE
#define unsigned char * LPBYTE
#endif
#include <vector>
#include <algorithm>
void separate(vector< pair<LPBYTE, LPBYTE> >& retVec, LPBYTE data, LPBYTE delimeter, bool *bComplete = 0) {
retVec.clear();
if (bComplete) *bComplete = false;
if (!data)
return;
LPBYTE dataEnd = data + sizeof(data);
LPBYTE delEnd = delimeter + sizeof(delimeter);
size_t delSize = distance(delimeter, delEnd);
LPBYTE found = std::search(data, dataEnd, delimeter, delEnd);
if (found == delEnd)
return;
cout << "In separate(...)\n";
if (data[0] == delimeter[0])
cout << "data[0] == delimeter[0]\n";
if (found == data)
cout << "Found == data.\n(" << found[0] << " == " << data[0] << ")\n";
if (found != data)
cout << "Found != data; found == data[" << distance(data, found) << "].\n";
return;
};
int main()
{
BYTE buffer[] = {',', '1', '2', '3', ',', '4', '5', '6', ',', '7', '8', '9', ',', 0};
BYTE del = ',';
bool bComp = true;
LPBYTE found = std::search(&buffer[0], &buffer[0] + sizeof(buffer), &del, &del + sizeof(del));
if (found == &buffer[0])
cout << "found == &buffer[0]\n";
else
cout << "found == &buffer[" << distance(&buffer[0], found) << "]\n";
vector< pair<LPBYTE, LPBYTE> > lpb;
separate(lpb, buffer, &del, &bComp);
return 0;
} Output:
found == &buffer[0]
In separate(...)
data[0] == delimeter[0]
Found != data; Found == data[4]
When I search from within main() , the leading comma is found, but once I pass the data & delimeter to separate() , it misses the leading comma and finds the next one.. obviously I'm missing something - can anyone spot what it is?
Your assistance is greatly appreciated!
MZR
|
|
|
|
|
In main(), del is of type BYTE and sizeof(del) is 1. Once it's passed to separate , del is of type LPBYTE and sizeof(del) is 4.
|
|
|
|
|
How do I put a CFormView in a CDockablePane? Basically, I'm trying to make the child window scrollable. Thanks.
|
|
|
|
|
I need a program in c to implement the problem of nearest neighbor method in C
|
|
|
|
|
singh.vikas8508 wrote: I need a program in c to implement the problem of nearest neighbor method in C
I need you to read the guidelines[^]
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
At the bottom of this article [^] there are links to available libraries.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
The "kind guy" makeover doesn't look good on you.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Rajesh R Subramanian wrote: The "kind guy" makeover doesn't look good on you.
I know.
BTW did you read this [^]? Now I must choose:
- Should I stop using sarcasm in my answers?
- Should I instead stop answering?
- Should I build the wall?
- Should I run for president?
- Should I trust the government?
- Will they put me in the firing line?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
CPallini wrote: Should I stop using sarcasm in my answers?
The occasional sarcasm is good. Also, you're mature enough to keep it under acceptable levels, so I don't see a problem.
CPallini wrote: Should I instead stop answering?
WTF are you talking about.
CPallini wrote: Will they put me in the firing line?
I hope.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Well, I'm unhappy with Chris 'HOW TO ANSWER A QUESTION'. Anyway, of course, I'm not going to stop.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
My same exact thoughts. We always try our levels best to provide an answer that could be of help; but some questions CANNOT be answered and the OP WILL NOT learn, no matter what. Now, we can ignore such posts completely.
But like you said, I won't stop either.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
consider writing one yourself...
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
i need to measure a char width in a text , to detrmine where the user clicked.
void CTest_View::OnLButtonDown(UINT nFlags, CPoint point)
{
CString strInput;
strInput = "Text 1234";
int nX = point.x; // but this is the position in pixel.
}
please help.
Thanks
|
|
|
|
|
Let me google that for you![^] and remember that google or any search engine is your friend.
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
What does it have to do with finding the character width? Can't you just call GetCursorPos()[^]?
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
no because i need to find th x and y where the mouse clicked in order to mark the text to copy it.
|
|
|
|
|
susanne1 wrote: i need to find th x and y where the mouse clicked in order to mark the text to copy it.
Ugh... You need to find x and y? Ya know? That's *exactly* what GetCursorPos() does.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
CDC::GetTextExtent [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|