|
hfry wrote: im79 wrote:
myBitmap->CreateCompatibleBitmap(pDC, m_iWidth, m_iHeight);
What are you trying to do here?
I thought that i have to convert the DIB to a DDB Bitmap, so i guess that's wrong
I just want to display the Bitmap in a picture control, but it's not as easy as i thought
hfry wrote: The CBitmap::LoadBitmap function is used to load an image into the bitmap, not set an image into a picture control...
Yes that's stupid, I should have read the MSDN manuals
|
|
|
|
|
im79 wrote: it's not as easy as i thought
It is actually.
CStatic *picture = (CStatic*) GetDlgItem(IDC_STATIC_PICTURE);
picture->SetBitmap(hBitmap);
Make sure the static control's type is actually set to Bitmap.
|
|
|
|
|
Hi hfry
It's working
Thank you very much
|
|
|
|
|
Hi
i need your (or any one's) help again
I'm trying for long time to change this code in order to make an 8Bit color Bitmap but it's not working
I'll be greatfull for any help!
|
|
|
|
|
Hi,
RGBQUAD *pColors = pbmi->bmiColors;
for(int i = 0; i < 256; i++)
{
pColors->rgbBlue = i;
pColors->rgbGreen = i;
pColors->rgbRed = i;
pColors->rgbReserved = 0;
pColors++;
}
The code snippet above is setting the color table. In your previous question, you wanted it grayscale so the color table so I set it up as such. If you want it to be color you need to setup the appropriate color table that your 8-bit data maps to.
Regards,
Justin Tay
|
|
|
|
|
I have two very simple classes as shown below. In my application code, I want to test the
condition of the object - is it valid? But, VC++ tells me :
"error C2248: 'IsValid' : cannot access public member declared in class 'CBaseFile'"
Why? Why? For goodness' sake, why? Is it not declared public? It looks like it, it even tells
me it is public. What obvious goof don't I see?
{
// app code snippet:
CSpecialFile *pSpecialFile = new CSpecialFile("a filename");
if (!pSpecialFile->IsValid()) AfxMessageBox("Oh no!!! Mr. Bill...");
}
class CBaseFile
{
public:
CBaseFile(CString sFilename);
virtual ~CBaseFile();
bool IsValid();
private:
bool m_bIsValid; // true if no problems encountered;
};
Then I inherit from it...
class CSpecialFile: CBaseFile
{
public:
CSpecialFile(CString sFilename);
virtual ~CSpecialFile();
// more methods specific to special file object go here....
};
Charlie Gilley
Will program for food...
Whoever said children were cheaper by the dozen... lied.
My son's PDA is an M249 SAW.
|
|
|
|
|
You need this:
class CSpecialFile: public CBaseFile
0 bottles of beer on the wall, 0 bottles of beer, you take 1 down, pass it around, 4294967295 bottles of beer on the wall.
Awasu 2.2.2 [^]: A free RSS/Atom feed reader with support for Code Project.
|
|
|
|
|
doh! insert sound of hand slapping forehead!
btw, love your sig...
Charlie Gilley
Will program for food...
Whoever said children were cheaper by the dozen... lied.
My son's PDA is an M249 SAW.
|
|
|
|
|
|
Hie,
i just downloaded VC 2005 express.I opened an old VC 6 project that was written in the C language.When i tried building this in VC 2005 EXPRESS.. it gives me a whole Plethora of errors .Is the C language no more supported by VC express.Also i installed Microsoft Visual Studio .NET 2003.here VC supports the c language BUT does'nt support XP style.Where as VC 2005 express has a really good XP look .. i mean even the menus have a blue gradient on them.My problem is i NEED TO HAVE A VERSION THAT SUPPORTS XP STYLE AND THE C PROGRAMMING LANGUAGE.i only know C.Also i would really appreciate it if someone pointed me to a good
e-book on using VC with C++ NO MFC! .. i gonna start C++ soon!;P
|
|
|
|
|
|
Many of the old C APIs have been deprecated. I imagine that is the majority of your errors/warnings. You can turn that off using a compiler switch (you'll have to look that up as I don't have VS available at the moment).
These aren't e-books, but they are perhaps the best books you'll find for Win32 programming without MFC:
Programming Windows by Charles Petzold
Programming Applications for Microsoft Windows by Jeffrey Richter
Note: get the older editions as the newer ones have been written with C# (which was a mistake IMHO).
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
Zac Howland wrote: Many of the old C APIs have been deprecated. I imagine that is the majority of your errors/warnings. You can turn that off using a compiler switch (you'll have to look that up as I don't have VS available at the moment).
Hi , its been a while. Yea , i got petzolds book and other books too and learnt C# , and its awesome!! Way better than win32 , i can build more powerful apps way faster! Without losing my head! (thats for anyone else doing win32)
About my problem , it seems the vc express does'nt come with the PSDK.
Look at this[^]
Hope that helped someone.
Gideon
|
|
|
|
|
Is there any way to trick the C++ compiler and get the value of a non-static member variable from a static method.
e.g.
class CDummy
{
public:
int m_myInt;
static void dummy();
};
void CDummy::dummy()
{
int x = m_myInt; ????
}
Thanks!
modified 9-Mar-17 17:16pm.
|
|
|
|
|
Not without passing a reference to the instance of your class.
I Dream of Absolute Zero
|
|
|
|
|
Yes ... its called make a non-static version of the method:
class CDummy
{
public:
int m_myInt;
static void dummy(const CDummy& dum);
void dummy() const;
};
void CDummy::dummy(const CDummy& dum)
{
dum.dummy();
}
void CDummy::dummy() const
{
int x = m_myInt;
}
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
Hi,
I have outlook configured on my machine.
I need to send data (textual) to one email contact only .
Means I will have some text ready at some time interval and every tiem I read the data the data should go as email to this address using my outlook config.
How can I achieve this.
pathak
|
|
|
|
|
See here and here for examples of sending e-mail.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
How to get all the URLs (links) on the web page?
Leya
|
|
|
|
|
Use the IHTMLDocument interface to retrieve the <A> elements.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
See Here[^] maybe it is some helpful to you
whitesky
|
|
|
|
|
i want to know,that as i insert a edit box on dialog box
and 10 buttons with number on them from 0 to 9.
now i want that when i press these 0-9 buttons
then that will be appear on edit box . I use a progress control on dialog box
and a dial button so that after entering numbers press dial and progress button start
moving
I want as in phone system when we press buttons they appear on screen
and when dial button is pressed phone dials.
Please mail me
|
|
|
|
|
m_sPhoneNumber += "1";
setDlgItemText(IDC_EDIT_PHONE_NUMBER,m_sPhoneNumber);
put that code on button click.
sPhoneNumber is a String.
this code might help u.
|
|
|
|
|
thank you
but this code does not sotore number on edit box as it replace preivious number
i wantr as we use in mobile phone
thank s
Please mail me
|
|
|
|
|
About how many times are you going to ask this question? It's been answered several times.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|