|
MFC containers suck. Use std::map and you won't have any trouble.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
And you don't spend much time with the opposite sex working day and night, unless the pizza delivery person happens to be young, cute, single and female. I can assure you, I've consumed more than a programmer's allotment of pizza, and these conditions have never aligned. - Christopher Duncan - 18/04/2002
|
|
|
|
|
Could you be more specific please?
Is it that they are not fast enough?
Best regards,
Alexandru Savescu
|
|
|
|
|
No support for algorithms, no easy compatibility with other containers, not standard, written only as a stopgap prior to STL, never intended to replace it.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
And you don't spend much time with the opposite sex working day and night, unless the pizza delivery person happens to be young, cute, single and female. I can assure you, I've consumed more than a programmer's allotment of pizza, and these conditions have never aligned. - Christopher Duncan - 18/04/2002
|
|
|
|
|
Can someone share a sample of code that deletes a file when the path is known. Thanks for any help.
Kyle
|
|
|
|
|
I'm surprised you didn't find DeleteFile yourself.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Me too! Being new to C++ I searched for "delete file" on this site and when I didn't find a clear answer I asked the silly question. I should have tried the on-line help first. Please accept my apology.
Kyle
|
|
|
|
|
Excuse my being too ironic. You don't have to apologize for anything at all, this is a free forum Regards.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Joaquin, you are very hard with that Guy...
He only wants to knows how to use the DeleteFile function...
if(DeleteFile("C:\\MyPath\\File.tmp"))
AfxMessageBox("The file was deleted...");
Best Regards
Carlos Antollini.
www.wanakostudios.com
Sonork ID 100.10529 cantollini
|
|
|
|
|
Hello
I want to put a paragraph of text into a char buffer, but I am not allowed to wrap the text onto a new line. Does anyone know how I can over come this
char buf[2000] = "text text text text text
text text text text text
text text text text text text text";
error C2001: newline in constant
error C2146: syntax error : missing ';' before identifier 'text'
error C2065: 'text' : undeclared identifier
error C2146: syntax error : missing ';' before identifier 'text'
...
|
|
|
|
|
char buf[2000] = "text text text text text "
"text text text text text "
"text text text text text text text";
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
You should be able to do this:
char buf[2000] = "text text text text\
text text text text\
text text text";
No generalization is 100% true.
Not even this one.
|
|
|
|
|
If all you want to do is wrap your source file to keep everything nice and tidy, the answer has already been posted.
If you want to embed line breaks in your text, just replace each newline with the character sequence '\n', as in:
char buf[2000] = "text text text text text \n"
"text text text text text \n"
"text text text text text text text";
--------
I don't think that I'm a sell-out but I do "Enjoy Coke!"... -- Bloodhound Gang, The Inevitable Return Of The Great White Dope
|
|
|
|
|
In my Doc I have this:
struct ItemInfo
{
CString name;
CString catagory;
CString description;
}itemInfo;
Then in my View I have this:
CMyDoc* pDoc = GetDocument();
<br>
CString itemName = GetItemName();
<br>
pDoc->itemInfo.name = itemName;
But the program aborts when it reaches the last line of code, why?
-Raffi
|
|
|
|
|
Excuse me if I'm pointing the obvious, but have you checked that pDoc is !=NULL ? Apart from this, the way you're accessing itemInfo seems OK to me.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Did you accidently put the struct definition outside the public scope?
/moliate
Two o'clock and walking through familiar London - Or what was familiar London before the cursor deleted certain certainties -
I watch a suit and tie man giving suck to the Psion Organizer lodged in his breast pocket
its serial interface like a cool mouth hunting his chest for sustenance, familiar feeling, and I'm watching my breath steam in the air.
Neil Gaiman - Cold Colours
|
|
|
|
|
pDoc != NULL and the struct is public. Anyother possible problems?
-Raffi
|
|
|
|
|
Stop just before the offending line and inspect the contents of pDoc . Does it look OK (reasonable data)?
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
How do I see the contents of pDoc?
-Raffi
|
|
|
|
|
Insert a breakpoint at the offending line (F9), run the program, wait till it stops at your breakpoint, press SHIFT+F9 (I think) and type pDoc in the window that appears.
If you need more help about using the debuger, have a look at the documentation that comes with your VC++ --it shouldn't be hard to locate the section on debugging.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
It says pDoc is 0x00781ca0. Dose that look "OK"?
-Raffi
|
|
|
|
|
Man, use your brain. Inspect the contents of pDoc .
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
[quote]It says pDoc is 0x00781ca0. Dose that look "OK"? [/quote]
this is the memory location only!
|
|
|
|
|
Hi,
Im doing a small program in which I want to detect if the internet is being accessed by the user.
I have searched for this but with no luck
|
|
|
|
|
This article shows how to check if you're connected to the internet.
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
OK. I'm trying to open a file and red the last 128 bytes in it, but if it's the first time i read the file since the computer has been started, it only reads the first three chars. It's strange cause when i then open it right after i have opened it the first time, it works. here's the code:
int GetID3(char *szFile)
{
HANDLE hFile;
DWORD dwBytesRead;
DWORD dwFileSize;
OVERLAPPED FilePos;
OVERLAPPED *pFilePos = &FilePos;
hFile = CreateFile (szFile, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, NULL);
dwFileSize = GetFileSize(hFile, NULL);
pFilePos->Offset = dwFileSize - 128;
pFilePos->OffsetHigh = 0;
pFilePos->hEvent = 0;
gszID3Tag[0] = '\0';
ReadFile(hFile, gszID3Tag, 128, &dwBytesRead, pFilePos);
gszID3Tag[128] = '\0';
if (dwBytesRead != 128)
return 0;
else
return 1;
}
Can anyone help me?
Thankyou.
|
|
|
|