|
sorry can you please post the code example
int fig = 2;
string string1;
thanks
|
|
|
|
|
try using string streams from sstream.h
int fig = 2;<br />
std::string string1;<br />
<br />
std::ostringstream oss;<br />
oss << fig;<br />
string1 = oss.str();
|
|
|
|
|
int fig = 2;
string string1;
strstream stream;
stream << fig << ends;
string1 = stream.str();
"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
|
|
|
|
|
Don't use streamstring, it is VERY SLOW.
sprintf works must faster.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
CString str;
int i=5;
str.Format("The integer Number is : %d",i);
|
|
|
|
|
The fastest method is the following:
int i = 5135;
char String [64]; // REALLY big number
_itoa (i, String, 10);
Using the other methods discussed are slow and involve the memory manager which will cause all sorts of performance issues.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
i am writing a file in a loop but dont want to rewrite over the file is there a command i can put in so as to rename the file to example a integer so i can bump the integer and the file name will be different for each iteration of the loop
cheers
|
|
|
|
|
|
CFile::Rename
SHFileOperation
"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
|
|
|
|
|
Wrong forum!
Don't try it, just do it!
|
|
|
|
|
Hi there,
I'm looking for a (open-source) library to implement MFC SDI/MDI control bars, which have to feature to fix their vertial size. I tried Prof-UIS, but I haven't found a good possibility to fix the vertical size. I want to create a child window inside that control bar, which contains controls.
That has the problem that when I resize the control bar, then the buttons will be outside the client rect.
Any suggestions?
Thx
Don't try it, just do it!
|
|
|
|
|
I have 2 code *.cpp & *.h. I want to add 2 this file into MFC program, but I can not......
anyone can help me (point me step by step), thanks!
my E-mail: khonglaai2002@yahoo.com
|
|
|
|
|
Under the Project menu is an Add sub-menu. From there you can add files to an existing project.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
hi All... I am unable to adjust the output volume of media. Specifically, I've been working with DirectShow, playing .mpg, .mp3, .avi, .wmv... There's a IBasicAudio class that I can't make work, tho it seems like it should.
to clarify an example, let's say there's 2 media files, one recorded with low quality/volume, one recorded with high q/v... does anyone have any ideas how I could programmatically adjust the volume as they're played?? doesn't have to be DirectShow, but it'd be nice if it was...
thanks All
barnje07
|
|
|
|
|
Does this article help?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
I guess I didn't explain my problem as clearly as I had thought. I need to adjust the volume of the stream, not the device. For example, if two media are playing simultaneously, and they differ vastly in volume, how can 1 stream be adjusted such that the output is roughly the same?
any ideas?
|
|
|
|
|
barnje07 wrote:
any ideas?
Not a one. Sorry.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
I am developing directx filters based application and while building the project i am facing this problem. I think this problem is a general one.
CaptureFilter error LNK2020: unresolved token (0A000014) new
CaptureFilter error LNK2020: unresolved token (0A000029) delete
Can you tell me why i am getting this error?
thankx
|
|
|
|
|
BOOL CFx2Dialog::OnInitDialog()
{
CDialog::OnInitDialog();
int devices = USBDevice->DeviceCount();
CCyUSBEndPoint* endpt;
int d = 0;
do {
USBDevice->Open(d);
d++;
} while ((d < devices ) && (USBDevice->VendorID != 0x8888) && (USBDevice->ProductID != 0x8888));
if((USBDevice->VendorID == 0x8888) && (USBDevice->ProductID = 0x8888))
{
epts = USBDevice->EndPointCount();
// Load the endpoint combo boxes
for (int i=1; i<epts; i++)="" {="" skip="" endpoint="" 0,="" which="" we="" know="" is="" the="" control="" endpoint
="" endpt="USBDevice-">EndPoints[i];
if (endpt->Attributes == 2)
{
if(endpt->Address & 0x80) // Bulk
sprintf(s, "EndPoint IN 0x%02X", endpt->Address);
else
sprintf(s, "EndPoint OUT 0x%02X", endpt->Address);
m_ComBox1.AddString(s);
sprintf(s, "%d", endpt);
AfxMessageBox(s);
m_ComBox1.SetItemDataPtr(m_ComBox1.GetCount()-1,endpt);
}
}
}
endpt=(CCyUSBEndPoint*)m_ComBox1.GetItemDataPtr(0);
sprintf(s,"%d",endpt);
AfxMessageBox(s);
return TRUE;
}
from the last AfxMessageBox(s) function I get the result of "0",But from the earlier AfxMessageBox(s) function I can get the value of endpt.Why can not I get the endpt's value? If I set endpt=(CCyUSBEndPoint*)m_ComBox1.GetItemDataPtr(0); I can get the value of endpt as before? Is there any error with SetItemDataPtr(**) or GetItemDataPtr(*)?
Thank you!
|
|
|
|
|
BOOL CFx2Dialog::OnInitDialog()
{
CDialog::OnInitDialog();
int devices = USBDevice->DeviceCount();
CCyUSBEndPoint* endpt;
int d = 0;
do {
USBDevice->Open(d);
d++;
} while ((d < devices ) && (USBDevice->VendorID != 0x8888) && (USBDevice->ProductID != 0x8888));
if((USBDevice->VendorID == 0x8888) && (USBDevice->ProductID = 0x8888))
{
epts = USBDevice->EndPointCount();
// Load the endpoint combo boxes
for (int i=1; i<epts; i++)="" {="" skip="" endpoint="" 0,="" which="" we="" know="" is="" the="" control="" endpoint
="" endpt="USBDevice-">EndPoints[i];
if (endpt->Attributes == 2)
{
if(endpt->Address & 0x80) // Bulk
sprintf(s, "EndPoint IN 0x%02X", endpt->Address);
else
sprintf(s, "EndPoint OUT 0x%02X", endpt->Address);
m_ComBox1.AddString(s);
sprintf(s, "%d", endpt);
AfxMessageBox(s);
m_ComBox1.SetItemDataPtr(m_ComBox1.GetCount()-1,endpt);
}
}
}
endpt=(CCyUSBEndPoint*)m_ComBox1.GetItemDataPtr(0);
sprintf(s,"%d",endpt);
AfxMessageBox(s);
return TRUE;
}
from the last AfxMessageBox(s) function I get the result of "0",But from the earlier AfxMessageBox(s) function I can get the value of endpt.Why can not I get the endpt's value? If I set endpt=(CCyUSBEndPoint*)m_ComBox1.GetItemDataPtr(0); I can get the value of endpt as before? Is there any error with SetItemDataPtr(**) or GetItemDataPtr(*)?
|
|
|
|
|
Hi
Check whether you have Sort style (CBS_SORT) set for combobox. May be you forget it to uncheck. If you need in any case sorting instead of passing m_ComBox1.GetCount()-1 to SetItemDataPtr method use the value returned in a call to m_ComBox1.AddString(s); If you have sorting enabled string added is not necessarily the last one to which you try to set endpt
Regards
Yeghia
|
|
|
|
|
Friends,
I need to develop a client side application in VC++ that has to communicate with some web-service.
I never did such work before. So can you guide me how to communicate with web service in unmanaged C++. Do i need to take winsock approach ?
Imtiaz
|
|
|
|
|
|
In SDI CView-based application, in OnOK() of CDialog class, how to call a function in CView?
For example:
when clicking a button on a dialog, invoke a funtion in CView to invalidate drawing on the view
thanks very much!
don't stop me now!!!
|
|
|
|
|
unidentify wrote:
In SDI CView-based application, in OnOK() of CDialog class, how to call a function in CView?
Using OnOK() will be not right method, i think you better use Custom Window Messages!!!
keep smilling.....b'coz smile is the shortest distance between people....
|
|
|
|