|
At the top of the MainFrm.cpp, you probably need something like:
#include "MainFrm.h"
#include "MySDIDoc.h"
#include "LeftPaneView.h"
#include "RightPaneView.h"
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
when I do this, I get the error I described above (please, see it in the third message in this thread)
|
|
|
|
|
The compiler is telling you that CMySDIDoc is being referenced before it has been declared.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
I added
#include "MySDIDoc.h"
to the MySDIView.h file and it solved the problem.
Thank you!!!
|
|
|
|
|
I'm using a CHtmlView control and I want to store the content displayed in the control in a CString object or as a string. How do I go about it?
Thanks in advance,
Vikram.
Shameless plug: http://www.geocities.com/vpunathambekar
"And above all, watch with glittering eyes the world around you because the greatest secrets are always hidden in the most unlikely places. Those who don't believe in magic will never find it." - Roald Dahl.
Mrs. Schroedinger: "Erwin, what have you been doing to the cat? It looks half-dead!"
|
|
|
|
|
|
How?
I get an error saying GetSource is not a member of this class. And MSDN says GetSource belongs to IErrorInfo.
Am I completely missing the point?
Vikram.
Shameless plug: http://www.geocities.com/vpunathambekar
"And above all, watch with glittering eyes the world around you because the greatest secrets are always hidden in the most unlikely places. Those who don't believe in magic will never find it." - Roald Dahl.
Mrs. Schroedinger: "Erwin, what have you been doing to the cat? It looks half-dead!"
|
|
|
|
|
Sorry, they added that API in VC7. This[^] link may help. Unfortunately Ehsan's articles[^] aren't available because the site is currently down.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Alright, I tried it under VS.net 2002 and it works. Would there be a way of getting the text alone, without the tags?
I could strip out the tags, but just want to know if there's an easier way out.
Vikram.
Shameless plug: http://www.geocities.com/vpunathambekar
"And above all, watch with glittering eyes the world around you because the greatest secrets are always hidden in the most unlikely places. Those who don't believe in magic will never find it." - Roald Dahl.
Mrs. Schroedinger: "Erwin, what have you been doing to the cat? It looks half-dead!"
|
|
|
|
|
If you decide to strip the tags, there's a removeHtml() API in this[^] article that you may want to use.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Re: chatting, check your email. Yahoo web messenger is hopelessly broken.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Ravi Bhavnani wrote:
Re: chatting, check your email. Yahoo web messenger is hopelessly broken.
I wasn't able to get YM to connect.
Vikram.
Shameless plug: http://www.geocities.com/vpunathambekar
"And above all, watch with glittering eyes the world around you because the greatest secrets are always hidden in the most unlikely places. Those who don't believe in magic will never find it." - Roald Dahl.
Mrs. Schroedinger: "Erwin, what have you been doing to the cat? It looks half-dead!"
|
|
|
|
|
Vikram, I'm also reachable on AIM (see your email).
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
You can call GetHtmlDocument() , which returns a pointer to a IHTMLDocument .
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Hi, I am trying to write/read a large vector of vector of doubles to comma delimited text file using std::ofstream. The problem is that it doesn't seem to be very fast, taking a few minutes at a time.
The matrix to be written/read is of the size N x M, where N is approx. 2,000 and M is between 1,000 and 40,000. That means a file size of up to approx. 800Mb for M == 40,000.
Should I consider serialization as something that might be faster?
At the moment I am not doing anything complicated, below is my code for writing the 'spreads' matrix to file (removed conditional error checks, etc):
ofstream write_file;
write_file.open(fileName.c_str(), ios_base::out | ios_base::trunc );
int numRows = spreads.size();
int numCols = spreads[0].size();
for (int row = 0; row < numRows; row++)
{
for (int col = 0; col < numCols; col++)
{
write_file << "," << spreads[row][col];
}
write_file << endl;
}
write_file.close();
When reading it in I do much the same thing, reading in the file line by line and using a split string algorithm to extract each row of doubles, building up the matrix of doubles.
The CPU is at 100% at all times when this is run, so it's not slow file I/O that's the problem.
Any suggestions would be appreciated.
Thanks,
Christopher
The bomb lives only as it is falling
|
|
|
|
|
One solution is the STL's copy() algorithm and ostream_iterator.
Kuphryn
|
|
|
|
|
copy() works, but i still need to do it row by row. it turns out to be only marginally faster for 1900 rows and 10000 columns. It takes 91 seconds to write this matrix to file using copy() and 95 seconds using a raw loop.
was considering writing the raw byte in memory representation of the matrix to file using the Win32 API WriteFile(). i don't know how wise that would be, or how to do it properly though.
christopher
The bomb lives only as it is falling
|
|
|
|
|
I had a similar problem, when I read a large vector from ifstream via STL.
It's a sad disadvantage of STL - it's too generic to be efficient. For example the stl::copy of vectors is implemented as a cycle, which applies copy constructor to each member of the vector. If you have a vector of complex objects with nontrivial copy constructors, this approach is fair. But if you have for a vector of int 's or char 's, the STL implementation is too much slower than a simple memcpy .
I think, that std::vector is internally stored as a continuous array of objects, so the iterators to the first and last members should be pointers to begin and end of a memory block, where the array is stored. Thus using of CFile::Write is simple.
Reading a vector is more complex, I think, that you should write your own allocator, which builds a vector from a memory block. But it's only my opinion, I've never write any allocator
The general solution would be to write a STL extension with containers optimized for special member types. Do anybody know, whether such a library exists?
Robert-Antonio
Love, truth and electric traction must gain victory over hate, lie
and diesel traction.
|
|
|
|
|
I have some code that retrieves simple URL's as follows,
DWORD nStatus = NULL;
CHttpFile* pFile = NULL;
CHttpConnection* pConn = NULL;
CInternetSession ISess;
pConn = ISess.GetHttpConnection(sz_Server);
pFile = pConn->OpenRequest(CHttpConnection::HTTP_VERB_GET, sz_ServiceURL);
pFile->SendRequest();
pFile->QueryInfoStatusCode(nStatus);
if ( nStatus == HTTP_STATUS_OK )
{
CString strBuff;
CString strRead;
while ( pFile->ReadString(strRead) )
{
strBuff += strRead;
}
cout << (LPCTSTR)strBuff << endl;
}
I would like to remove the looping reading and replace it with a single read. But I'm not able to figure out how big a buffer to allocate. Is there some method of the CHttpFile class that I could use that would give me the amount of data to expect. I've tried the GetLength method, but this is not returning the correct value. Thanks.
Chris Meech
We're more like a hobbiest in a Home Depot drooling at all the shiny power tools, rather than a craftsman that makes the chair to an exacting level of comfort by measuring the customer's butt. Marc Clifton
VB is like a toolbox, in the hands of a craftsman, you can end up with some amazing stuff, but without the skills to use it right you end up with Homer Simpson's attempt at building a barbeque or his attempt at a Spice rack. Michael P. Butler
|
|
|
|
|
I have an application developed on Win2K. The problem that I am experiencing with my application has to do with the non-client area(title bar). My application changes the color of the background of the title bar. So, I have to redraw the min/max/close buttons. On Win2K, everything seems to work ok, but I have noticed that when I run my application on Windows XP(with theme enabled), my min/max/close buttons are off. The buttons are bigger, but the hit tests are off(obviously). How do I detect themes enabled for an application developed on Win2k(without uxtheme.dll/.lib/.h etc)?
The CaptionPainter class that I am using is from the following link:
www.codeproject.com/dialog/gradienttitlebar.asp
|
|
|
|
|
|
Mike,
Thanks for the reply, but I am constrained to Win2k development. SetWindowTheme doesn't come with Studio 6.0 libs. Maybe platform SDKs?
|
|
|
|
|
It doesn't matter what OS you use for development, you can call any API you want. BUt yes, you'll need the Platform SDK to get the lastest header files.
--Mike--
Personal stuff:: Ericahist | Homepage
Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt
CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ
----
Pinky, are you pondering what I'm pondering?
I think so Brain, but if we shaved our heads, we'd look like weasels!
|
|
|
|
|
Mike,
Hey thanks for the reply - I have since brought in the header file for UxTheme.h, but am getting a link error now. I have tried bringing in UxTheme.dll and linking against that, but it has a dependency on the newest Ntdll.dll. The Ntdll.dll has other dependencies as well. So, what else do I need to bring into my Win2K Studio environment to get this to compile?
Thanks,
Bob
|
|
|
|
|