|
Thankyou for the help. Evidently I wasn't including the libraries in the right area in the project setup. Once I moved everything over to the additional dependencies area it all seemed to work out. I appreciate the help.
|
|
|
|
|
I have made my own compressed sound format, and i wish to play it as i decompress it back to pcm format.
The problem is this.
I wanna play them on the fly, as i decompress the music. Each music frame decompressed is 256 samples.
So a compressed music file, consists of alot of frames.
The few methods i have found to play music, requires a buffer to the entire length of the PCM data. Since that would require alot of ram, i see that as a problem, besides the fact, that it decompresses the entire file then plays the music.
|
|
|
|
|
I'm having a great deal of trouble with a Wizard97 design...
Briefly, Page 2 of the Wizard has 3 Radio Buttons.
Clicking "Next" takes you to page 3.
But how do I know what Radio Button was clicked from Page 2?
I would like to attach my code to this message, but I don't see how to do it. (?)
The code is very simple, but just doesn't seem to work and I can't see why it won't work!
|
|
|
|
|
if (((CButton*)GetDlgItem(IDC_MY_RADIO1))->GetCheck() == BS_CHECKED) {
}
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
I wish it would work that way, but alas, it doesn't.
I keep getting an error message...
c:\Projects\Simple Wizard\Wizard.cpp(299): error C2039: 'GetChecked' : is not a member of 'CWnd'
|
|
|
|
|
The function you are looking for is GetCheck()
it returns one of BST_UNCHECKED , BST_CHECKED or BST_INDETERMINATE
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Walliams (Little Britain)
|
|
|
|
|
Now I get...
c:\Projects\Simple Wizard\WC_Wizard.cpp(295): error C2039: 'GetCheck' : is not a member of 'CWnd'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afxwin.h(1913) : see declaration of 'CWnd'
|
|
|
|
|
Why not break the code down into easier to read lines:
CButton* pButton = (CButton*)GetDlgItem(IDC_MY_RADIO1);
ASSERT(pButton != NULL);
if (pButton->GetCheck() == BST_CHECKED)
{
}
It always helps to breakdown the code.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Walliams (Little Britain)
|
|
|
|
|
first, a made an error on the function, but someone else correct the mistake for me.
secondly, GetCheck() is a member of CButton, not CWnd...
if stdafx.h is included into your project, you shouldn't encounter such error (C2039).
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
You are missing an open bracket at the start of the if statement.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Walliams (Little Britain)
|
|
|
|
|
Antony M Kancidrowski wrote:
You are missing an open bracket at the start of the if statement
correct... and corrected
but you understood what i would like to explain, isn't it ?
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
I would like to set the listcontrol so that items (in the first column) *cannot* be selected. This can be done in a listbox, but is there any way to fix a listcontrol to behave this way ?
Thanks in advance,
Raymond Mercier
|
|
|
|
|
Hey,
Well a short question realy.
What does the ^ do in C++?
example:
int number = 0;
number ^= 1;
the output for number is 1. When in math would be 0.
Thanks.
humpa humpa
|
|
|
|
|
^ is the bitwise exclusive-or operator
SO :
0x1100
^ 0x1010
-----------
= 0x0110
that's why
number ^= 1;
means
number = number ^ 1;
means
number = 0 ^ 1; // == 1
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
I see. Thanks for your quick answer.
humpa humpa
|
|
|
|
|
http://www.codeproject.com/cpp/bitbashing.asp[^]
"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!
|
|
|
|
|
Hi,
I'm using the following code to try to get a double variable from an edit box, but I keep getting an error: c2660
<br />
double x=0;<br />
CString strx;<br />
......<br />
<br />
for(int i=0;i<K,i++)<br />
{<br />
::GetDlgItemText(IDC_WELLRAD,strx);
x=atof((LPCTSTR)strx);<br />
...<br />
}
How can I fix this error, please? what is HWND hdlg??
|
|
|
|
|
aaadetos wrote:
what is HWND hdlg??
Is the handle to the dialog window.
Assuming you are running this code in a CDialog derived class.
You could try something like this:
HWND hWndDlg = GetSafeHwnd();
You can then use this to get the handle to the control.
HWND hWndCtrl = ::GetDlgItem(hWndCtrl, IDC_WELLRAD);
Then use the control handle with GetWindowText()
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Walliams (Little Britain)
|
|
|
|
|
I'm sorry. Please see the revised code: i meant to type: GetDlgItemText , not GetDlgItem . the function in which I'm using GetDlgItemText is not in the CDialog class. How would I use GetSafeHwnd() then?
|
|
|
|
|
The easiest way is to have a pointer to your dialog class within the class that you have the code.
Header file
CMyDialog* m_pMyDialog;
CPP file
HWND hWnd = m_pMyDialog->GetSafeHwnd();
etc...
IMPORTANT: Note that you need to set m_pMyDialog to point at your dialog class before using it.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Walliams (Little Britain)
|
|
|
|
|
CString strEdit;
((CEdit*)GetDlgItem(IDC_MY_EDIT))->GetWindowText(strEdit); TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
You do not need to cast to CEdit as CWnd will do
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Walliams (Little Britain)
|
|
|
|
|
[Perplexed!]
I already tried to do the following:
<br />
{<br />
...<br />
CString strx;<br />
CDialog *pDialog;<br />
<br />
pDialog -> GetDlgItemText(IDC_WELLRAD,strx); <br />
x = atof((LPCTSTR)strx);<br />
...<br />
}
and toxcct's code as well. The first gave an ASSERT error while the other gave an unhandled exception in mfc42d.dll, in wincore.cpp ->C:\...\MFC\SRC\WINCORE.CPP at the line *** below:
<br />
HWND hWnd = ::GetDlgItem(m_hWnd, nID);<br />
if (hWnd != NULL)<br />
{<br />
int nLen = ::GetWindowTextLength(hWnd);<br />
::GetWindowText(hWnd, rString.GetBufferSetLength(nLen), nLen+1);
rString.ReleaseBuffer();<br />
}<br />
I'm trying to get the value of an edit box for use in a function outside CDialog, which would carry out computations on the value entered by a user. I don't understand why i get these errors.
|
|
|
|
|
aaadetos wrote:
I'm trying to get the value of an edit box for use in a function outside CDialog, which would carry out computations on the value entered by a user.
The function in which you are getting the Text is outside CDialog??
|
|
|
|
|
Yes, it is. The text: numerical data of type double, is to be used as a variable in a math computation in a function outside of CDialog.
|
|
|
|