|
|
Please be nice to persons who post in the incorrect forums as they probably do not have a vast posting history such as yourself.
The correct way to behave is to give them a good flaming in the first instance, so they will learn immediatly to correct there ways.
Also you will gain a lot of satisfaction flaming somebody who you are never likely to meet in person.
Regardz
Colin J Davies
Sonork ID 100.9197:Colin
You are the intrepid one, always willing to leap into the fray! A serious character flaw, I might add, but entertaining.
Said byRoger Wright about me.
|
|
|
|
|
|
Thst not such a bad idea, don't wast eiopportunities to flame folk to a crisp and rememeber to turn the over and flame the other side, its embarrassing to have folk turn up any the roast is only halve done.
Regardz
Colin J Davies
Sonork ID 100.9197:Colin
You are the intrepid one, always willing to leap into the fray! A serious character flaw, I might add, but entertaining.
Said byRoger Wright about me.
|
|
|
|
|
I want to trap escape button like we do in Vb...
Eg.
when we write this under key press / keycode event in Vb..
if keyascii=27 then
unload me
exit sub
endif
|
|
|
|
|
I want to use the CListCtrl's LVS_REPORT ,but I have no idea in using the CListCtrl,anyone could give me a sample or the setps? I could not understand the MSDN 's .Thank .
YES, I am here.
|
|
|
|
|
Well, if you already have your list control on your dialog, those are the steps: (I suppose that m_wndList is the CListCtrl
m_wndList.ModifyStyle(0, LVS_REPORT);
<font color=green>
m_wndList.InsertColumn(0, "My name");
m_wndList.InsertColumn(1, "My phone");
<br>
<font color=green>
int nItem = m_wndList.InsertItem(m_wndList.GetItemsCount(), "Philip Patrick");
m_wndList.SetItem(nItem, 1, "111-111-222222");
That's all
Philip Patrick
Web-site: www.stpworks.com
"Two beer or not two beer?" Shakesbeer
|
|
|
|
|
YES, I am here.
|
|
|
|
|
I'm working on an app that dumps loads of trace information to a file, as XML:
<log>
<message>
....
</message>
</log>
Now, when the app closes I write "</log>" as the last line. However, the next time the app is run, I want to append to this file, which means I must remove that last line. (It's the XML "root node" )
Now, I know I can rename the file, re-parse it and re-write it etc but these log files reach 10's of Mb in size, so it takes too long to do that.
So I want to over-write the last line with some new text instead. I seem to remember doing this using the C standard library in the dim and distant past, but can I do this using the C++ library?!!
I've tried with the <fstream> library, and seekp() & tellp() but am getting a bit unstuck Any ideas anyone?
|
|
|
|
|
Open the file using CreateFile . Now use SetFilePointer with the FILE_END flag. Now call SetFilePointer with FILE_CURRENT and use -8 as the lDistanceToMove value. Thus it moves back 8 bytes (</log>\r\n). If you have only a \n, then put -7 as lDistanceToMove . Now write your stuff and close the file.
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Review by Shog9
Click here for review[NW]
|
|
|
|
|
i think a slightly more robust way would be to read the last 100 bytes into memory and find the string and calc its offset and use that when seeking the file position ... unicode chars and whatnots might screw u up if u hard code the sizes into the algorithm
"... and so i said to him ... if it don't dance (or code) and you can't eat it either f**k it or throw it away" sonork: 100.18128 8028finder.com
|
|
|
|
|
hi,
If you're keen on using the C++ library, u could do this with fstream's ::seekg to seek to the end(ios::end) minus the offset which is calculated. The offset would be calculated using sizeof(string). Specify the offset in (-)ve. Now you can write the present contents from this location.
P.S. Open the file in binary mode.
hope this helps,
Sharad
In C you write your own bugs, in C++ you inherit them !
- Anonymous
|
|
|
|
|
So I've got this nifty CFileDialog-extended class that doesn't use the OFN_EXPLORER flag. I need to check the extension the user selected, so to do that, I look at the "cmb1" control (well, also some other Explorer-style control identifiers)
So everything was going well and good, until I found an article on how to allow CFileDialog-derived classes to use the OFN_EXPLORER flag (basically make the OPENFILENAME size 12bytes larger). And now the ASSERT fails.
CWnd* pComboBox = GetParent()->GetDlgItem(cmb1);
ASSERT_VALID(pComboBox);
So, if anyone can point me in the right direction, or just outright solve this problem, that would be great! (I'd rather not have to use Win32 to solve this though)
Thanks in advance.
|
|
|
|
|
Hello all,
I am writing a little vector animation program and want to add rotation to my basic shapes. I have an algorithm that works ok... other than the fact that is shrinks the shape as it rotates! It works much better in OpenGL since its points are floating point. As far as I can tell, the shrinking is due to round off error, going from double to int. I am using the GDI in this case so I can't really do much about it. I am also programming this to run on both 9X and XP so no world transformations. I intend to make this method work for all gdi type basic shapes it is only working (appropriately) with the shapes that are invariant under rotation, the Polyxxxx shapes.
So, can anyone verify my diagnosis or point out other problems? Moreover, can anyone suggest a... less destructive way to rotate?
Thanks alot
////////////////////////////////////////////////////////////////////
int CShape::Rotate(int nAngle) // thar she be!
{
double dAngle = -nAngle * DEG_TO_RAD,
tX, tY, tX2, tY2;
for(int i = 0; i < m_aSourcePoints.GetSize(); i++)
{
tX = m_aPoints[i].x - m_ptRotate.x;
tY = m_aPoints[i].y - m_ptRotate.y;
tX2 = (int)((tX*cos(dAngle))-(tY*sin(dAngle)))+m_ptRotate.x;
tY2 = (int)((tX*sin(dAngle))+(tY*cos(dAngle)))+m_ptRotate.y;
//round the rotates point values
if((tX2 - floor(tX2)) >= 0.5) tX2 = ceil(tX2);
else tX2 = floor(tX2);
if((tY2 - floor(tY2)) >= 0.5) tY2 = ceil(tY2);
else tY2 = floor(tY2);
m_aPoints[i].x = tX2;
m_aPoints[i].y = tY2;
}
return ANI_OK;
}
jon brown
|
|
|
|
|
I want to color a text in Static box on a dialog box with color of the static box same as the dialog box .
Can Anyone suggest a sololution for it.
Samir Sood
|
|
|
|
|
if you want to color statics you can either use one of the enhanced static controls here (norm almonds is a good one mostly) or you can override the OnCtlColor() function in your dialog box (the WM_CTLCOLOR message)
"... and so i said to him ... if it don't dance (or code) and you can't eat it either f**k it or throw it away" sonork: 100.18128 8028finder.com
|
|
|
|
|
I want to dispose tiff image file format .
and I have downloaded some source program ,but I find that this source code have a problem which it doesn't decode CMYK color mode TIFF file . then display CMYK tiff file is error .
do you know how to resolve it ?
thank you
|
|
|
|
|
I want to read CMYK color mode TIFF file
and save CMYK color mode TIFF file
if I transform CMYK TIFF file to RGB file .
then color information will change .
(I use photoshop for testing)
So I want to dispose CMYK TIFF file in CMYK color mode .
no transform .
|
|
|
|
|
get yourself a copy of LibTiff. with it, you can read and write the TIFF data directly.
-c
To explain Donald Knuth's relevance to computing is like explaining Paul's relevance to the Catholic Church. He isn't God, he isn't the Son of God, but he was sent by God to explain God to the masses. /. #3848917
|
|
|
|
|
Yes ,I have used Libtiff .
but it has the same quesiton .
Don't dispose correctly CMYK color mode Tiff Image
I need read and write CMYK color mode Tiff image .
and I have tested CXimage class that downloaded from http://www.codeproject.com/bitmap/cximage.asp
It supports Tiff file ,but there is a problem that It supports CMYK color mode tiff image.
and FreeImage Library ,download from
http://www.codetools.com/bitmap/graphicsuite.asp
it uses Libtiff library .but I find that there is the same problem of supporting CMYK color mode tiff file .
I don't know how to do
help me
Thank you
|
|
|
|
|
thank you
|
|
|
|
|
Why nobody?
|
|
|
|
|
I want to get width and height of richedit control how to get it!
thanks
|
|
|
|
|
Is there a getclientrect() member function? Just a guess....
-Ken Mazaika
|
|
|
|
|
GetClientRect returns just the client area. GetWindowRect returns the area of the entire CWnd object. See API docs for CWnd.
Best Regards.
-Matt
------------------------------------------
The 3 great virtues of a programmer:
Laziness, Impatience, and Hubris.
--Larry Wall
|
|
|
|