|
Absolutely - an ifstream will read your file in no worries, and then you can just set up your editor to contain the data read in.
something like
std::ifstream a(szFilename);
std::string s;
while (getline(a, s))
MyInternalBuffer += s.c_str();
You need to include string and fstream for this to work.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
How do I set up the editor to contain the data? that is where i am having problems. I have no problem reading the data into the buffer.
I thought maybe I could
CMyDoc* pdoc;
pdoc.OpenFile( CString path );
I have searched my books on Doc/View architecture. I am sure the answer is there but I don't see it.
Thank You
|
|
|
|
|
kjessee wrote:
How do I set up the editor to contain the data?
Oh - the problem is not loading, it's actually having the text in the editor ? There are many ways to go about this, the simplest is to use a CEditView ( from memory ) and call SetWindowText on it.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
Has anybody tried to put a bitmap background on a CRichEditView?
I've tried to use GetRichEditCtrl().ModifyEx (0, WS_EX_TRANSPARENT) and it did give me a transparent background CRichEditCtrl. However, I can't paint the background of the view!
How come ON_WM_ERASEBKGND message is NOT sent to the CRichEditView?
Any help will be appreciated.
Thanks,
Duc Truong
In programming you can do anything (by Paul DiLascia)
In programming you can do anything (by Paul DiLascia)
|
|
|
|
|
Hi.
I am very close to finishing an IOCP Winsock program. However, there is one major bug that I have not been able to debug and determine a working solution. One reason is the fact that I do not know what causes this bug. Note that this now the only bug or at least the only one that Visual C++ Debugger finds.
Here is the message from the debugger.
-----
HEAP[Program.exe]: HEAP: Free Heap block 36a9c8 modified at 36a9f4 after it was freed
Unhandled exception at 0x77f7f570 in Program.exe: User breakpoint.
-----
I notice that the program crashes and Visual C++ Debugger outputs this message only when the IOCP handles multiple sockets. I do not have an accurate count, but I believe ten or more sockets will cause the program to crash. To my understand, IOCP can handle thousands of sockets. In fact, a working WSAAsyncSelect I/O model of this same program works great under hundreds of sockets at any given time.
In terms of IOCP, what could be some causes of this heap problem?
Thanks,
Kuphryn
|
|
|
|
|
It seems that the problems you have do not have anything to do with IOCP. It appears to be a buffer overrun or, more probable, calling delete two times on the same pointer.
lazy isn't my middle name.. its my first.. people just keep calling me Mel cause that's what they put on my drivers license. - Mel Feik
|
|
|
|
|
Good point. Thanks.
I will check all pointers and allocations and deallocations.
Kuphryn
|
|
|
|
|
Data that exists in CTreeCtrl and can be got by GetItemData is for what ? Is handle of each tree Item not enough? ( HTREEITEM)When should I use GetItemData ?
|
|
|
|
|
Anonymous wrote:
When should I use GetItemData ?
you should use GetItemData when you've already used SetItemData to put set data into the item. it's just a place for you to store something.
-c
“losinger is a colorizing text edit control”
-- googlism
|
|
|
|
|
How can I put transparent image on Edit control or List control ..?
like MSN messanger..
Thanks for reading.
|
|
|
|
|
The list control supports background images. See the docs for LVM_SETBKIMAGE
--Mike--
"I'd rather you just give me a fish today, because even if you teach me how to fish, I won't do it. I'm lazy." -- Nish
Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Hello everyone,
I am writing a http server, and I can not make the decision whether using blocking socket or noblocking socket. Not long ago I finished a trial edtion with nonblocking socket in a single thread, but I found it is not very efficient, so I am rewriting it using multithreading mode. I puzzle about which kind of socket get a better efficiency.
Who has the experience please give me some advices, my server will transmit about 150kb per response, and I can not identify the amount of responses per second, my server will run at a 100M network.
thanks.
Kerry Chou from STU
|
|
|
|
|
The best performance will be achieved by using from 1 to 4 threads per processor, and Overlapped I/O for transmitting dynamically generated pages.
But if what you need is a high-performance file transfer for your HTTP server, you could use the TransmitFile API function. It has the best sustained data trasnfer rate available.
lazy isn't my middle name.. its my first.. people just keep calling me Mel cause that's what they put on my drivers license. - Mel Feik
|
|
|
|
|
Oh, and I almost forgot: this article[^] can be great for you!
lazy isn't my middle name.. its my first.. people just keep calling me Mel cause that's what they put on my drivers license. - Mel Feik
|
|
|
|
|
Thanks, Daniel, your information is valuable
Kerry Chou
|
|
|
|
|
whats interop?how it is used to get process id?
r00d0034@yahoo.com
|
|
|
|
|
Hi!
How can I make to establish a connection in a peer to peer network?,
//On Server
CSocket p;
p.Create
p.Listen
CSocket o;
p.Accept( o );
//On Client
CSocket p;
p.Create
p.Connect
Is that correct ?, any line of sequence fails??,
Tank you!
|
|
|
|
|
Does anyone know why my CComboEx on a dialog, which has images on it, doesnt work right? You can scroll through all of it's contents with the arrow keys, but when you try to use the mouse to click the little down arrow to make the options drop-down nothing happens? Thanks...
-Ken Mazaika
|
|
|
|
|
have you sized the drop-down space on the resource editor? the default is a drop down of zero-height (i don't know why).
-c
“losinger is a colorizing text edit control”
-- googlism
|
|
|
|
|
*grin* A friend asked me to look at his code three times over 2 days once before I suddenly remembered that little quirk.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
What's is the equivalent function for IPv4 inet_addr for using with IPv6 address ?!?! Using VC++ and Winsock 2 in Windows XP Pro.
I read about WSAStringToAddress, but not working so well !!
I Hope someone can help.
Thank's....
"Fear is the first step for knowledge !!"
|
|
|
|
|
getaddrinfo()
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
how getaddrinfo can be used, for converting IPv6 IP to Network byte order
|
|
|
|
|
Hi all,
I want to distribute my client app. (that consumes a web service) to Win98/2000/XP, and I don't want to have to include the .NET install, so I guess C# is out.
What tool could I use to consume the web service? (i.e. SOAP Toolkit)
Do you have to distribute extra files if you code the client in VC7?
If I developed the client in VC6(MFC), I shouldn't have to distribute exta files on Win98/2000/XP, correct?
Thanks in Advance.
Soliant | email
"The 'B' in Visual Basic means Beginner" - R. Bischoff
|
|
|
|
|
This[^] article may help if you're looking for a simple yet effective way to consume a web resource.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|