|
Is that so
Then how can I display line numbers in my document? My view class is derived from CRichEditView.
Any suggestions?
Thanks for da reply
sandakith
|
|
|
|
|
There are a few ways to do it. First, you could manually draw line numbers into the selection margin (or a shorten the width of the control). If you are dealing with a read-only document (read-only as far as the user is concerned), you could manually insert line numbers before the document is rendered.
Or you could use a control like Scintilla or the "Crystal editor", which both support line numbers natively, I believe. Projects/Articles exist that demonstrate both, I believe (search for 'em).
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Tip for new SUV drivers: Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
default protocol of web-site is http://
are there other protocols for web-files?
if yes, could you give me an sample and a link (web address which does not start with http://)
thx
includeh10
|
|
|
|
|
includeh10 wrote: default protocol of web-site is http://
are there other protocols for web-files?
Yes Default protocol is HTTP:// but you can also use https:// to access file tooo
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
includeh10 wrote: if yes, could you give me an sample and a link (web address which does not start with http://)
Gopher or FTP
Developed at the UofM (University of Minnesota) it as memory serves predates (slightly) http. The last (UofM) gopher website was taken down about a year ago.
Wiki link
Gopher_protocol[^]
There are a few other protocals but http dominates.
DEBUGGING : Removing the needles from the haystack.
-- modified at 6:09 Wednesday 9th November, 2005
|
|
|
|
|
do all web-sites support Http connection?
i.e. code bellow
//============================
CInternetSession sess;
......
CHttpConnection*pHttp=sess.GetHttpConnection(...);
//============================
can be applied to all web-sites?
if not, why not?
thx.
includeh10
|
|
|
|
|
includeh10 wrote: can be applied to all web-sites?
Yes, Just have a try!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Hi! People!
Anybody knows how to hide toolbar, menubar, controlbar and statusbar?
Can I use ShowWindow to hide this items and what other ways can I use.
Thanks for the help.
|
|
|
|
|
You can use ShowWindow with any window handle, but what window do you need to hide these items?
|
|
|
|
|
I have trouble displaying text that is in shift-jis, is there something special that i have to do to display it correctly?
Also is it possible to display an unsigned char into a textbox without casting it as a char?
|
|
|
|
|
Hi. This is not a Visual C++ question. Also, it'd be great if it worked under ANSI C.
In this function I'm writing, strings start to come up and need to be saved on a big char* one next to the other, say:
"yellow", "one", "banana" -> "yellowonebanana"
thing is that final length is unknown, it could be 1000b as well as it could be 0b. so I looked it up from Google and only solution found was to do the algorythm twice, where in the first one I calculate length, then malloc, then do again and start storing.
Is there any way to allocate and resize allocation dynamically?
Thx in advance. Mariano Lopez-Gappa.
|
|
|
|
|
|
realloc works just fine. However, it is best if you use some type of doubling algorithm on the buffer size. Thus you reduce the number of reallocations.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
You could create a file on the local drive and store as much as the drive would hold. There would be no need for any memory allocation or re-allocation. If you don't need speed, its an option.
|
|
|
|
|
Many thanks to all 3 answers. I'm gonna go for the realloc as it looks like it fits best my needs. Speed is not really an issue but I can't use disk. Thanks again. Case closed.
|
|
|
|
|
Can't you do this:
1. Read in the string to a temporary max-length memory location.
2. Allocate the strings' memory using the strlen() function.
3. Use strcpy() to move the string into it's position
4. Repeat steps 1-3 until you are done
5. Deallocate the temporary string.
That's the easiest way I can I see doing it straight-forward and using only ANSI-C commands.
|
|
|
|
|
Mariano Lopez-Gappa wrote: thing is that final length is unknown, it could be 1000b as well as it could be 0b.
Is that the only difference? Memory is cheap these days. Unless you are talking about several MB of allocations, just allocate 1KB for each instance and be done with it. Yes, there might be some waste here and there, but that's a whole lot more efficient than reallocating memory.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
LOL. I misread. If he is only talking about 1000b > a > 0b, then I agree with you. Start with a large 1000b buffer. If you run out of room, double the size and try again. When done, return a new allocated buffer of the final size (not a required step if memory isn't an issue).
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Hi,
I am using the try catch in my DLL. When i run the application in debug build it is catching the exception but application couldn't crash. When i dp the same thing in release build my application crashed inside the catch block because i am logging all the error. Can you please help me to find out the reason behind this.
catch ( _com_error &e )
{
if (e.ErrorInfo())
{
TCHAR logmsg[200];
_stprintf( logmsg, _T("Error: %lx"), e.Error() );
TGTTRACE(llItemMedium, lLogError, L"Query Data Failed - %s", logmsg);
}
return E_DATA;
}
It is crashing at return E_DATA.
Thanks
-- modified at 17:34 Tuesday 8th November, 2005
|
|
|
|
|
what are those first two parameters for TRACE ?
(ok. now you've changed your code)
Cleek | Image Toolkits | Thumbnail maker
-- modified at 20:59 Tuesday 8th November, 2005
|
|
|
|
|
that is for logging purpose related to the severity.
|
|
|
|
|
i assumed that much. but TRACE, as i know it, starts off with a strng pointer, and then a variable number of parameters. it doesn't take two parameters and then a format string and then the varargs.
Cleek | Image Toolkits | Thumbnail maker
|
|
|
|
|
Try this instead:
CString strLogMsg;
strLogMsg.Format(_T("Query Data Failed - Error: %lx"), e.Error());
TRACE(strLogMsg);
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
I can't use the MFC class
|
|
|
|
|
Are you sure that logmsg is large enough?
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|