|
|
anshumanshinde wrote:
we have to write a vxd for win9x/me and filesystem driver for ntbased systems(emphasis added)
OK, that concludes it. You *are* stuck between a rock and a hard place. You will have to learn Win9x VxD programming. You will have to learn NT kernel mode programming. You will have to learn filesystem filter drivers, the subtle but often crashing (BSOD-style) difference in the driver model between e.g. NT4 and NT5, the addition of IRP_Xxxx "messages", the addition of ... if you are unlucky even the added power management in NT5+. Just to mention a few of the problems you are facing.
I wish you luck. This is an effort I'd myself feel as a refreshing challenge to undertake!
If I knew less than I do, I'd really recommend the (AFAIK) only commercial entity that *do* know these things and can provide both help and education: OSR. Please note I know close to nothing about that company and have no interests in it - it just happens to be the only entity I know about that actually *can* provide help in these areas.
Again: ++luck;
/Mike
|
|
|
|
|
hi ,
am trying to Draw a rect on top of the text. It is not working . pls see the code
CFont font;
CSize sz;
CBrush gBrush = RGB(10,255,10);
CBrush bBrush = RGB(0,0,0);
CString str=_T("HELLO WORLD");
VERIFY(font.CreateFont(
25, // nHeight
0, // nWidth
0, // nEscapement
0, // nOrientation
FW_NORMAL, // nWeight
FALSE, // bItalic
FALSE, // bUnderline
0, // cStrikeOut
ANSI_CHARSET, // nCharSet
OUT_DEFAULT_PRECIS, // nOutPrecision
CLIP_DEFAULT_PRECIS, // nClipPrecision
DEFAULT_QUALITY, // nQuality
DEFAULT_PITCH | FF_SWISS, // nPitchAndFamily
"Arial Narrow")); // lpszFacename
pDC ->SelectObject(font);
pDC->SelectObject(bBrush);
pDC->TextOut(5, 5, str);
pDC->SelectObject(gBrush);
sz = pDC->GetTextExtent(str);
pDC->Rectangle(5,5,sz.cx+5,sz.cy+5);
|
|
|
|
|
CDC::Rectangle() uses the current pen, not a brush. Create a new pen first, select it into the DC, and then try drawing it.
Dave
http://www.cloudsofheaven.org
|
|
|
|
|
hi Thanks for the reply...I tried that way also, pls see the code, but not working.
Thanks very much
CFont font,font2;
CSize sz;
int x1=0,y1=0,x2=0,y2=0;
CString str=_T("HELLO WORLD");
VERIFY(font.CreateFont(
25, // nHeight
0, // nWidth
0, // nEscapement
0, // nOrientation
FW_NORMAL, // nWeight
FALSE, // bItalic
FALSE, // bUnderline
0, // cStrikeOut
ANSI_CHARSET, // nCharSet
OUT_DEFAULT_PRECIS, // nOutPrecision
CLIP_DEFAULT_PRECIS, // nClipPrecision
DEFAULT_QUALITY, // nQuality
DEFAULT_PITCH | FF_SWISS, // nPitchAndFamily
"Arial Narrow")); // lpszFacename
pDC ->SelectObject(font);
sz = pDC->GetTextExtent(str);
CPen myPen(PS_SOLID,1,RGB(10,255,10));
pDC->SelectObject(&myPen);
pDC->TextOut(5, 5, str);
pDC->Rectangle(5,5,sz.cx+5,sz.cy+5);
|
|
|
|
|
1) What is the value of sz? Is it returning a valid size?
2) What is Rectangle() returning? It should return TRUE if successful.
Dave
http://www.cloudsofheaven.org
|
|
|
|
|
actually, CDC::Rectangle() does use the current brush for filling the rectangle. It uses the current pen only to draw the rectangle's edges.
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
I copied your code into my app, and it worked perfectly. It drew a green rectangle over the text.
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
fo me only a green rect is coming
but no text
rect and all giving me return value success
|
|
|
|
|
That is because the rectangle is over the text;) (ie. The text is behind the rectangle) If you shift the rectangle over a little, you will see the text behind it.
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
Hi, all
I am trying to write a high performance library by using inline assembler, but I have encountered a irritating problem. It seems that VC++ refuses to accept multi-instructions within the inline asm section for the macro. For example, I can write a inline assembler macro with the single instruction “mov eax, 0” but that’s it, VC++ refuses to accept anymore instructions. The following code might give a better understanding.
#define TestMacro1(x) _asm{ mov eax, 0 } // This works<br />
#define TestMacro2(x) _asm{ mov eax, 0; mov ebx, 0 } // This doesn’t
So what I am trying to do here is to add more then one instruction into the macro, but I don’t know how. Any ideas on how to solve this are highly appreciated.
Thanks in advance.
Aidman » over and out
|
|
|
|
|
|
Thank you
I am most grateful
Aidman » over and out
|
|
|
|
|
My untested guess would be
#define TestMacro2(x) _asm{ mov eax, 0 \
mov ebx, 0 }
// Afterall, I realized that even my comment lines have bugs
When one cannot invent, one must at least improve (in bed).-My latest fortune cookie
|
|
|
|
|
When I try to compile this:
#define TestMacro2(x) _asm{ mov eax, 0 \
mov ebx, 0 }
int main() {
TestMacro2(0);
return 0;
}
I get the following error and warning with VC++:
warning C4405: 'mov' : identifier is reserved word<br />
error C2400: inline assembler syntax error in 'second operand'; found 'register'
Thanks anyway
Aidman » over and out
|
|
|
|
|
I am sorry Aidman that it didn't work. It was just a suggestion that I didn't test, because I was in a hurry.
// Afterall, I realized that even my comment lines have bugs
When one cannot invent, one must at least improve (in bed).-My latest fortune cookie
|
|
|
|
|
Nope. Won't work. The '\' at the end of the line will cause the two lines to be concatenated, effectively becoming
#define TestMacro2(x) _asm{ mov eax, 0 mov ebx, 0 } You'll have to use PJ's solution to get the result he's after.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
It was a shot in the dark. In assembly there are no line delimiters such as ; (I am sure you know this), while PJ's solution seemed to work I thought he could give it a try with my idea. Obviously, it doesn't work.
// Afterall, I realized that even my comment lines have bugs
When one cannot invent, one must at least improve (in bed).-My latest fortune cookie
|
|
|
|
|
The __asm is its own separator, so __asm mov ax,0 __asm mov bx,0 is perfectly valid code.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Hi,
Did you try:
#define TestMacro2(x) { _asm mov eax, 0 _asm mov ebx, 0 }
or even
#define TestMacro2(x) { \
_asm mov eax, 0 \
_asm mov ebx, 0 \
}
Both of the above should work - note the surrounding braces {} are not necessary but are there to make the code look prettier.
HTH
--------------------------------------------
"The mere act of drinking beer in an attempt to measure your tolerance is likely to affect your impression of how many beers you've drunk."
-- The Heineken uncertainty principle.
|
|
|
|
|
see:
http://www.codeproject.com/script/comments/forums.asp?msg=550923&forumid=1647#xx550923xx
and
http://www.codeproject.com/script/comments/forums.asp?msg=549039&forumid=1647#xx549039xx
now my test result is :
the clean app works, but the clean DLL does not.
a good man
|
|
|
|
|
Hello all
I'm coding an application using CPropertySheet and adding some property pages to this property sheet. The problem the Apply button by default is disabled, is there any way to enable it for all the property pages contained in the property sheet.
If any one knows how to do it, pls help me.
thanks for your time.
Hari.
|
|
|
|
|
From my copy of MSDN
CPropertyPage::SetModified() Call to activate or deactivate the Apply Now button.
If you can keep you head when all about you
Are losing theirs and blaming it on you;
If you can dream - and not make dreams your master;
If you can think - and not make thoughts you aim;
Yours is the Earth and everything that's in it.
Rudyard Kipling
|
|
|
|
|
Hi Andrew
Thanks for the reply. Now the Apply button is activated whenever I change any of the Page properties.
Thanks for answering my question.
Hari.
|
|
|
|
|
That's ok.
If you can keep you head when all about you
Are losing theirs and blaming it on you;
If you can dream - and not make dreams your master;
If you can think - and not make thoughts you aim;
Yours is the Earth and everything that's in it.
Rudyard Kipling
|
|
|
|