I think you should use SetStretchBltMode(HDC hDC, int nStretchMode).
Set the mode to HALFTONE before you use StretchDIBits and look if the stretched bitmap looks better. Take a look at the MSDN library for SetStretchBltMode. I think there are some limitations if you use HALFTONE mode!
I would like to handle accelerators like Ctrl+Alt+R in my dialog based app, but can't find any good source for example on doing that. If somebody have noticed somewhere an article or code snippet on doing that, please let me know,
I’m writing a kind of spy program. It’s for a good purpose – to protect kids by letting their parents know when they are up to no good. I can monitor system wide keystrokes and mouse clicks, and I can get the text from Edit/Combo boxes of other apps with no problem, but I cannot get the text that has been entered into Edit/Combo boxes on web pages in IE. It seems that these are not normal child windows. Any ideas?
Ok, so this is starting to get really annoying. Everytime I write some code and I want to go back to it after I turn my pc off I get this error. I tried using the answer to question 2.7 in the debuging questions article and that did not work....I am really confused why this is happening and I have no idea how to fix it. It is really starting to slow me down
Can anyone help me with this?? I have gotten these errors with every MFC program I am writing! Here are the files I'm using.
Here is the errors.
--------------------Configuration: main - Win32 Debug--------------------
main.obj : error LNK2001: unresolved external symbol "public: __thiscall Radio::~Radio(void)" (??1Radio@@QAE@XZ)
main.obj : error LNK2001: unresolved external symbol "public: void __thiscall Radio::Display(int)" (?Display@Radio@@QAEXH@Z)
main.obj : error LNK2001: unresolved external symbol "public: __thiscall Radio::Radio(void)" (??0Radio@@QAE@XZ)
Debug/main.exe : fatal error LNK1120: 3 unresolved externals
Error executing link.exe.
Ok, that works! But I have another quick question. I have not had to do this before when compiling C++ projects and I also do not have to do it when I create the project from scratch (I only got this problem when I continued working on a project after I turned my PC off). In both my C++ book and my MFC book they only include the hearder.h file. How come in the books they do not include the header.cpp file? Is this something I am going to have to do with all MFC and C++ projects in the future?
Thank you for your help Kula, this has really been helpful!
I'm not sure what compiler you're using, however I use Visual C++ 6.0. When I create a new Win32/Console application and define a new class I simply insert the header file for the class into main.cpp and everything compiles and links just fine. From what I gather of your original post, it sounds like a compiler configuration issue. You might want to consult Microsoft's Knowledge Base just to find out if this is a known issue and if so, how to fix the problem.
Can anyone point me in the right direction? I have been building a audio app for a couple of months based on DirectMusic, and I have had problems looping .wavs. I'm loading them into a segment, (after the usual initialisation) setting the length, and specifying looping points, but on play back the segments play the entire file and loop from start to finish.
I suspect I am missing out a setup step, but the documentation is pants, and I can't seem to find any tutorials that deal with this. Any help would be greatly appreciated.
I’ve got an ATL control (ActiveX) which currently exposes a property page that is used to manipulate all the properties in the control (This property page is launched in the usual manner by the user activating the ‘Custom Properties’ item in the container).
However, instead of displaying a property page to manipulate my control, I need to execute an arbitrary piece of code that displays a custom built editor dialog. My problem is that I cannot find out how to execute an arbitrary piece of code in response to the user clicking the “(custom)”
button on the control container’s property pane (or a similarly easy method of the user activating the editor).
One approach that I have considered is to create and show the dialog from the property page’s InitDialog handler, then destroy the property sheet after the custom dialog has exited (The problem here is knowing how to close the entire property sheet and not just the page) - I'm sure there must be other approaches to this problem though.
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. (Rich Cook)
Your operator= method is flawed in many ways. The most notable flaw is that you are returning a dangling reference. You return a reference to a temporary object - an object which is dead after the operator= has returned.
Second, a operator= should return *this so that you do not break the syntax and semantics of obj1 = obj2 = obj3 /* and so on */ ;
As for your error message: Obviously you do not have a CZone(CString, const CArray*) or CZone(const CString&, const CArray*) constructor. Your parameter, zone is const. Hence zone.nomZone and zone.composantsZone are const too.
Is there anyway (meaning, any tricks of the trade) by which one can set the size of an array at run time?
I am dealing with a 2-dimensional array, and it just seems a waste to set its size at the maximum, only to know that several times during the running of the program, less than 1/10 its size will be used. (Translated another way: From about a megabyte maximum, to a few dozen bytes minimum.)
Thanks for any insight.
Fortes in fide et opere!
Last Visit: 12-Aug-20 0:28 Last Update: 12-Aug-20 0:28