|
Assuming you have an edit control with the ES_MULTILINE style, you can do something like:
CStdioFile file(_T("c:\\boot.ini"), CFile::modeRead);
CString strFileLine,
strEditLine;
int nLine = 1;
while (file.ReadString(strFileLine) != FALSE)
{
strEditLine.Format(_T("%d %s\r\n"), nLine++, (LPCTSTR) strFileLine);
m_edit.ReplaceSel(strEditLine);
}
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Thanks for ur reply..
Sorry i am asking silly questions..as I am new to MFC...Actually i want to
1. open C source file with standard coloring of keywords of C langauge ..&
2. a new view window which display line number & have capabilty to set break-points ..(like M VC++ editor have)
3. a shared vertical scroll-bar between these windows.
I am using RichEditView class for other operations like get line number on double-clk,etc..
Regards
Irshad
|
|
|
|
|
what is the best way to debug a service in vs 6.0..
|
|
|
|
|
Is the service writen by you??
If yes set the breakpoints and press f5
P.R.A.K.A.S.H
|
|
|
|
|
There are a few ways really. Normal Breakpoint F5 debugging is tricky as im sure you have found out due to the way the SCM starts the service.
I usually write my app as a normal app then turn it into a service when its done, but if thats not possiable you can use hardcoded breakpoints
Put the line "_asm int 3" into your service's code and you find when you run the service you get a dialog asking you to debug the app. Press cancle and you will be taken into the debugger
|
|
|
|
|
hello,
I want to prevent user shutdown.
I am catching the WM_QUERYENDSESSION message and returning a 1, which occording to the
inline help should stop the shutdown process.
It works on occassions but crashes on others, it seems to be completely inconsistent too...I know i am cathing the WM_QUERYENDSESSION so its not anything else...
Is there something else I need to do???
Thanks in advance
|
|
|
|
|
rw104 wrote:
I am catching the WM_QUERYENDSESSION message and returning a 1, which occording to the
inline help should stop the shutdown process.
I believe that should be a 0.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
rw104 wrote:
I am catching the WM_QUERYENDSESSION message and returning a 1, which occording to the inline help should stop the shutdown process.
Hum, I don't get the same info in MSDN:
From MSDN, Platform SDK: Windows System Information
"Return Values
If an application can terminate conveniently, it should return TRUE; otherwise, it should return FALSE.
Remarks
By default, the DefWindowProc function returns TRUE for this message.
Windows NT/2000/XP: When an application returns TRUE for this message, it receives the WM_ENDSESSION message and it is terminated, regardless of how the other applications respond to the WM_QUERYENDSESSION message.
Windows 95/98/Me: After all applications return TRUE for this message, they receive the WM_ENDSESSION and they are terminated. "
HTH,
K.
And I'm talking to myself at night because I can't forget
Back and forth through my mind
Behind a cigarette
|
|
|
|
|
Hi!
I'm about to learn mfc so for the moment I'm just playing around. I'm trying to create a plain window using the CFrameWnd class. The Create funtion takes a parameter called lpszMenuName. msdn gives the following explanation:
lpszMenuName
Identifies the name of the menu resource to be used with the window. Use MAKEINTRESOURCE if the menu has an integer ID instead of a string. This parameter can be NULL.
So my question is: How do you identify a menu resource with a string instead of a integer ID. Also, MAKEINTRESOURCE gives me a compile error.
|
|
|
|
|
What is the project type that you have selected?
P.R.A.K.A.S.H
|
|
|
|
|
1. How to identify a menu resource with a string instead of an integer ID.
Simple. Don't #define the symbol you use, eg MYMENU, to have an integer value.
In the absence of other information, this will be treated as a string name.
Note, however, that if you're using the VC++ IDE, it will automatically define a number for you, so it's harder to do this - you have to remember to type quotation marks &dquot; around the name.
2. You are using something like
MAKEINTRESOURCE( mynumber )
or
MAKEINTRESOURCE( 12 )
aren't you?
Steve S
|
|
|
|
|
|
and yes, I'v been using MAKEINTRESOURCE as you decribed. Is there another way?
|
|
|
|
|
No, but I have seen people use:
::LoadMenu(hInst, MAKEINTRESOURCE);
and wonder why it doesn't compile
Steve S
|
|
|
|
|
How to get HDD serial number from Windows98?
were rgrtgrtvrtrt rtrtb brt tyuhjghj hbhbnh hnjm 1234567?
|
|
|
|
|
|
thanks,
but not the volume serial number on the partition.
i mean the fabric serial number on the phisical hard drive.
were rgrtgrtvrtrt rtrtb brt tyuhjghj hbhbnh hnjm 1234567?
|
|
|
|
|
|
Hi,
I have maid a ATL Modeless DialogBox for an add in in VS.NET and I have some problems with backspace end Delete keys: when I use my dialog Box and if I have opened some file before, I can enter text in the edit boxes but if I use the backspace key, I will erase text in my files not in the dialog box!
How can I set the focus on my dialog box for these key inputs?
|
|
|
|
|
Is there any method where message translation takes place in the addin?
P.R.A.K.A.S.H
|
|
|
|
|
No, there is no message translation in the Add in.
|
|
|
|
|
the message is send to the ide instaed of the edit control. that is the problem.
P.R.A.K.A.S.H
|
|
|
|
|
ok, i kind of understood that but how can i send these key messages to the dialog box instead of the ide?
|
|
|
|
|
You cant do that, unless you have to tranlatate the message before it is given to the ide.. I had similar problem with namespace extension, But there was a translate message method that i had to interpret before it is send to the browser. So i could solve the prob.
In your case you dont have the control, or you have it,but not aware of it.
thats all i can say about it.
P.R.A.K.A.S.H
|
|
|
|
|
I writen some program myself...
But people do not want to sent even opinion as a feedback.
I have heard that there is some servers with registration service,
for programs,
or separately providing pay service.
I do not know how to do it, due to I developer.
I developed new program, need opinion,
can you advice - does it seems worth for you?
samples:
http://microsoft111.tripod.com/Music/GetSoft.htm
(beta eval)
http://microsoft111.tripod.com/Music/TransDial_e.htm
(free or 1 doll by desire of donate)
thanks you.
|
|
|
|