|
Do a search of MSDN, search the www, and sites like codeproject and sourceforge (there are more than one example of drawing some-thing as simple as sin).
When plotting points(/pixels/pels) under windows (using the cartasion (miss spelled) coordinate system) you will need to to set the origin, to the center of the client area [Normaly the origin is the upper left hand courner of the client area, but you can change it before you start drawing].
Sorry I could not provide a progaming example, but I do not have any code (at that low a level) to give you.
Trust in the code Luke. Yea right!
|
|
|
|
|
Dear Friends
Kindly write to me about a function to set the Aspect Ratio in WinAPI.
IF possible kindly give an example.
Thanking you.
Adarsh
|
|
|
|
|
I want to use some ATL classes in my WIN32 application. I want to use my application in Internet so I don't want to add extra dll with my application.I want to know if I use these class should I any dll to my application like MFC or ATL dll's is part of Windows installation?
Mazy
"And the carpet needs a haircut, and the spotlight looks like a prison break
And the telephone's out of cigarettes, and the balcony is on the make
And the piano has been drinking, the piano has been drinking...not me...not me-Tom Waits
|
|
|
|
|
How to show an explorer style file dialog. I tried giving the OPENFILENAME Flags as OFN_EXPLORER. But still its showing me the old style file open dialog. What else should I do? Saw a member FlagsEx for m_ofn datamamber. But when i give it, it shows error. I am using Win2000. Kindly help......
================
CFileDialog fd(true);
fd.m_ofn.Flags=OFN_ENABLESIZING|OFN_EXPLORER ;
fd.DoModal();
Thanks...
Vini
|
|
|
|
|
If you need an Open dialog with Outlook-style bar on the left side then look here[^].
rechi
|
|
|
|
|
|
i tried adding the manifest file to the project,but it doesn't work.
i guess there must be something else to do to make this.
modified 1-May-21 21:01pm.
|
|
|
|
|
You must call InitCommonControls() at the start of your program.
Software Zen: delete this;
|
|
|
|
|
So, I'm experiencing the blackout of my life.
I currently perform a code review and got stuck on the following (I did a couple of simplifications for this CP demo purpose):
char* pText = "";
if(...condition A...)
pText = "Some text";
else if(...condition B...)
pText = "Another text";
I don't use this style myself, because I've been taught not to.
My understanding of the above code is that asignment 1 is ok to do, because the compiler will tell the program to allocate memory for "" at startup and point pText to that memory. However, I 'm stumbling on the "correctness" of assignments 2 and 3 - will they segfault at some time, or are they completely and utterly safe and legal? I could imagine that memory is also allocated for those texts at startup, so that redirecting pText to one of them will be safe after all.
Gee, I really feel 15 years less experienced than I am right now...
Thanks for any input.
|
|
|
|
|
I don't think assignments 2 and 3 are legal at all. Imagine for a moment if you had the following statement:
char cSomeChar;
pText[ nSomeIndex ] = cSomeChar;
Either one of those strings is considered a constant so you can't really alter their values.
Assume for a moment that pText will point to another text string later. Will the compiler deallocate and reallocate memory for the pointer again? How will it distinguish from a case where memory is being allocated by the programmer or by the compiler? It would have been great if compilers had those capabilites, but to my knowledge there aren't any that can do that. That's why I believe those assignments are totally illegal. To tell you the truth you are making me question what I know about pointers (which isn't a lot ).
// Afterall I realized that even my comment lines have bugs
|
|
|
|
|
Toni78 wrote:
I don't think assignments 2 and 3 are legal at all
Actually, after some thought, I'm quite convinced that the assignments 2 and 3 are legal and safe, since they point to string literals allocated at startup.
But another question is whether this is a Good Style or not...
|
|
|
|
|
I don't see any problem with memory allocation but should pText be
initialised to "" or NULL. If you set char* pText=NULL and later
try to use it then the program crashes(MFC). pText="" will not crash
but it can be more difficult to debug.
jhaga
|
|
|
|
|
Because "Some text" and "Another text" are static text, the compiler has already made room for them. pText can point to them because they indeed exist in memory.
|
|
|
|
|
The code is legal but not safe. You should use a const char * (LPCSTR) to point to this string to signify that the contents should NOT be modified.
|
|
|
|
|
In my header file I have:
<br />
#include <iostream><br />
#include <list><br />
<br />
class mp {<br />
private:<br />
class element {<br />
public:<br />
double x;<br />
double y;<br />
double z;<br />
bool operator<(const element& a ) { return z < a.z; }<br />
friend std::ostream& operator<< (std::ostream& str, <br />
const element& e ) <br />
{<br />
return str << "(" << e.x << "," << e.y << "," << e.z <<<br />
")";<br />
}<br />
};
typedef std::list<element> elementList;<br />
elementList points;<br />
public:<br />
mp();<br />
mp( elementList Points );<br />
void print();<br />
};<br />
in my cpp file I have:
<br />
#include "mp.h"<br />
<br />
mp::mp() {}<br />
<br />
mp::mp( elementList Points ) {<br />
points = Points;<br />
points.sort();<br />
}<br />
<br />
void mp::print() { <br />
using std::cout;<br />
for ( elementList::const_iterator e = points.begin(); e !=<br />
points.end(); e++) {<br />
cout << e << endl;<br />
}<br />
}<br />
Get get this error ....
error C2679: binary '<<' : no operator defined which takes a right-hand operand of type 'class std::list<class mp::element,class std::allocator<class mp::element> >::const_iterator' (or there is no
acceptable conversion)
what do you think?
please help me out
|
|
|
|
|
try
cout << *e << endl;
instead.
Wenn ist das Nunstück git und Slotermeyer? Ja! Beierhund das oder die Flipperwaldt gersput!
|
|
|
|
|
|
How can I send mail with win32? Not with MFC.
Mazy
"And the carpet needs a haircut, and the spotlight looks like a prison break
And the telephone's out of cigarettes, and the balcony is on the make
And the piano has been drinking, the piano has been drinking...not me...not me-Tom Waits
|
|
|
|
|
Search for articles on SMTP.
|
|
|
|
|
In addition to SMTP, search for (Simple) MAPI, and CDO.
|
|
|
|
|
hi, i'm trying to display bitmaps using Raw RGB values. I don't know how to create a bitmap using RAW RGB values in c++ though.
I'm new to c++ so if you could help me out it would be a great help.
|
|
|
|
|
Search codeproject for using DIB sections. Other than that I have no idea what you are talking about.
Trust in the code Luke. Yea right!
|
|
|
|
|
The control/class is available for VC++6 or VB6.
Thanks
DJ
|
|
|
|
|
you may use MicroSoft MAPI controls!!
Take help on Microsof MAPI controls.
or
you may user outlook API's / Office API's to send the mail. But it will be confined to outlook only.
Vikram
|
|
|
|
|
I'm creating a few thread pool classes in which I want to be able to suspend/pause a thread that is waiting for work to do. [the different classes are basically different methods of handling high workload or simple static thread-pools etc that map down to a single interface for access. Btw, if there's any novel ways that you have, I'd be glad to know them too, so I can expand the Interface implementations.]
The SuspendThread/ResumeThread method is what I currently have implemented as doing that, but I cannot find any information on performance relating to using these functions, particularly frequent calls to them. I saw some data about it and the .Net implementation, which said that its SuspendThread and ResumeThread weren't all that safe to use due to unknown-stop points [though so far to me it seems it operates right in the raw Win32 version.. though I havent run many tests]
|
|
|
|