|
I explained to you why that is above, and also explained why including iostream.h, iomanip.h, etc. is plain wrong.
I don't use C functions, because I prefer C++, but I believe that stdlib.h and time.h are also deprecated, in favour of cstdlib.h and ctime.h.
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
|
|
|
|
|
Do you know the escape sequence in C/C++. For example: \0, \n, \a, \r, \t, \\, or %%, etc. ??
HTML has such thing, too! Now follow my step-by-step...
1) Open(create) a new file with the notepad.exe.
2) Type such things
&*#*0*6*0*S*T*D*I*O*.*H*&*#*0*6*2*
3) Save this document in a name, like "WebDoc.txt". Do not close this document.
4) Use the replace tool (Ctrl+H), replace all the * with nothing (Not ask you to put a lot this word 'nothing's, just delete all * symbols.)
5) Save this document again, close it, and rename it as WebDoc.htm.
6) You see the icon of the file becomes a web document.
7) Open this document with your browser (IE or some other one...).
8) You now see this:
<STDIO.H>
Maxwell Chen
People say "No news is good news". Then, no code is good code!?
|
|
|
|
|
Hi,
I have a DDE server running on a Windows 98 plattform.
A DDE client , executed by IIS (internet Information Server), communictes with it and everything is OK. Both, client and server uses ddeml. When I try to do the same on WinNT or Windows 2000 I have the following problem: the DDE client , executed by IIS, attempts to communicate with the DDE server but, the server never receives the message. But, when I run the DDE client from the shell (on NT or 2000), again, everything is right. The client sends the message and the server receives it. The DDEspy reports DDE activities when the client is executed from shell, but when it is called for the IIS, DDEspy doesnt report DDE activity.
Could anybody help me?
Valeria león
|
|
|
|
|
Probably a security problem. The client and the server are probably running on different desktops and thus don't see each other.
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?
|
|
|
|
|
Hi,
Both applications: DDE client and DDE server are running in https/cgi-win. If they are in different desktops, how can I solve this? On Windows 2000, my system file is FAT.
TANK YOU.
Valeria León
|
|
|
|
|
I have created this dialog based application consisting of several pages (property pages) and I would like to load a bitmap that I created. I want this bitmap to be displayed on the 1st page.
thank you very much! = )
|
|
|
|
|
The basic way is to use LoadImage (which accepts a file path) to get a handle to the bitmap, then SetBitmap of CStatic control to display it. You need to make sure that the size of your static is equal or more than the size of the bitmap loaded, otherwise it won't be displayed
Philip Patrick
Web-site: www.stpworks.com
"Two beer or not two beer?" Shakesbeer
Need Web-based database administrator? You already have it!
|
|
|
|
|
Does anybody know of how to completely turn off the task list thing in VC++.NET? I thought I had set all the VC 6 compatibility, but everytime I hit F4 in the output window it opens the task list.
TIA!
|
|
|
|
|
Tools->Options->Environment->Keyboard
If you select the VC6 scheme, set focus to the Press shortcut keys edit control and click the F4 key, you'll see that in that scheme, it resolves to a the View Next Task command. Simply change it to whatever you want
Cheers,
Tom Archer
Author, Inside C#
A total abstainer is one who abstains from everything but abstention, and especially from inactivity in the affairs of others.
|
|
|
|
|
Hi,
I'm playing with an FTP client, and I'm trying to figure out how to download files from the server in PASSIVE mode. The problem is, I can't figure out how to tell when the client should stop trying to recv data from the data socket and close the socket. In normal mode, the server would close the socket, so I could simply recv until I got a CLOSE event on the socket, then just read the remaining queued data.
So, how do I tell when a transfer is finshed in PASV mode? I was originally thinking that I could wait for the 226 - Transfer OK on the control socket, and then stop when got that, but that seems to arrive before all of the data has arrived on the data socket, so it's not very reliable. Should I just count the number of bytes received and compare to the file size indicated by the server?
Thanks
|
|
|
|
|
I wrote a Pro*C application in VC++ on Windows 2000 and I built it and it runs fine on my machine, but when I try to execute it on the server running NT, it doesn't execute. Not sure if I'm building it wrong or anything like that. I've never had this problem before.
Does anyone have any ideas?
|
|
|
|
|
You might be using some features not availiable on NT4, there's plenty of stuff that works on Win2k that doesn't work on NT4...
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
Hi,
Is there any function that converts one string into a valid XML tag ? ( In my app the user types some names for some values, then I want to use that names as tag names but I would like to filter them to avoid having a bad formed XML file).
Thanks, Bye !
Braulio
|
|
|
|
|
If you are using IXMLDOMDocument, if I remember it correctly, it's all taken care of for you.
Are you maybe just looking for a general escape function?
|
|
|
|
|
Hi,
Yes, I´m using MsXml, but I think CreateElement throws one exception when you pass a wrong tag name, I don´t know if maybe there is one method there that converts from the string to a valid tag name
|
|
|
|
|
Yes, the tag names and attribute names are different. You are not allowed to use special characters there. In attribute values and text data however you can just pass in anything you like. Calling pXMLDoc->createProcessingInstruction("xml", "version='1.0' encoding='UTF-8'"); will give a coding of your choice. (just tried it)
As for tag names and attribute names, I suspect yuo have to 'destroy' data to get where you want, i.e. replacing e.g. '>' and '<' and all other 'illegal' characters with '_'.
|
|
|
|
|
hrm.
i have about 8 different memory leaks, and i can't seem to track em down.. so i have some questions..
1) do memory leaks only occur when the 'new' keyword is used to create a pointer, and that pointer is never deleted (using 'delete' keyword)?
2) if my memory leaks say 'CObject' is there any way to tell what class it is?
i am using several classes i derived from CObject, and i use CObArray quite alot too.. i know that after im done with a CObArray that i have to loop through it and delete all the objects, and im doing this everywhere..
any help in general would be great.. i don't want to have any memory leaks..
thanks!
-dz
|
|
|
|
|
dazinith wrote:
do memory leaks only occur when the 'new' keyword is used to create a pointer
You can also get memory leaks when you create GDI objects such as pens and brushes and forget to unselect them out of the DC and delete them.
dazinith wrote:
i know that after im done with a CObArray that i have to loop through it and delete all the objects,
Perhaps you're forgetting to do a RemoveAll() after you delete the individual objects?
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Actually, you do not need to remove items from an array once they've been deleted. I do it as a sanity check so that after the delete loop I can assert if any items remain in the array. However, once you've deleted the actual item in memory, the array simply points to an invalid item for which no memory is still allocated.
Cheers,
Tom Archer
Author, Inside C#
A total abstainer is one who abstains from everything but abstention, and especially from inactivity in the affairs of others.
|
|
|
|
|
Ah. Looks like CObArray 's destructor cleans up after itself. Thanks for the tip!
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
No problem. I've actually spent so much time in the guts of MFC that I've often thought of writing a second edtion of the MFC Internals book. Do you think such a book would sell? I think it would. I think there are stil enough people new to MFC that would get a tremendous amount out of a book that explains how their apps are working internally. The thing that I would add to such a book, however, is a section at the end of each chapter that basically says "Ok. You know how this bit works internally. Here's where you can apply this knowledge". I think that would make the book more practical instead of coming off as just trivia. What do you think?+
Cheers,
Tom Archer
Author, Inside C#
A total abstainer is one who abstains from everything but abstention, and especially from inactivity in the affairs of others.
|
|
|
|
|
Tom, I for one would welcome (more) info on MFC's internals. And as you pointed out, real-world usage examples would come in *very* handy.
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Sounds like a good idea.
There's a couple of people here (including me) who'd like to know more about MFC and how to apply it.
A problem I have is that I know what I want a program to do, but not how to achieve that in a windows environment. CP has helped a lot, but sometimes a book of 'typical' applications would help too
Paresh Solanki
There is no substitute for genuine lack of preparation.
|
|
|
|
|
dazinith wrote:
any help in general would be great.. i don't want to have any memory leaks..
Always a worthy goal
The way to track down memory leaks in an MFC application - short of spending hours and hours manually tracking down and tracing on every new and delete operation - is to use the CMemoryState class. There are actually several ways to use this class so instead of me enumerating them all, I'll just point you to the article entitled "Taking Memory Snapshots" in your MSDN online help.
Good luck! Everybody hates those *#*& things!
Cheers,
Tom Archer
Author, Inside C#
A total abstainer is one who abstains from everything but abstention, and especially from inactivity in the affairs of others.
|
|
|
|
|
Make sure you have no code that looks like
CObArray vec;
for (int i = 0; i < vec.GetSize(); i++)
{
delete vec[i];
vec.RemoveAt(i);
} where just every other element is deleted. This one I've seen lots of times.
|
|
|
|
|