|
Unfortunately, I can't remember the name of the best book I've read on MFC. It approached it by explaining HOW MFC works, not simply how to code to it. I found it very helpful to use the debugger to step into MFC classes and have been through about 90% of the MFC source.
Above all, experiment!
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
Dude I like your style of how you announced your name and presence ..who does that
As for your question if you already know how to program using Win32 APIs then MFC will be a snap for you to pick up as most of the classes are wrappers around the primitive types.
If you don't know any Win32 programming then I suggest you understand the basic plumbing, and a good book for that is the Charles Petzold book ..Also whatever you do don't pick up one of those god awful big red wrox book, simply trash! I have an old MFC book by Jeff prosise on windows 95!!! Ha, if you can get your hand on a copy or a later release then it's definitely worth the read, excellent coverage of what you need to know about MFC from start to finish. Trust me when I say not much as changed since then...thanks to MS for leaving us C++ developers out in the cold while the C# .Net folks get all the cool libraries and we're still in the stone ages of having to write routines from scratch!!! Ahhh I want to cry man..... See what you gone done now sonny, I am all bent out of shape trying to answer your question!!! Are you HAPPY now, Hugh, Mr. Vishwanath Patil .... ok me joke!
|
|
|
|
|
Hi,
Is there any standard for return values from a function, for example if my function returns only two value(true/false) then i would like to assign bool as its return value, but if i have got three values(0,1,2), then what data type should be the used as return value.
Best Regards,
Mushq
Mushtaque Ahmed Nizamani
Software Engineer
Ultimus Pakistan
"English is my second language, so please don't mind if i do some grammatical or spelling mistakes in my messages."
|
|
|
|
|
you have plenty of types. if the function may return little integers, char is good enough. but short, int, long are possible choices.
|
|
|
|
|
If the function may return only a small set of integers (such as {0,1,2}) then the enum type is a good choiche. Usually you can assign to each member of the set a meanigful name:
enum TrustLevel
{
LOW = 0,
AVERAGE,
HIGH
};
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
return int . so you can return up to 2 billion.
dlfkgj lsdfkglfkgjlfgl jldfk fldkk jk
|
|
|
|
|
Kenan Aksoy wrote: 2 billion
That's all? What if you need more in the future? You have to think ahead, you know.
Mark Salsbery
Microsoft MVP - Visual C++
"Go that way, really fast. If something gets in your way, turn."
|
|
|
|
|
Actually 4 billions
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
i'm new in programming c++. i only learn to use win32 console application..
i want to load, view an image(any jpg,bmp,gif) to my program. the picture will be view after i click some number and the picture will be assign to that number only..
i try to use 'swicth', but then i only manage to click number but don't know how to assign picture to that number..
|
|
|
|
|
You can use of CImage class for load bmp,jpg,gif,png.
CImage m_Image;
m_Image.Load(your file);
|
|
|
|
|
where should i put that code?
i've try to put in like this, but it get error.
<br />
void test(int z){<br />
<br />
CImage m_Image;<br />
<br />
cout << "You have press " << z << endl ;<br />
switch (z)<br />
{<br />
case 1 : cout << "Picture 1 is\n":<br />
m_Image.Load(pic1.jpg);<br />
<br />
break;<br />
.........<br />
....}<br />
}<br />
is it the same as CxImage?
|
|
|
|
|
Whats the error? and not its not same with CXImage.
|
|
|
|
|
Are you using MFC, or just the Win32 API? Is this a console or GUI appliocation?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
just win32 API console application..
|
|
|
|
|
Console applications cannot display GUI images.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
so i have to use win32 app or mfc?
it is still using c++ programming?
or the different is just the Project?
|
|
|
|
|
You can develop a console application using Win32, MFC, or both. You can also develop a GUI application using Win32, MFC, or both.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hello All
I want to programatically send email to my ID (Yahoo or gmail) with an attachment. I am very new to email programming. Can any one suggest where to start with?
Thanks for your time
BlrBoy
|
|
|
|
|
|
Hi All,
I use dc.GetPixel() dc.SetPixel() functions to render bitmaps with my color and then StretchBlt on to my Paint dc.I do StretchBlt of around 16 bitmaps on Paint DC.As a result my painting is delayed by 3 secs.
So, Is there any otherway other than GetPixel() and SetPixel() to reduce the delay?
Thanks in Advance
Today is a gift, that's why it is called the present.
|
|
|
|
|
A replacement to GetPixel, is to use GetBitmapBits and access the memory directly.
<br />
BITMAP bm= ###;
<br />
int datasize = bm.bmWidth*bm.bmHeight*bm.bmPlanes;<br />
COLORREF* lpClrData = (COLORREF*)LocalAlloc(LPTR, datasize * sizeof(COLORREF));<br />
DWORD ds = GetBitmapBits(hBitmap, datasize * sizeof(COLORREF), lpClrData);<br />
<br />
COLORREF pixelColor = lpClrData[y*imageWidth+x];<br />
<br />
This is much faster that GetPixel...
I haven't had to deal with SetPixel (but i'm sure with the above you should be on your way to finding a solution).
Cheers,
Jubjub
"If you're too careful, your whole life can become a f---in' grind." - Mike McD ( Rounders)
|
|
|
|
|
Jubjub,
is this work with any color resolution?I remember that I try something similar in past,...and I remember that I fonund many problem if the system was 16k colors, where 2 Bytes are used to define the pixel color.
Russell
|
|
|
|
|
narayanagvs wrote: to render bitmaps with my color
What do you mean by this? What are you actually doing with the pixel values?
This would determine how best to efficiently access the pixels IMO.
If you need pixel access then I would recommend using a DIB section, which gives you an HBITMAP
for GDI operations along with a pointer to the pixel bits for direct manipulation.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
"Go that way, really fast. If something gets in your way, turn."
|
|
|
|
|
Hi everyone
I called CFileDialog.DoMOdal() like this, for save file.
CFileDialog OpenDlg(FALSE ,"Lic", "*.Lic",OFN_FILEMUSTEXIST| OFN_HIDEREADONLY, "*.Lic", this);
if exist new file name in selected path I want show a warring for file replacing.
How do you do it? Please help me.
|
|
|
|
|
Have a look at OFN_OVERWRITEPROMPT flag.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|