I did that and it still gives me a "runtime error" when I do that. Also when I try and debug it it doesn't give any information. When I don't use the loop varible i as the array number in the DownloadFiles function it returns the information perfecty, no matter how many times it runs in the loop.
By reading this message you are held fully responsible for any of the mispelln's or grammer, issues, found on, codeproject.com.
For those who were wondering, actual (Linux) Penguins were harmed in creating this message.
Well, I just found the UpdateUI function, but it doesn't seem to do what it claims. I said pCmdUI->SetCheck(), but with no success. Didn't remove a check, or make one.
I tried something using the info that you gave me, but also with no success: GetDlgItem(IDM_SEND)->CheckMenu()... The compiler also didn't like this. Apparently, CheckMenu isn't a member of CWnd, which sounds ridiculus (due to the info you gave me).
Any other ideas?
If you have a problem with my spelling, just remember that's not my fault. I (as well as everyone else who learned to spell after 1976) blame it on Robert A. Kolpek for U.S. Patent 4,136,395.
Since you are storing an array of objects, rather than an array of pointers, the objects will be copied into the array. This means that C++ uses the autogenerated assignment operator for STest. However, the CArray template class disables both the copy constructor and the assignment operator, therefore disabling simple copies of the array.
There are a number of solutions for this. Here's a few:
1) Store STest pointers in the outer array instead of objects. This means that only the pointers are copied rather than the entire object (and hence the inner CArray is not copied). This means that the objects must be allocated and deallocated manually on the heap.
2) Use std::vector instead of CArray. This is much better implementation overall, and does not have the copying limitation either.
BTW, when posting on codeproject, use < and > instead of < and >, otherwise they look like HTML tags and so are not displayed.
I have an ActiveX control and its dependend DLLs within a CAB file that we use within our web application. I also use this same control in a fat VC client. We currently deploy the control for our fat client by an install shield script. I'd like to get away from having to deploy this control, since I know it's sitting on a local web server in a cab file.
Is there an API set that allows me to reference the CAB file rather than bundling the control in my setup script? In other words, I'd like my fat client to instantiate the object via an http call to my web server and pull down the control rather than me having to wrap it in my install script. Any ideas appreciated.
I want to buy a Sony 17'' LCD monitor and I need some help .
First I haven't found much ratings/reviews about this monitor . If anybody has used this type maily for programming please write me .
I have found a sigle review but this is in french . Can somebody translate it?
I would greatly appreciate
le + beau ( vaux mieux pour le prix )
17" 500/1 16ms décoiffant
si vous en avez les moyens achetez-le.
The URL is:
Im writing a C++ program, and I need to add a member variable to a class. This member variable is an object that takes 2 parameters to it's contructor. How do I declare the variable in the header of my class, and initialize it in the constructor of the class that I am using it in?
ROY! Please don't go!
Student of Computer Science
University of Kansas
When you hit the enter key in VS6 it inserts "\r\n" which drops you down a line. This is normal behavior in windows, however I'm editing C++ files that are being used in unix and the \r is an annoyance there.
My question is, does anyone know how to stop VS from inserting the \r -or- Is there a way to run a small script that would strip this out when you save the file?
I don't believe there is a solution in VC6 except to write a little program. (In fact VC6 will take files that have just LF and convert them automatically to CR/LF. By default, VC7 will preserve the original style.)
If you are working with Unix and Windows at the same time, I recommend you installing Cygwin[^].
One of their utilities is u2d and d2u (Unix to Dos/Dos to Unix), which make the conversion you need.
I know that installing Cygwin just for this is overkill, but I think you should give it a try, since it can really ease when you are working with multiplatform code.
It's not the fall that kills you: it's the sudden stop - Down by Law, Jim Jamursch (1986)
We can override OnOk(), or PreTranslateMessage(), but not SetWIndowText() right? What makes a function overridable? Is it that only event handlers are overridable? I'm reading about the word "virtual" but dont see it in the members of say CWnd...like GetWindowTExt etc. I looked in "Input Message Hanfdlers" which has functions like OnHScroll, OnKeyDOwn etdc which are ones that I've seen overridden yet they dont say "virtual" in the declaration (in MSDN)
short answer: you can override any function, in a derived class. but whether your overridden function is called or not depends on who's calling it, what kind of object the caller think he has and the "virtual" option...
i tried to explain it... but realized that this does a better job:
ns wrote: SO having the keyword "virtual" isnt necessary to make a function overridable it seems.
the virtual option affects who calls your override. if you override a non-virtual function, your function will not be called if the caller thinks he's using a base-class object. ie. if the caller only has a CWnd pointer and calls a non-virtual function on your CMyWnd object, he will end up in the base class function, not your override. the effect of the virtual keyword is to allow callers without knowledge of derived classes to call function in the derived class.
Remember that MFC is a thin wrapper over the Win32 API. MFC's CWnd class provides virtual functions that can be overridden in your derived class, as you already know. Some of these virtual functions are actually callback handlers, such as OnSize(), OnGetMinMaxInfo(), etc. They are what get called when a WM_SIZE, WM_GETMINMAXINFO, etc. message is sent/posted to the window.
Now to the interesting part...
MFC provides a back door to allow you to handler *any* Windows message, not just one that's handled by a provided overridable. This is done by the virtual function OnWndMsg(). You can provide custom handling for WM_SETTEXT here. Just be sure to call the base class method for all other messages, or else you could have some seriously weird windowing behavior on your hands!
My program is a small GIS and I was using GDI to display maps and informations. Now I would like to use GDI+ and I didn't find any function to draw a pixel ? Do I have to use GDI to draw pixels and GDI+ to draw the other stuff ?
You can use Graphics.SetPixel, but it is quite slow. You can also use Bitmap.GetData, which returns a BitmapData object, whose Scan0 property is a pointer to the bitmap's data (in BGR format, not RGB format).
"Do unto others as you would have them do unto you." - Jesus
"An eye for an eye only makes the whole world blind." - Mahatma Gandhi
Last Visit: 31-Dec-99 18:00 Last Update: 30-Aug-16 15:35