|
Kakan,
That's interesting, I never though of using code to determine the Endian=Ness. I'll remember that.
Azteke
|
|
|
|
|
Hi, I'm working on a project where I need to do the following:
1) Constantly (at some defined rate that approximates "constant") sample the microphone input.
2) Take the input that is read and determine the frequency of the tone being input.
If it's possible, number 2 would run on each execution cycle. The idea is to have a big if-block that performs different logic depending on what range the frequency is in.
What I need is an API (and a document to help explain it would be helpful) that will allow me to do this sampling/frequency determination. I'm new to PC programming for the most part, coming from about a year and a half of embedded (fairly basic) development, but I'm excited to start learning! I do know the basics of MFC apps/dialogs and I have VS2005 Professional at my disposal.
The one last thing is that I would like this to run on Linux also eventually so if there's a good API that is cross-platform that would be ideal if it doesn't add too much trouble.
Much appreciated,
Tim
|
|
|
|
|
|
Ressell, after a quick scan-through I think that third link is exactly what I need. Thanks. Does anyone know of a cross platform API though for future Linux ports?
Thanks,
Tim
|
|
|
|
|
Thanks
About Linux:
I don't know anything about it to help you, sorry.
You can start a new thread,...but think also to post it in another forum: here more than 90% of members are expert on Windows. I don't want to mean that here noone can help you, but that it is not so impossible.
good luck
Russell
|
|
|
|
|
Hello,
Good Day!
Step 1:
struct user
{
unsigned short us_nbs;
unsigned short us_debit;
unsigned short us_flowctrl;
};
Step 2:
In another header file contains this:
"class C_User : public CObject, public user"
Step 3:
class C_Subscriber : public C_User
Step 4:
C_Subscriber subdeviceSubs = *lpSubscr;
Step 5:
I got that us_flowctrl value is "0" by executing this statement : subdeviceSubs.us_flowctrl. How?
Thanks in advance
Raja Ratheesh
-- modified at 1:56 Friday 14th September, 2007
|
|
|
|
|
rajaratk wrote: C_Subscriber subdeviceSubs = *lpSubscr;
What is this lpSubscr?
- NS -
|
|
|
|
|
Instance of
typedef struct user far *LPUSER;
|
|
|
|
|
So you are getting values changed...
class C_User : public CObject, public user
class C_Subscriber : public C_User
typedef struct user far *LPUSER
C_Subscriber subdeviceSubs = *lpSubscr;
So the C_Subscriber has CObject in the first memory area. I doubt that it could be the problem.
Dont you get any compilation error by "C_Subscriber subdeviceSubs = *lpSubscr;" ?
- NS -
|
|
|
|
|
Hi friends........
I have a question on tab oreder.......?
How the tab order will effect the visibility of controls placed on a dialog?
Thank u in advance.....
Sairam Madem
|
|
|
|
|
The WS_VISIBLE style effects the visibility of controls on a dialog.
If you meant the Z-order, the controls are created in the order they
appear in the DIALOG resource, so initially, the first control will be at the
bottom of the z-order, the last control at the top.
Setting the tab order sets the order of the control definitions in the resource.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
it is a simple logic.
the control that has the least taborder will be placed first on the dialog.
then any other control with a higher taborder will be placed next.
this means that,
the later control, if it is located at the same place as the former control will obviously overlap the former.
in the past, once i faced the same problem. i had to struggle for two days to find out that taborder is the reason for the controls that are invisible.
is int it very funny?
gud luck.
|
|
|
|
|
chandu004 wrote: i had to struggle for two days to find out that taborder is the reason for the controls that are invisible.
- NS -
|
|
|
|
|
Hopefully this makes sense, here goes:
I've upgraded my MSVS C++ 6.0 MFC application to MSVS C++ 2005. All went well - no big issues - but here's what I can't figure out: In my resource browser my MFC dialog app appears to have that updated .NET style, i.e. rounded glossy buttons & list controls. That's how I would like it to appear when built; however, it still has that "old-school" MFC look with the square edge buttons and "3D" look.
I've created a new MFC dummy app just to compare headers and resource files in Araxis Merge to see if I could find some "switch" somewhere that needs to be set. The dummy app has that contemporary .NET look. I can't seem to figure out what I need to set to accomplish this task.
Any help or advice would be GREATLY appreciated.
Thanks,
CMD
|
|
|
|
|
|
when somebody input some number,you need give out the number of middle.my code is follow:#include <iostream>
using namespace std;
void swap(int &a,int &b);
void main()
{
int n=0,k,m,j;
int*p=new int[n];
cin>>n;
k=n;
j=n;
m=n;
for(;n>0;n--)
{
cin>>p[n-1];
}
int x=1;
while(x)
{
x=0;
for(;k>0;k--)
{
if(p[k-1]
|
|
|
|
|
youbo wrote: the number of middle.
AKA the median.
youbo wrote: my code is follow
Congratulations.
"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
|
|
|
|
|
|
Is dash space dash exclamation exclamation an abbreviation for something?
"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
|
|
|
|
|
Here you go
void swap(int &a,int &b);<br />
void main()<br />
{<br />
int array_size=0,k,m,j;<br />
<br />
<br />
cin>>array_size;<br />
if(array_size < 1)<br />
return;<br />
int*p=new int[array_size];<br />
for(int i=0;i<array_size;i++)<br />
{<br />
cin>>p[i];<br />
}<br />
bool changed = true;<br />
int bubble_end = array_size - 1;<br />
while(changed)<br />
{<br />
changed = false;<br />
for(int i=0;i<bubble_end;i++)<br />
{<br />
if(p[i] > p[i+1])<br />
{<br />
swap(p[i],p[i+1]);<br />
changed = true;<br />
}<br />
}<br />
}<br />
if(array_size > 1)<br />
{<br />
if(array_size%2==1)<br />
cout<<p[array_size/2+1];<br />
else cout<<p[array_size/2]<<p[array_size/2+1];<br />
}<br />
else<br />
cout<<p[0];<br />
<br />
}<br />
void swap(int &a,int &b)<br />
{<br />
int c;<br />
c=a;<br />
a=b;<br />
b=c;<br />
}
-- modified at 8:50 Saturday 15th September, 2007
|
|
|
|
|
thank you first,but i couldn't find out the differences from your code to mine.i
have run it ,it appeared the same wrong that is not i need. my code in the same with yours is looked right....
|
|
|
|
|
Look more closely
void main()<br />
{<br />
int n=0,k,m,j;<br />
<br />
int*p=new int[n];<br />
<br />
cin>>n;<br />
k=n;<br />
j=n;<br />
m=n;<br />
for(;n>0;n--)<br />
{<br />
cin>>p[n-1];<br />
}<br />
int x=1;<br />
while(x)<br />
{<br />
x=0;<br />
for(;k>0;k--)<br />
{<br />
<br />
if(p[k-1] {<br />
swap(p[k-1],p[k]);<br />
x=1;<br />
<br />
}<br />
<br />
}<br />
}<br />
<br />
if(m%2==1){cout<<p[j/2+1];}<br />
else cout<<p[j/2]<<p[j/2+1];<br />
<br />
}<br />
void swap(int &a,int &b)<br />
{int c;<br />
c=a;<br />
a=b;<br />
b=c;} get this,it is also wrong.please have
|
|
|
|
|
I have problem with Casting ...
i've create class named Instrument { ... }
and in Dialog based MFC application
i have TreeView Control and in that at some point i am settin ItemData as "Instument" classs' Object
treeCtrl->SetItemData(instObject)//Instrument* to DWORD_PTR casting is done here
now at some point i need this data(object) back
so to take data
Instrument *instObject = treeCtrl->GetItemData(hItem); // error:
Please help me to cast DWORD_PTR back to Instrument Type ...
|
|
|
|
|
To reverse the effect of the first cast, cast the value back to the original type:
Instrument *instObject = (Instrument*) treeCtrl->GetItemData(hItem);
|
|
|
|
|
hey its not working ...
otherwise i would have done that ...
|
|
|
|