|
Additionally, this code is only a rudimentary version of what you want. You should also check the stream state, create an instance of an object whose name escapes me right now to take care of prefix and postfix operations, and also if you want formatting to work with this object, you should stream the data to an ostringstream first and pass it to the ostream all in one operation.
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Picture the daffodil. And while you do that, I'll be over here going through your stuff.
|
|
|
|
|
This code would be a lot faster if you had a grow policy instead of copying the whole array every time you add 1 element. It would also probably be faster to use memcpy to copy the old array into the new one. Also, you should use the prefix ++ operator whenever you don't actually need the postfix one.
The line 'investorsList = temp' makes both point to the same list, which you then call delete on at the end. So investorsList then points to an array that has been deleted.
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Picture the daffodil. And while you do that, I'll be over here going through your stuff.
|
|
|
|
|
dude, how did you manage to screw up the indentation that much?
Anyway, the code looks fine to me (you should uncomment delete [] investorsList; , and you really don't need a temporary array, but that shouldn't hurt it for now). Things unknown: is numOfInvestors being properly initialized? And what effect does insertionSort() have (is this a library funtion? i don't recognize i'm afraid...)?
farewell goodnight last one out turn out the lights Smashing Pumpkins, Tales of a Scorched Earth
|
|
|
|
|
He must have found it - he deleted the question...
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Picture the daffodil. And while you do that, I'll be over here going through your stuff.
|
|
|
|
|
That's good. My answer looks less wrong this way
farewell goodnight last one out turn out the lights Smashing Pumpkins, Tales of a Scorched Earth
|
|
|
|
|
|
It's kind of annoying for people to come along and read the answers but not the question. If you leave your question up, it means others can benefit from it, even if you found the answer.
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Picture the daffodil. And while you do that, I'll be over here going through your stuff.
|
|
|
|
|
ok sorry about that Christian!
i will never do it again!
|
|
|
|
|
Let's say I do I search for schools on yahoo. How can I click the
next button on yahoo to continue searching for schools? I want
to store the schools I find and continue searching? Any ideas?
|
|
|
|
|
If the system uses querystrings, you could devise an app to pass the data to the server automatically be altering the querystring variables each time.
Simon
"The more I learn, the more I realize I don't know" - Colin Davies
Sonork ID 100.10024
|
|
|
|
|
write your own search engine in perl (about 5 lines)
|
|
|
|
|
I have tried the CTrayNotifyIcon in a fresh skeleton mdi app and the icon in the system tray appears as well
as the task bar which is not correct.
Has anyone either
[1] - got it to work correctly with an mdi app
or
[2] - experienced the same problems
I just want to get it going quickly.
|
|
|
|
|
CTrayNotifyIcon is only for adding the icon. If you dont want your app to show on the task bar you'd have to use your own techniques to avoid that.
Nish
Nish was here, now Nish has gone;
He left his soul, to turn you on;
Those who knew Nish, knew him well;
Those who didn't, can go to hell.
I like to on the Code Project
Sonork ID 100.9786 voidmain
www.busterboy.org
|
|
|
|
|
... like ShowWindow(SW_HIDE) on the CMainFrame based class.
Sorry to dissapoint you all with my lack of a witty or poignant signature.
|
|
|
|
|
Hi,
In my application. I have a combobox.
But some items names are too long to be completly displayed.
Is it a way to display the full string, regardless of the CombBox width ?
I mean the drop down window should be greater than the width of the combobox itself.
Thanks,
Stephane
Stephane
www.exotk.org
|
|
|
|
|
Find the width of the longest string in pixels. Add the width of the borders (use GetSystemMetrics(SM_CXEDGE)*2 ) & then use SetDroppedWidth() (MFC) to set the dropdown width.
farewell goodnight last one out turn out the lights Smashing Pumpkins, Tales of a Scorched Earth
|
|
|
|
|
You could probably adapt one of the many Tool Tip classes to do the job.
Sorry to dissapoint you all with my lack of a witty or poignant signature.
|
|
|
|
|
Hi,
I am currently learning VC++ and MFC. I use Visual Studio 6 Enterprise and Sams: Teach Yourself Visual C++ 6 in 21 Days. I was wondering if it was worth it to save money and buy a standalone VC++.Net. Would I have many things that could be usefull to me, and my big question: Do the looks of the apps that you create with .Net look like Office XP Automatically.
// JS Paquet
cout << "Thank you all" << endl;
|
|
|
|
|
No, to do that you need to get a library like the Xtreme Toolkit ( www,codejock.com ).
The good news is it works with VC6 and is a LOT cheaper than .NET
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Picture the daffodil. And while you do that, I'll be over here going through your stuff.
|
|
|
|
|
i have just installed the .net framework on my PC. I had expected it to add a project type, or controls, or something, but as yet i cannot see what the installation has done other than take up my harddrive space.
Can someone enlighten me please?
==================================================
When Your Mind Wonders...Where Does It Go???
|
|
|
|
|
Is that the free download SDK? That one is commandline only.
/moliate
|
|
|
|
|
Unless me means the runtime libraries...
Simon
"The more I learn, the more I realize I don't know" - Colin Davies
Sonork ID 100.10024
|
|
|
|
|
Framework is just the redistributable.
The SDK has your basic tools.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
It installs all required stuff to build and run .NET code.
You now have command line compilers for MC++., C# and VB. NET
Nish
Nish was here, now Nish has gone;
He left his soul, to turn you on;
Those who knew Nish, knew him well;
Those who didn't, can go to hell.
I like to on the Code Project
Sonork ID 100.9786 voidmain
www.busterboy.org
|
|
|
|
|
Ive gotten this much. Its a dialog app, I dont know if that matters.
void CCursorCreatorDlg::OnFileSave()
{
CFileDialog fileDlg(FALSE, NULL, "Untitled",
OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
"Some Files(*.fil)|*.fil||",
NULL );
fileDlg.m_ofn.lpstrDefExt = "cur";
if( fileDlg.DoModal()==IDOK )
{
CString fileName;
fileName = fileDlg.GetPathName();
CFile file( fileName, CFile::modeReadWrite | CFile::modeCreate );
CArchive ar( &file, CArchive::store );
Serialize( ar );
}
}
void CCursorCreatorDlg::OnFileOpen()
{
CFileDialog fileDlg(TRUE, NULL, NULL,
OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
"Some Files(*.fil)|*.fil||",
NULL );
if( fileDlg.DoModal()==IDOK )
{
CString fileName;
fileName = fileDlg.GetPathName();
CFile file(fileName, CFile::modeReadWrite | CFile::modeCreate );
CArchive ar( &file, CArchive::load );
Serialize( ar );
}
}
void CCursorCreatorDlg::Serialize(CArchive& ar)
{
if (ar.IsStoring())
{
ar << someVariable;
}
else
{
ar >> someVariable;
}
}
I have the DECLARE_SERIAL and IMPLEMENT_SERIAL macros where they should be.
When I save, it seems to work fine. However, when I open, it works until it gets to the serialize function where a messagebox pops up and says "An attempt was made to access an unnamed file past its end." What's that mean and how do I fix it?
-Raffi
The truth about C++
|
|
|
|