|
That screenshot doesn't really help.
Paste the code for that field and anything to do with that field.
|
|
|
|
|
CMyDigClockDlg::CMyDigClockDlg(CWnd* pParent /*=NULL*/)
: CDialog(CMyDigClockDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CMyDigClockDlg)
m_name = _T("");
m_hour9 = _T("");
m_hour8 = _T("");
m_hour7 = _T("");
m_name2 = _T("");
m_name3 = _T("");
m_name4 = _T("");
m_name6 = _T("");
m_name5 = _T("");
m_hour = 0;
m_minutes = 0;
m_hour2 = 0;
m_hour3 = 0;
m_hour4 = 0;
m_hour5 = 0;
m_hour6 = 0;
m_minutes2 = 0;
m_minutes3 = 0;
m_minutes4 = 0;
m_minutes5 = 0;
m_minutes6 = 0;
m_ampm = _T("");
m_ampm2 = _T("");
m_ampm3 = _T("");
m_ampm4 = _T("");
m_ampm6 = _T("");
m_ampm5 = _T("");
m_notepad = _T("");
//}}AFX_DATA_INIT
// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}
void CMyDigClockDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CMyDigClockDlg)
DDX_Control(pDX, IDC_CLOCK, m_clock);
DDX_Text(pDX, IDC_NAME, m_name);
DDX_Text(pDX, IDC_NAME2, m_name2);
DDX_Text(pDX, IDC_NAME3, m_name3);
DDX_Text(pDX, IDC_NAME4, m_name4);
DDX_Text(pDX, IDC_NAME6, m_name6);
DDX_Text(pDX, IDC_NAME5, m_name5);
DDX_Text(pDX, IDC_HOUR, m_hour);
DDX_Text(pDX, IDC_HOUR2, m_hour2);
DDX_Text(pDX, IDC_HOUR3, m_hour3);
DDX_Text(pDX, IDC_HOUR4, m_hour4);
DDX_Text(pDX, IDC_HOUR5, m_hour5);
DDX_Text(pDX, IDC_HOUR6, m_hour6);
DDX_Text(pDX, IDC_MINUTES, m_minutes);
DDX_Text(pDX, IDC_MINUTES2, m_minutes2);
DDX_Text(pDX, IDC_MINUTES3, m_minutes3);
DDX_Text(pDX, IDC_MINUTES4, m_minutes4);
DDX_Text(pDX, IDC_MINUTES5, m_minutes5);
DDX_Text(pDX, IDC_MINUTES6, m_minutes6);
DDX_CBString(pDX, IDC_AMPM, m_ampm);
DDV_MaxChars(pDX, m_ampm, 2);
DDX_CBString(pDX, IDC_AMPM2, m_ampm2);
DDV_MaxChars(pDX, m_ampm2, 2);
DDX_CBString(pDX, IDC_AMPM3, m_ampm3);
DDV_MaxChars(pDX, m_ampm3, 2);
DDX_CBString(pDX, IDC_AMPM4, m_ampm4);
DDV_MaxChars(pDX, m_ampm4, 2);
DDX_CBString(pDX, IDC_AMPM6, m_ampm6);
DDV_MaxChars(pDX, m_ampm6, 2);
DDX_CBString(pDX, IDC_AMPM5, m_ampm5);
DDV_MaxChars(pDX, m_ampm5, 2);
DDX_Text(pDX, IDC_NOTEPAD, m_notepad);
//}}AFX_DATA_MAP
}
I have those variables in OnTimer.
This is in my OnTimer function.
if ((CurTime.wHour == m_hour) && (CurTime.wMinute == m_minutes) && (CurTime.wSecond == 00) && (setampm == m_ampm))
{
CString msg;
msg.Format("%s %d:%d %s",m_name, m_hour, m_minutes, m_ampm);
addiconballoon(1,m_name,msg,m_name,10);
startanimateicon();
}
if ((CurTime.wHour == m_hour2) && (CurTime.wMinute == m_minutes2) && (CurTime.wSecond == 00) && (setampm == m_ampm2))
{
CString msg;
msg.Format("%s %d:%d %s",m_name2, m_hour2, m_minutes2, m_ampm2);
addiconballoon(1,m_name,msg,m_name,10);
startanimateicon();
}
|
|
|
|
|
Send me your project. I can't see anything wrong with that. djneried@homemail.com.au
But I have a vauge idea of what is happening
Ashman
I'm normally not a praying man, but if you're up there, please save me Superman.
|
|
|
|
|
So have you looked at line 3102 of wincore.cpp? That should tell you exactly what is wrong.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
So I'm doing a project for a C++ class. I've written all the code, just gotta check for errors
Long story short, it's a energy bill calculator. I'm not sure if I need to provide more information than that.
The only errors I'm getting are 'illegal case' errors, and they're all coming from the same place. (where the bill is calcuated)
Since there are 3 possible inputs (in this case, Residential, Commercial, or Industrial) I decided to use a switch statement. Here's the code:
// calculate the bill
switch(type); {
case 'r':
case 'R': bill = PRICE_R + (amount * KWH_R); break;
case 'c':
case 'C': bill = PRICE_C + ((amount - 1000) * KWH_R); break;
default: cout << "Unknown use code!";
}
switch(offpeak) {
case 'peak':
case 'PEAK': peak = PRICE_PEAK + ((amount - 1000) * KWH_PEAK); break;
case 'off':
case 'OFF': off = PRICE_OFF + ((offpeak - 1000) * KWH_OFF); break;
default: cout << "Unknown use code!";
Now, there are no errors for the Industrial park (the section with Peak or Off-peak cases), but there are for the Residential and Commerical parts in the first case. My question is, do I need to declare the R and C to make them valid cases?
Any help is greatly appreciated!
|
|
|
|
|
Every case value in a switch statement must be a literal scalar (i.e an int , char , bool or enum ).
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
You don't say what type offpeak is, but it looks like a string. You can't use string constants in case statements, do:
if ( 0 == strcmpi(offpeak, "peak") )
peak = ...;
else if ( 0 == strcmpi(offpeak, "off") )
off = ...; and so on.
--Mike--
LINKS~! Ericahist updated! | 1ClickPicGrabber | CP SearchBar v2.0.2 | C++ Forum FAQ
Strange things are afoot at the U+004B U+20DD
|
|
|
|
|
skawttieboy sayz:
case 'peak':
case 'PEAK': peak = PRICE_PEAK + ((amount - 1000) * KWH_PEAK); break;
case 'off':
case 'OFF': off = PRICE_OFF + ((offpeak - 1000) * KWH_OFF); break
how can u write that???
the peak or PEAK that u have written ois not one character it is supposed to be enclosed by double quotes
case "peak":
case "PEAK":
happy Programmin.....
cheerz.....
"faith, hope, love remain, these three.....; but the greatest of these is love" -1 Corinthians 13:13
|
|
|
|
|
In addition to the problem already pointed out, you have an invalid semicolon in the first case statement
<br />
switch(type); {
A good reason for copying & pasting, rather than re-typing your code!
|
|
|
|
|
skawttieboy wrote:
case 'peak':
The type of case constant-expression must be integral (or a class type for which there is an unambiguous conversion to integral type).
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
"Peak" is a string, but 'peak' is an integral. Ask a Mac programmer if you dont believe me
|
|
|
|
|
Call it what you like, but neither will work.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Hello,
I want to print the picture in a picture control. I created a Cstatic m_picture to load a picture. m_picture has the function "print", it is "m_picture.Print(CDC *pDC, DWORD dwFlags)". Can I use the function print the picture and how to define the parameter pDC?
Thanks in advance
Dada
|
|
|
|
|
i am little Confuse ->do you want to print picture from Picture Box to printer or you want to show picture in the picture box.
if you want to show picture in Picture Box ->these is simple api call CStatic::SetBitmap(...);
"I Think this Will Help"
[Vote One Here,.....]
<h5
alok gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
Hi!
I am new in DirectX programming and have some difficulties with getting mouse position and active sprite on Device screen. Maybe I don`t understand completely principles of IDirectInputDevice8. I am creating some LPD3DXSPRITE and LPDIRECT3DTEXTURE9 on screen and using LPDIRECTINPUTDEVICE8 to capture mouse. But I can`t completely get texture or sprite under mouse. Is there some simple principles to get elements above mouse cursor? Maybe sample or something?
|
|
|
|
|
Even though you're trying to capture a 2D sprite, you're using Direct3D, right? So in reality, you're trying to click on a section of a plane in 3D space. This presents additional computation, since you have to convert the mouse position on the screen into a Ray in 3D space. It's not as simple as the 2D case, I'm afraid
It takes a bit of explanation, and I'm in the process of compiling an article on the subject, but there really isn't room to describe the process here.
You may want to poke around the internet for some keywords like "3D hit testing" "ray picking" and the like.
Bob Ciora
|
|
|
|
|
Hi
we created a MDI application currently running in Windows NT 4.0 (it will be ported to Windows XP by the end of the year) where a child is notebook with max. 76 pages. The number of handles being used by a child are 200 but may be up to 2400. Therefore we need to be careful about how many children we open. What we would like to do is query the number of window handles available in the system in order to determine if the system gets a little bit tight and we pop up a message like "before opening another child, please close another one".
I could not find a function in the Windows SDK to return any information about the available window handles in the system. Can anyone help?
Thanks
Thomas
|
|
|
|
|
You can use the perfmon API to get this information.
-- Rocky Dean Pulley
|
|
|
|
|
|
Is there a way that I can extract C++ recource dialogs,string table, ect.. into a vb file?
|
|
|
|
|
I've never seen anything that will do that, there are two very different formats but in theory you should be able to take a .rc dialog and convert it to a .frm. Although I'm not sure if Microsoft ever documented the VB form file format. Might get better help in the VB forum[^]
Michael
CP Blog [^] Development Blog [^]
|
|
|
|
|
There is enough information to get the info that is needed, I think I can recreate the dialogs and menu's. But I'm not sure how to convert this text to human readable text. What format would this be in?
Thanks,
Andy
/////////////////////////////////////////////////////////////////////////////
//
// Dialog Info
//
3002 DLGINIT
BEGIN
15000, 0x376, 507, 0
0x0000, 0x0000, 0x0000, 0x0001, 0x0211, 0x0000, 0x0172, 0x0000, 0x0000,
0x0000, 0x0032, 0x0000, 0x0000, 0xa000, 0x0001, 0x0000, 0x0000, 0x1400,
0x8e01, 0x8500, 0xa902, 0x0001, 0x0000, 0x0100, 0x0000, 0x1200, 0x2100,
0x4d00, 0x2e00, 0x2000, 0x0000, 0x0200, 0x0000, 0x4e00, 0x1e00, 0xe900,
0x3200, 0x0400, 0x0000, 0x0300, 0x0000, 0x1200, 0x3a00, 0x4d00, 0x4700,
0x2000, 0x0000, 0x0400, 0x0000, 0x4e00, 0x3700, 0x2000, 0x4b01, 0x0c00,
0x0000, 0x0500, 0x0000, 0x1200, 0x5a00, 0x4d00, 0x6700, 0x2000, 0x0000,
0x0600, 0x0000, 0x4e00, 0x5700, 0x8a00, 0x6b00, 0x0c00, 0x0000, 0x0700,
0x0000, 0x1200, 0x7300, 0x4d00, 0x8000, 0x2000, 0x0000, 0x0800, 0x0000,
0x4e00, 0x6f00, 0x8a00, 0x8300, 0x0c00, 0x0000, 0x0900, 0x0000, 0x1200,
0x8b00, 0x4d00, 0x9800, 0x2000, 0x0000, 0x0a00, 0x0000, 0x4e00, 0x8800,
0x8a00, 0x9c00, 0x0c00, 0x0000, 0x0b00, 0x0000, 0x1200, 0xa300, 0x4d00,
0xb000, 0x2000, 0x0000, 0x0c00, 0x0000, 0x4e00, 0xa000, 0x8a00, 0xb400,
0x0c00, 0x0000, 0x0d00, 0x0000, 0x1200, 0xbc00, 0x4d00, 0xc900, 0x2000,
0x0000, 0x0e00, 0x0000, 0x4e00, 0xb900, 0x8a00, 0xcd00, 0x0c00, 0x0000,
0x0f00, 0x0000, 0x9000, 0x5a00, 0xe000, 0x6700, 0x2000, 0x0000, 0x1000,
0x0000, 0xe400, 0x5700, 0x2000, 0x6b01, 0x0c00, 0x0000, 0x1100, 0x0000,
0x9000, 0x7300, 0xe000, 0x8000, 0x2000, 0x0000, 0x1200, 0x0000, 0xe400,
0x6f00, 0x2000, 0x8301, 0x0c00, 0x0000, 0x1300, 0x0000, 0xf300, 0x2100,
0x2500, 0x2e01, 0x2800, 0x0000, 0x1400, 0x0000, 0x2800, 0x1e01, 0x5d00,
0x0a01, 0x0c01, 0x0000, 0x1500, 0x0000, 0x6500, 0xf100, 0xb000, 0x0800,
0x2001, 0x0000, 0x1600, 0x0000, 0xbf00, 0xf100, 0x0a00, 0x0801, 0x2001,
0x0000, 0x1700, 0x0000, 0x9000, 0xa300, 0xe000, 0xb200, 0x2000, 0x0000,
0x1800, 0x0000, 0xe400, 0xa200, 0x2000, 0xb601, 0x0c00, 0x0000, 0x1900,
0x0000, 0xe400, 0xb700, 0x2000, 0xc401, 0x2800, 0x0000, 0x3800, 0x0000,
0x0000, 0x2680, 0x0001, 0x0000, 0x0100, 0xe900, 0x0000, 0x0000, 0x0200,
0xb8c0, 0x0000, 0x0000, 0x0200, 0x4e80, 0x0000, 0x0000, 0x0400, 0x5140,
0x0000, 0x0000, 0x0500, 0x8dc0, 0x0000, 0x0000, 0x0500, 0xe2c0, 0x0000,
0x0000, "\000"
0
END
|
|
|
|
|
it looks very unicode like double byte charset would be my guess
-= Technomancer =-
|
|
|
|
|
I wish to play a WAV file on a buton press, that's OK, but what I would like to do now is play the WAV file over and over again while the button is being held down.
Currently the WAV file is only played when you release the button.
The PC is running Windows 2000, any suggestions.
grahamfff
|
|
|
|
|
Use the PlaySound() function specifying the SND_LOOP flag.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it! Honoured as one of The Most Helpful Members of 2004
|
|
|
|
|