|
hi gurus,
how to detect the sound input and show this like messenger voice chat?
Thanks.
Ivan Cachicatari Blog[^]
www.latindevelopers.com
-- modified at 10:48 Thursday 13th July, 2006
|
|
|
|
|
Hello,
This may seem like a simple question, but in Visual Studio is it possible to set coding style, specifically:
I like to write like this:
method<br />
{<br />
for<br />
{<br />
statement<br />
}<br />
}
but Visual Studio auto formats it like this (and I hate it!):
method<br />
{<br />
for<br />
{<br />
statement<br />
}<br />
}
How can I set it my way?
-- modified at 10:21 Thursday 13th July, 2006
|
|
|
|
|
your formatting got lost (try <pre> around your code).
if you're asking about bracket indentation, there's a setting in Tools / Options called "Indent braces" that might help
Cleek | Image Toolkits | Thumbnail maker
|
|
|
|
|
Hi together,
I tried to compile the fdstream classes from www.josuttis.com with VC6, but didn't succeed. I cut down the code to what doesn't work:
#include <streambuf>
#include <istream>
class mybuf : public std::streambuf
{
protected:
int m_i;
public:
mybuf(int i) : m_i(i) {}
};
class myistream : public std::istream
{
protected:
mybuf buf;
public:
myistream(int i) : std::istream(0), buf(i) {}
};
int main(int argc, char* argv[])
{
myistream strm(5);
return 0;
} On this code I get the following two errors:
error C2512: 'basic_istream<char,struct std::char_traits<char> >' : no appropriate default constructor available
error C2614: 'myistream' : illegal member initialization: 'istream' is not a base or member
I can't figure out what's the problem. It seems std::istream(0) isn't accepted, but I don't know why.
Can anyone help me?
Thank you very much in advance.
Regards,
Marcus.
|
|
|
|
|
khb wrote: error C2512: 'basic_istream<char,struct std::char_traits<char=""> >' : no appropriate default constructor available
std::istream is a typedef for basic_istream<char, char_traits<char> >. basic_istream has the following constructor:
explicit basic_istream(basic_streambuf<Elem, Tr> *_Strbuf, bool _Isstd = false);
Do you really want your streambuf to be null? If so, try casting 0 as follows:
std::istream((std::streambuf*)0);
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
|
|
|
|
|
Yeah, the streambuf should to be null, as in the original implementation it is replaced by an instance of the inherited streambuffer class using rdbuf() .
However, casting 0 to std::streambuf* results in the same errors.
If you have another idea on how I get the istream constructor called correctly, I would be really happy.
Thank you very much for your help,
Marcus.
|
|
|
|
|
Strange. Not sure why that would be a problem ... I was able to compile your code using g++ with no problems.
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
|
|
|
|
|
The original author is using VC6.
For the love of god, VS2005 Express is free. Get it.
earl
|
|
|
|
|
I realize that. Generally, GNU is more strick about things like this that Microsoft's compiler.
I have VS2005 Pro ... but it doesn't run on Linux, which is what I have to use at work.
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
|
|
|
|
|
Sorry Zac, I meant to reply to the original author.
VS6 is broken in some ways; I just think that trying to make things work on it is kind of silly when you have a far superior alternative available for free. And the gnu compiler chain is quite nice, but the 3.x series is far superior to VS6 in terms of the probabilty of standard-conforming code compiling and working.
earl
|
|
|
|
|
earl wrote: And the gnu compiler chain is quite nice, but the 3.x series is far superior to VS6 in terms of the probabilty of standard-conforming code compiling and working.
Agreed. But sadly, there are many companies that still do all their development in VS6.
If the OP hasn't already done so, he might want to download the fixed STL from Dinkumware's site (they are the ones that wrote the version that ships with VS). There were several bugs that were fixed, not sure if this might be one of them.
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
|
|
|
|
|
Unfortunately, I have to stick to VS6. It's really bad that the behavior might come from bugs in the STL Can I simply replace the problematic STL classes? If so, can you provide the Link to the Dinkumware's site?
Thank you for you discussion. That brought some light into the dark. I already started thinking that I'm getting to old for understanding C++ Therefore I like your slogan, Zac!
Regards,
Marcus.
|
|
|
|
|
I think Microsoft has a link in MSDN for a service pack download that does it. But here is Dinkumware's site: http://www.dinkumware.com/.
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
|
|
|
|
|
Thanks a million!
Regards,
Marcus.
|
|
|
|
|
Marcus,
There is simply quite a bit of valid code that the VS6 compiler is unable to compile. This in turn limits the quality of the STL that can be provided for it. At the end of the day, it's an 8 year old compiler that was written before the C++ standard was finalized IIRC.
earl
|
|
|
|
|
Hi,
In my project i have to initially display the data from database and also i have to provide the facility to the user to change the value. I have done it in onitdialog message handler where the recordset operations have already handled.
i compiled it successfully but while running i got the assertion saying that
assertion in .exe file
File:afxcmn.inl
line:375
plz help me.
Thanks in advance.
tejaswini
|
|
|
|
|
Can you please make it a little more clear what exactly you did in OnInitDialog() ?
|
|
|
|
|
BOOL CCmpDataEntryDlg::OnInitDialog() //CmpDataEntryDlg is my propertysheet
{
m_SpinDropRate.SetRange(5,19); //to set the range for spin control
m_pSet = new CCampaignSet(); //this is my recordset
if(!m_pSet->IsOpen())
{
CWaitCursor wait;
m_pSet->Open();
}
CPropertyPage::OnInitDialog();
UpdateData(FALSE);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
|
|
|
|
|
tejaswini.g wrote: CPropertyPage::OnInitDialog();
This statement must be called first (otherwise the controls do not get created).
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Thnak u very much
Tejaswini
|
|
|
|
|
Hi all,
I want to Print the Document in Specified Document. I am unable to Decide the Margin's while Printing. Please Help me out.
//===========================================================================
CPrintdlg print(FALSE,PD_AllPages,this);
if(print.DoModel()== IDOK)
{
CDC dcPrint;
dcPrint.Attach(print.GetPrinterDC();
DOCINFO doc; // Setting the Printer Documents....
if(dcPrint.StartDoc(&doc > 0)
{
dcPrint.StartPage();
int x,y;
x = GetDeviceCaps(...); //x,y Cooridinates for Printer.
y = GetDeviceCaps(...);
dc.print(xloc,yloc,"Text"); //----> I have doubt here.
//---> How to Set the Margin for the Page Here.
dcPrint.EndPage();
}
}
UDAY
|
|
|
|
|
As I know:
1) there is no idea to get margin info of a printer.
2) margins can not be adjusted by VC applications.
it is very strange that same printer may have different margins if printed by different PCs.
---- You may ask for another thing?
-- modified at 7:16 Thursday 13th July, 2006
|
|
|
|
|
hi,
TO set Margings mean how to calculate the space it top,left,bottom,right while priting. which is done in VC++ application.
I want to Calcualte the Margin in VC++ only not in Priter.
You understand.
Thanks
uday.
|
|
|
|
|
hi
tell me about WM_COMMAND function in mfc with example or code
to clear my concept
Ashish Dogra
MCA
Noida
|
|
|
|
|
The WM_COMMAND message is sent when the user selects a command item from a menu, when a control sends a notification message to its parent window, or when an accelerator keystroke is translated.
|
|
|
|