|
It is
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
|
it is the same format, RIFF wave files
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
How can I get a line using the getline() function from a text file, and put that line to an element in a vector and keep doing this until end of file? Here is what I have so far...
char str[255];<br />
vector <int> vecInt;<br />
<br />
if(re == 0)<br />
{<br />
get_rand();<br />
cout << "empty\n";<br />
system("pause");<br />
}<br />
else<br />
{<br />
cout <<"has something in it\n";<br />
do<br />
{<br />
data.getline(str, 255);<br />
vecInt.push_back();<br />
<br />
} while(!data.eof());<br />
<br />
sort(vecInt.begin(), vecInt.end());<br />
<br />
}
If it helps I know that the only things that will be in that specific 'data' file would be numbers 1-9 and characters 'X''O''D' I would very greatly appreciate it.
|
|
|
|
|
What do you want to put in the vector? just the numbers? the characters? in what form? in a string form or "inteligent" form, like numbers are stored in int and chars in strings?
Anyway the logic is the same, but ill explain for strings how to do:
you create a vectorof string, you loop on the file and you push
the strings in your vector.
if you need to convert from char to int check atoi atof strtol family.
isdigit, isalpha isalnum family could help you to identify what data you have
Hope this helps,
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
I need to put the whole getline into each into an element in the vector, how could I do this? When I do:
do<br />
{<br />
vecInt.push_back(data.getline(str, 255););<br />
} while(!data.eof());
I get an error.. please help me, I use
char str[255];<br />
vector <string> vecInt;
|
|
|
|
|
something like this:
typedef struct {
char[255];
} BUFF ;
vector vecInt (BUFF);
BUFF buffer;
do
{
data.getline(buffer.str, 255) ;
vecInt.push_back(buffer);
} while(!data.eof());
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Hi
Some time ago i send question here about BitBlt function in printing time.I had realized what its worked not correctly for my printer.And somebody suggest me to use StretchDIBits
function but same trouble arising,when i try to print a lot of text printer not worked(but when i print a little text all work fine)
This my code.
//Initialize printer DC m_prtDC
...
m_prtDC.StartDoc("Doc");
m_prtDC.StartPage();
StretchDIBits(m_prtDC.m_hDC,...);
m_prtDC.EndDoc();
m_prtDC.EndPage();
Where is my fault here???
And wheser exist a way to printed an Memory device context into printer.
Thank.
|
|
|
|
|
Although probably not solving your problem, it should probably be:
<br />
m_prtDC.StartDoc("Doc");<br />
m_prtDC.StartPage();<br />
StretchDIBits(m_prtDC.m_hDC,...);<br />
m_prtDC.EndPage();
m_prtDC.EndDoc();
"Time to give a Newtonian demonstration,
of a bullet, its mass and its acceleration."
-Stephen Hawking the gangsta rapper
|
|
|
|
|
How can i display Windows XP icons correctly(with alpha blending)? For pngs I use gdi+ but with .icos the alpha blending doesn't work...
|
|
|
|
|
|
There is a manifest in my project:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
version="1.0.0.0"
processorArchitecture="X86"
name="Microsoft.Windows.DoggDemo"
type="win32"
/>
<description>Fügen Sie hier die Anwendungsbeschreibung ein</description>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="X86"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
</assembly>
and my Programm use the windows themes. but it still don't work...
|
|
|
|
|
When I needed to do it, I only needed to add the manifest. and then I draw the icon with
m_pImageList->Draw(pDrawItem->pDC, nIndex, CPoint(xPos,yPos), ILD_TRANSPARENT); and the imagelist is create with ILC_MASK | ILC_COLOR32 flags
/Mathias
|
|
|
|
|
i draw my icons with gdi+ because my programm has to resize the icons with good quality or draw anything over it. so i can't use an imagelist...
|
|
|
|
|
How can we set the progress bar for a situation where we dont know how much time the operation takes like Windows displays the progress when copying/Moving a file it varies depending on read data speed.
Is there any estimation method. I saw one article on this site called Timed Progress but the code is not at all documented so i cannot understand what it is doing? Can anyone suggest something?
Vikash
|
|
|
|
|
What you can set in a progress bar, is the the range, the position and the step.
Lets say the range is 0 to 100, the starting position is 0 and the step is 1.
You should do the calculation in a way that in the end you have a hundred, You dont really care about the time, what you care about is to put your StepIt function in a way that it gets called on every "iteration" of the long process so the progress bar gets updated, this shows that you need somehow to know the number of iterations needed and based on that to calculate your step.
So for a range of 100 , an iterations number of N > 0 , the step should be 100 / N.
If you cant know the iterations number, you should try to "approximate it"
Hope this helps,
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Thank you. But suppose the process is spread over several loops then how do i do it.
|
|
|
|
|
Then divide by the number of loops too
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Does anybody have info on this subject ?
thanks
|
|
|
|
|
hi
I want to create a new desktop under WIN98.I may create a new desktop under win2000 with "createdesktop" API funtion ,under win98 how to do???
c++
|
|
|
|
|
|
Hello people
a newbie here. I want to display a BMP image by its path like the BMP file is located in my hard drive and i am using the file open dialog box to get the path i get the path but i dont know what to do next like the CBitmap class only takes resources string that are loaded from the exe how do i pass the path to the CBitmap class so that it opens the BMP from a location in my hard drive pleas help
Regards
Ahmed Ajmal
|
|
|
|
|
|
Hi!
I'm trying to use an ActiveX dll in my C++ program.
The dll is written in VB (not by me), so I generated a h-file from the idl.
Everything compiles, but when I run the test program I get
an error at the line with a below.
The code is really simple, but I don't know what is causing the
error. Anyone familiar with what might be wrong here? Thanks...
<br />
void TestDlg::OnOK() <br />
{<br />
HRESULT hRes;<br />
_cTheObj *pTheObj = NULL;<br />
<br />
UpdateData(TRUE);<br />
<br />
hRes = CoInitialize(0);<br />
<br />
if (SUCCEEDED(hRes))<br />
{<br />
hRes = CoCreateInstance(CLSID_cTheObj, NULL, CLSCTX_INPROC_SERVER, IID__cTheObj, (LPVOID *)&pTheObj);<br />
<br />
if (SUCCEEDED(hRes))<br />
{<br />
SHORT ret;<br />
VARIANT l1;<br />
VariantInit(&l1);<br />
l1.vt = VT_BSTR;<br />
l1.bstrVal = m_logon1.AllocSysString();<br />
<br />
hRes = pTheObj->Logon(l1, &ret); :confused:<br />
The definition of the Logon funcition in the h-file for the dll looks like:
<br />
virtual HRESULT STDMETHODCALLTYPE Logon( <br />
VARIANT arg1,<br />
VARIANT arg2,<br />
VARIANT arg3,<br />
VARIANT_BOOL __RPC_FAR *__MIDL_0014) = 0;<br />
Thanks for any help!
|
|
|
|
|
Looks like you are only passing one argument where it is expecting 3, and looks like it might not be initialized, at that.
|
|
|
|