|
Which class does GetCollect belongs to ?
-- modified at 4:24 Tuesday 2nd January, 2007
How it is declared ? If it is out parameter, you are not using its value further. Instead you are using its return value.
|
|
|
|
|
I am receiving some voice file from the network i am storing it into a buuffer using Receive() function and that is a sound file which is converted into a wave format. I am trying to play that buffer here in the recieving side using
PlaySound(Buff,NULL,SND_MEMORY|SND_ASYNC)
but i could not here anything after playing.
But if i am saving that buffer into a .wav file and play it by a doubleclick on the file it plays the sound. Where might be the problem?
Thanks in advance!
KIRAN PINJARLA
|
|
|
|
|
kiran.pinjarla wrote: PlaySound(Buff,NULL,SND_MEMORY|SND_ASYNC)
I assume, Buff contains sound bytes you recevied. But what MSDN suggests PlaySound has first parameter which points to image file. In other words,its should be stored on disk.
|
|
|
|
|
I found
A sound event's file is loaded in RAM. The parameter specified by pszSound must point to an image of a sound in memory.
in the MSDN. I guess that mean it should be stored in the RAM rather than disk.
That's what i did (Buff.
Is't it?
KIRAN PINJARLA
|
|
|
|
|
kiran.pinjarla wrote: I guess that mean it should be stored in the RAM rather than disk
Agree, but in your case it is pointing to buffer rather than file name.
|
|
|
|
|
What happens if you do this:
PlaySound(Buff,NULL,SND_MEMORY|SND_SYNC)
Are you sure Buff is valid for the duration of playback?
|
|
|
|
|
Are you sure Buff is valid? did you trace when it filled?
|
|
|
|
|
I'm working on a project and was wondering if there is a class like C#'s MailMessage (but for C++, I'm using visual studio 2003) that will allow me to write a program that will automatically send me an error log every month or so. I'm kind of new to the C++ world and would appreciate any help. Thanks!!
|
|
|
|
|
There's nothing built into the language, no. MAPI is the easiest way to go.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
If you need simple email alert notifications from a service and don't plan on implementing more than the basics, you can easily derive a basic mail client from RFC 2821 & 2822. RFC 2822 is probably the simpler and the more helpful of the two for implementing simple alerts.
Using the winsock2 api, just write a class that performs the steps you use when testing an SMTP server with a telnet session.
|
|
|
|
|
Blat[^] is a C library that lets you send emails. It's pretty horrible code but it does the job.
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.4 [^]: A free RSS/Atom feed reader with support for Code Project.
|
|
|
|
|
arbster wrote: studio 2003) that will allow me to write a program that will automatically send me an error log every month or so. I'm kind of new to the C++ world and would appreciate any help. Thanks!
Mail![^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and you
|
|
|
|
|
See Email on the http://www.codeguru.com/cpp/i-n/internet/
|
|
|
|
|
could someone pls help me i am trying to create a a wav to mp3 convertor but i have no clue how to start ,could someone guide me to how to create the converter
ty in advance
|
|
|
|
|
Dearch on Codeproject or search Googel for "madlib".
|
|
|
|
|
Did you search on the codeproject(Audio/Video)?
|
|
|
|
|
need to make a dsn less connection to a file whose path is known. my present code connects to dsn..
m_retcode = SQLAllocHandle(SQL_HANDLE_DBC, m_henv, &m_hdbc);
m_retcode = SQLDriverConnect(m_hdbc, NULL, (unsigned char *)pConString, SQL_NTS, NULL, 0, &m_constrout, SQL_DRIVER_NOPROMPT);
what should the parameters be now?
thanks
apoorva
|
|
|
|
|
Have you come across this article already? DSN-less[^] If not, check it out as it has some really useful info on DSN-less connection strings
|
|
|
|
|
Hi all,
I am just new to progamming .I am writng small twenty card game.What I want I dont repeat the cards again to next player after first user received.And in real I wana do game with more than two player.But in my code have some problem with print out total score that who win or lose (only two player is ok).I can get total score by comparing two player. But I want to compare with more than two players.How can I do with my code.
here is my simple code.. Thanks in advance.
#include <iostream>
#include <cstdlib>
#include <ctime>
#include <string>
using namespace std;
void display();
void intro();
int your_total(int urcard);
int comp_total(int compcard);
struct{
int face;
unsigned int value;
}
card[13] =
{ {'2', 2},{'2', 3},{'2', 4},
{'5', 5},{'6', 6},{'7', 7},
{'8', 8},{'9', 9},{'X', 10},
{'J', 13},{'Q', 12},{'K', 11},
{'A', 1}
};
char suit[4]={'D','C','H','S'};
int main()
{
intro();
display();
return 0;
}
void intro()
{
cout<<"simple twenty one card"<<endl;
cout<<"------------------------"<<endl;
cout<<"Total number gotta cut out upon number21!"<<endl;
cout<<"But u can have only 5 cards in maximum"<<endl;
cout<<"<TenX=10,King=11,Queen=12,Jack=13,Ace=1>"<<endl<<endl;
}
int your_total(int urcard)
{
int urtotal=0;
srand((unsigned)time(0));
cout<<"How many cards u want?(up to 5 cards)"<<endl;
cin>>urcard;
if (urcard>5)
cout<<"You could not get more than five cards!"<<endl;
else
{
cout<<" Ur card"<<endl;
for (int ucard=0;ucard<urcard;ucard++)
{
int x = rand() % 13;
char d;
d=rand()%4;
cout<<" |"<<suit[d];
printf("%c| ", card[x].face);
urtotal+=card[x].value;
if(urtotal>42)
urtotal=urtotal-30;
else if(urtotal>31&&urtotal<42)
urtotal=urtotal-20;
else if(urtotal>21&&urtotal<32)
urtotal=urtotal-10;
}
}
return urtotal;
}
int comp_total(int compcard)
{
srand((unsigned)time(0));
cout<<endl<<"How many cards you want computer?"<<endl;
int lowest=2, highest=5;
int range=(highest-lowest)+1;
int total_num=0;
for(int index=0; index<1; index++){
compcard= lowest+int(range*rand()/(RAND_MAX + 1.0));
cout <<compcard<<endl;
}
cout<<" My cards"<<endl;
for (int Ccard=0;Ccard<compcard;Ccard++)
{
int x = rand() % 13;
char d;
d=rand()%4;
cout<<" |"<<suit[d];
printf("%c| ", card[x].face);
total_num+=card[x].value;
if(total_num>42)
total_num=total_num-30;
else if(total_num>31&&total_num<42)
total_num=total_num-20;
else if(total_num>21&&total_num<32)
total_num=total_num-10;
}
return total_num;
}
void display()
{
int comptotal, urtotal,person=0,computer=0, compscore=0,urscore=0,draw=0;
const int high=21;
char cond;
int ur;
do{
srand((unsigned)time(0));
urtotal=your_total(person);
comptotal=comp_total(computer);
cout<<endl<<"I have "<<comptotal<<" and you have "<<urtotal<<" so ";
if(comptotal<=high&& urtotal<comptotal)
{
cout <<"I win! "<<endl;
compscore++;
}
else if(comptotal<=high&& urtotal>high)
{
cout <<"I win! "<<endl;
compscore++;
}
else if (urtotal<=high&& urtotal>comptotal)
{
cout<<" you win!"<<endl;
urscore++;
}
else if (urtotal<=high&& comptotal>high)
{
cout<<" you win"<<endl;
urscore++;
}
else
{
cout<<"no win"<<endl;
draw++;
}
cout<<endl<<"Wana play again(n/y?)"<<endl;
cin>>cond;
}while(cond=='y');
cout<<"I win: "<<compscore<<endl<<"U win: "<<urscore<<endl<<"Draw : "<<draw<<endl;
cin>>ur;
}
|
|
|
|
|
How to create custom controls using XAML in visual studio 2005?
|
|
|
|
|
You can't, in C++. You need to use C# or VB.NET.
You also can't without installing WPF, obviously.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hi guys
i want to ask how to remove a program in startup by code or by CMD
if any one know solution in java it'll be great
thnx
|
|
|
|
|
Alinuxcs wrote: if any one know solution in java it'll be great
if you know how to access registry through JAVA, then key location is
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and you
|
|
|
|
|
Sir
the program that i want to remve is not in this location
i could found it only in msconfig
but its key in registry cant find it in this location
neither local machine or current user
thank u any way
|
|
|
|
|
Is there anybody out there that has managed to get this counter to work?
I am trying to expose an average timer from my application,
but feeding exactly the same inputs into the Win32 API
and the .Net framework yields two different results,
performance monitor reports the fixed value of 1200 for the Win32 logic
performance monitor reports the correct average time per operation
for the .Net framework logic
Into the Average Timer I am feeding the elapsed time
from the difference of two calls to QueryPerformanceCounter
Into the Average Base I am feeding the number of operations performed
(which is typically 1)
I have found references on the net where other people have encountered this problem - but no solution
I would be VERY grateful for any guidance...
Regards,
Martin...
-- modified at 18:35 Monday 1st January, 2007
|
|
|
|