|
I need to trap IO calls (file open/close) at kernel level and take some action. can anyone help me with some direction/sample code etc.
|
|
|
|
|
Previously I was using the vc++6.0.
There If I need to add one lib file to my project I do like:
1. go to project settings
2. Link tab
3. Object/Library modules
4. add lib name.
Here, But in Dot Net environment how do I do?
How to include my lib file in the vc++.net 7.0 environment?
Please tell me any one.
Nice talking to you.
If you judge people, you have no time to love them. -- Mother Teresa
|
|
|
|
|
Write this inside the StdAfx.h file
#pragma comment(lib, "yourlib.lib")
Or
Through the solution explorer
Simply click on the project click on Add->Add existing Item..
Select the lib file.
or
Goto Project properties
Click on Linker
Click on Input
Additional Dependencies -> Enter your lib name here
Jesus Loves You and Me <marquee direction="up" height="50" scrolldelay="1" step="1" scrollamount="1" style="background-color:'#44ccff'">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
-- modified at 1:18 Wednesday 28th December, 2005
|
|
|
|
|
Thanks
Nice talking to you.
If you judge people, you have no time to love them. -- Mother Teresa
|
|
|
|
|
Projects-> [ProjectName] Properties -> Configuration Properties->Linker->
Additional dependencies
Regards
Abhi Lahare
|
|
|
|
|
I am wrtting a text input dialog using CRichEditCtrl, the following code are used to change font
void CDialogText::ChangeFont()
{
CHARFORMAT cf;
m_reText.GetSelectionCharFormat(cf); //m_reText is the CRichEdit Control
cf.dwMask = CFM_FACE;
CString strFaceName;
UINT nIndex = m_cbFamily.GetCurSel();
m_cbFamily.GetLBText(nIndex, strFaceName); //m_cbFamily is a ComboBox, list all installed fonts
lstrcpy(cf.szFaceName,(LPCTSTR)strFaceName);
m_reText.SetSelectionCharFormat(cf);
m_reText.SetFocus();
}
My problem is , when I selected some text in RichEdit , the function works ok.
But if I didn't selected any text, then select a new font. The new font can't affect the following text I input. Anyone could tell me how to solve the problem? Thank you!
|
|
|
|
|
Try a select all and then set the font.
Jesus Loves You and Me <marquee direction="up" height="50" scrolldelay="1" step="1" scrollamount="1" style="background-color:'#44ccff'">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|
|
Call
m_reText.Invalidate();
which will update the window.
You can also do it this way...
<code> CFont pNewFont;
LOGFONT lf2;
memset(&lf2, 0, sizeof(LOGFONT));
strcpy(lf2.lfFaceName, "Times New Roman");
lf2.lfHeight = 120;
lf2.lfWeight = FW_NORMAL;
pNewFont.CreatePointFontIndirect(&lf2);
m_cRichEdit.SetFont(&pNewFont);
pNewFont.Detach();
m_cRichEdit.Invalidate();
</code>
Hope this helps.
Mark
-- modified at 9:39 Wednesday 28th December, 2005
|
|
|
|
|
|
Hi,
Is there any advantage in using ++i than i++ in simple loops?
For example:
for( int i = 0; i < 10; i++) { }
for( int i = 0; i < 10; ++i) { }
Which is better?
Thank you.
- NS -
|
|
|
|
|
Defenetly there is difference.
++i is faster than i++.
check with the gettickcount function by calling before this code and after the code.
Nice talking to you.
If you judge people, you have no time to love them. -- Mother Teresa
|
|
|
|
|
|
YoU ArE MoSt WeLcOmE.
Nice talking to you.
If you judge people, you have no time to love them. -- Mother Teresa
|
|
|
|
|
G Haranadh wrote: ++i is faster than i++.
Could you explain why? It might be a 100th of a ms faster, but other than that, I don't see why ++i would be significantly faster than i++.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
There's no advantage for integers like i. But if you're using an STL iterator, for example, there's a definite advantage using ++i over i++. The implementation of the postincrement operator would need to do whatever ++i does, but it would also need to store the original value in a temporary variable and return it, which would be less performant.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Thanks for posting this question... I always use i++ but did not know it could be slower.
John
|
|
|
|
|
|
Recently I have started using ++i over i++.
But you must be careful with assignments.
For eg:
int j = ++i or i++;
You must be fully aware of what you are doing.
I use ++i in loops. There is a slight advantage.
i++ returns the value and then increments ie
j = i;
i = i+1;
++i simply increments ie
j = (i=i + 1);
Jesus Loves You and Me <marquee direction="up" height="50" scrolldelay="1" step="1" scrollamount="1" style="background-color:'#44ccff'">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|
|
I dont know about integeres
but for objects it sure that the
performance is better in ++i.
U can find the reason at this link
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccelng/htm/overl_12.asp
I did a small experiment with integers
considering the loop , to test the speed
but it is almost same , for bot type of
increments
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
I was also using i++. Recently changed to ++i...
Thank you.
- NS -
|
|
|
|
|
I'd reiterate the earlier comment that you should BE VERY CAREFUL mixing ++i and i++. It's very easy to skip index 0 in situations where you pre-increment.. only to cause bugs that are sometimes subtle -- especially when dealing with interating through arrays of data.
Read more of what I have to say at http://directx9.blogspot.com/
|
|
|
|
|
|
from the VC assembly dump.
10: for(i=0;i<5; i++)
00401028 mov dword ptr [ebp-4],0
0040102F jmp main+2Ah (0040103a)
00401031 mov eax,dword ptr [ebp-4]
00401034 add eax,1
00401037 mov dword ptr [ebp-4],eax
0040103A cmp dword ptr [ebp-4],5
0040103E jge main+3Fh (0040104f)
11: printf("Hello World!\n");
00401040 push offset string "Hello World!\n" (0042001c)
00401045 call printf (004010b0)
0040104A add esp,4
0040104D jmp main+21h (00401031)
12:
13: for(i=0;i<5; ++i)
0040104F mov dword ptr [ebp-4],0
00401056 jmp main+51h (00401061)
00401058 mov ecx,dword ptr [ebp-4]
0040105B add ecx,1
0040105E mov dword ptr [ebp-4],ecx
00401061 cmp dword ptr [ebp-4],5
00401065 jge main+66h (00401076)
14: printf("Hello World!\n");
00401067 push offset string "Hello World!\n" (0042001c)
0040106C call printf (004010b0)
00401071 add esp,4
00401074 jmp main+48h (00401058)
so clearly the code for both cases is the same.
so no difference if you use the incrementor statements (pre or post) that are independent.
<hr<span style="color:gray;size:15px;">-Prakash
-Prakash
|
|
|
|
|
Its amazing...
I thought that post increment will cause a temporary instance for keeping the value, and then it will increment.
Thank you for revealing a great mistake.
- NS -
|
|
|
|
|
As far as i know it will not effect the
integer type but
if u are using an c++ object during the
increment it will effect preformance
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|