|
Enclose it in <code> tags, like this <code>some code</code>. If you have lots of code and not just keywords, do this;
<pre>
int main() {
printf("hello\n");
}
</pre>
Simon
<i>Hey, it looks like you're writing a letter!</i>
<font color="b30000">Sonork ID 100.10024</font>
|
|
|
|
|
heyyy cool, lolz
:laugh:
thanks
Kuniva
Want, take, have.
(oh btw, best way of learning some language is by looking at examples, start large!) :p
|
|
|
|
|
Can I use sql string?
whoi can show me how to do with it?
thank you for your help!
|
|
|
|
|
Hi there,
It depends how much data and what database you're using. With most databases there is support for a RAW type of data that lets you store huge amount of binary data in a record.
Usually strings (or VARCHAR in most cases) would not be such a good idea for more than a couple of kilo-bytes (limitations depend on the database vendor and the middleware used to access it)
HTH
Cheers,
Pierre
|
|
|
|
|
I use ACCESS,the data ia about 5~8M
|
|
|
|
|
ACCESS... Arggh
There is not much support for big chunks of Data with Access. Text is a no-no as it is limited to a stupid 255 characters.
There is the memo type but that's no good either as if I remember correctly it is limited to 64k
I think the only type you can use is OLE (which, if I remember correctly can store up to a Gig of data). Not sure if that's supported by all versions of Access, though.
HTH
Cheers,
Pierre
|
|
|
|
|
Pierre Heler-Caruel wrote:
With most databases there is support for a RAW type of data that lets you store huge amount of binary data in a record.
Some databases call the type for binary data "BLOB" (Binary Large OBject) instead of "RAW".
Pierre Heler-Caruel wrote:
Usually strings (or VARCHAR in most cases) would not be such a good idea for more than a couple of kilo-bytes
Strings are unsuitable for binary data independent of size, because the DBMS may do character-set conversions etc. if it thinks the data is a text string, and mangle your binary data.
|
|
|
|
|
Hi,
Has anyone any ideas why LineScroll() does not work in a subclassed edit box?
When inserting text and trying to scroll to the end, a carriage return is added to the top of the text and the caret goes to the second line.
It looks pretty much like this:
<snip>
CString Container("");
int nLines;
GetWindowText(Container);
Container += "\r\n" + strText;
SetWindowText(Container);
nLines = GetLineCount();
LineScroll(nLines);
<snip>
Cheers,
/Fredrik
Do you Sonork? I do! 100.11430 PhatBoy
|
|
|
|
|
Hmmm... Will LineScroll(...) work of you do not have a scrollbar visible? If you are trying to "get to the end" of the text, why not use SetSel(...) to move the caret to the end of the text?
Or am I just missing what you are trying to do?
BTW: try not to use "" to represent an empty string with dealing with CStrings, use afxEmptyString instead. And, you do not need to initialize a CString with an empty string. It constructs to an empty string by default. (Initializing it with an empty string just wastes time.)
-=- James.
|
|
|
|
|
Well, the scrollbar is visible, and I am indeed trying to scroll to the last line of the box. I tried to use SetSel(), but then the text disappears... Using LineScroll() works with a non-subclassed edit box.
I have written handlers for OnChar(), OnKeyDown() and OnRButtonDown() in the subclassed version. Could that cause any trouble?
Cheers,
/Fredrik
Do you Sonork? I do! 100.11430 PhatBoy
|
|
|
|
|
> I have written handlers for OnChar(), OnKeyDown() and
> OnRButtonDown() in the subclassed version. Could that
> cause any trouble?
I would not think so. And what do you mean by "the text dissa[ears" when you use SetSel(...)?
-=- James.
|
|
|
|
|
James R. Twine wrote:
I would not think so. And what do you mean by "the text disappears" when you use SetSel(...)?
The text that is entered in the edit box disappears.
It is not visible, and it can't be retrieved with GetWindowText().
Cheers,
/Fredrik
Do you Sonork? I do! 100.11430 PhatBoy
|
|
|
|
|
I realized if have been a bit unclear ; what I am doing is that I have subclassed an edit box and added an OnChar handler. The OnChar handler adds text and scrolls to the bottom.
Looks something like this:
void CMySubclassedEdit::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
{
 CString strText("Text\r\n>");
 CString Container;
 int nLines;
 if (nChar == 0x0D)
 {
   GetWindowText(Container);
   Container += "\r\n" + strText;
   SetWindowText(Container);
   nLines = GetLineCount();
   LineScroll(nLines);
 }
 CEdit::OnChar(nChar, nRepCnt, nFlags);
}
Cheers,
/Fredrik
Do you Sonork? I do! 100.11430 PhatBoy
|
|
|
|
|
>> The text that is entered in the edit box disappears.
>> It is not visible, and it can't be retrieved with GetWindowText().
If you are using the above code, and the text dissapears when you use SetSel(...), it might be due to the fact that your call to SetSel is incorrect, and is selecting the entire control. Then, the base CEdit::OnChar(...) gets called, which will replace the selection with whatever character was entered (a CR or LF); the result: no text in the control.
Also, in the above code, "nLines" is not initialized. That might result in some strange scrolling effects.
Lastly, if all you want to do is add a CRLF and some text to an edit control, the easiest (and faster than the code you posted) is to do a CEdit::SetSel(...) to get to the end of the control, and then call CEdit::ReplaceSel(...) with the text you want to add to the control. And since pasting normally moves the caret to the end of the pastes text, you will still be at the end of the edit control's text.
Peace!
-=- James.
|
|
|
|
|
James R. Twine wrote:
>If you are using the above code, and the text dissapears when you use SetSel(...), >it might be due to the fact that your call to SetSel is incorrect, and is selecting the entire control. >Then, the base CEdit::OnChar(...) gets called, >which will replace the selection with whatever character was entered (a CR or LF); >the result: no text in the control.
Ah, right you are.
It works if I remove the selection afterwards, naturally.
Thank you for the help, much appreciated!
Cheers,
/Fredrik
Do you Sonork? I do! 100.11430:PhatBoy
|
|
|
|
|
Hi All,
How will get all the machine name which are corrently connected in a network?
Sangeetha
|
|
|
|
|
Hi!
How can I create a tab control like the ones used in VC++, Office, Homesite etc. for switching documents. It's upside-down and the selected one is generally in white.
Thanks
/ mike
|
|
|
|
|
|
Thanks! How could I've missed that one?
/ mike
|
|
|
|
|
Hi All,
Is there any way to change the background color of a TextBox and the text Color?
Thanks in Advance.
Sangeetha
|
|
|
|
|
|
You can also check http://www.codeproject.com/editctrl/enhfocusedit.asp. Not meant to be a self-plug, but I really do not see the need for (1) a potential dynamic memory allocation whenever a paint cycle happens, or (2) the need to draw the text yourself...
You can just handle the correct messages, and let Windows do all of the work for you. Functions of interest in the code are CFocusEditCtrl::CtlColor(...) and CFocusEditCtrl::OnEraseBkgnd(...). The code also handles Disabled and Read-Only edit controls.
-=- James.
|
|
|
|
|
Season greetings to all .
In my MFC-app I have a logon-dialog that presents the user with a list-box to select between (hardcoded) odbc-connections.
My question is: Is there a way to list the defined obdc-connections in this list-box instead of whichever is hard-coded?
HarryS - Norway
|
|
|
|
|
use SQLDataSources and SQLDrivers to enumerate data sources and odbc drivers via code
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
How would I get the list of offline and online users into list boxes in my program if I wanted to make an MSN messanger client with more features than what MSN has at the moment?
Are there any resources people can tell me about using the MSN commands like Block Sender, etc etc??
Thanks
Ashman
www.settlers.net
|
|
|
|