|
Thanks for the reply and the information provided. I will be working with ASCII and the numbers that I provided in my example was just that ... an example it could have been letter as well. Basically I'm looking for a function that will allow me to copy from a starting position to a end position within a string. Does something like this exist? I can think of a way to do it with string copy but it feels like a very long way to perform something like this.
Thanks in advance
Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
stl strings have a substr function you can use for this
<br />
basic_string substr(<br />
size_type _Off = 0,<br />
size_type _Count = npos<br />
) const;<br />
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
Thanks for the info Matthew.
Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
std::string content can be changed using indices (operator []). Or you can use the replace member function. Either useing iterators or index and count.
Or you assemble a new string (e.g. using a std::stringstream) from parts of the old an new string.
The possibilities are endless!
For the case you presented, I would simply use the
string[i] = 'n' way.
Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all. Douglas Adams, "Dirk Gently's Holistic Detective Agency"
|
|
|
|
|
|
Hello All,
I want to make an application which can run as windows Service.
Anybody help me how can i start?
Thanks in advance
Manish Patel.
B.E. - Information Technology.
|
|
|
|
|
manish.patel wrote: I want to make an application which can run as windows Service.
Anybody help me how can i start?
Nishant Sivakumar can.[^]
His article is part of a whole section dedicated to services: read them!
Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all. Douglas Adams, "Dirk Gently's Holistic Detective Agency"
|
|
|
|
|
Hi Friends,
I am using an SDI Application, i want to show a BITMAP image in the SDI,
How to do that.
Thanks and Regards.
SANTHOSH V
|
|
|
|
|
for instance (inside OnDraw method of your View class):
...
CBitmap *pOldBmp, bmp;
bmp.LoadBitmap(IDB_MY_BITMAP);
CRect rc;
GetClientRect(&rc);
CDC dcMem;
dcMem.CreateCompatibleDC(pDC);
pOldBmp = dcMem.SelectObject(&bmp);
pDC->BitBlt(0,0,rc.right,rc.bottom, &dcMem,0,0,SRCCOPY);
dcMem.SelectObject(&pOldBmp);
...
Please note: error handling and efficience tuning left to the reader.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Or
CImage m_Image;
m_Image.Load(_T("c:\\1.jpg")); or 2.bmp
m_Image.BitBlt(1024,768,dc._hDC);
...
|
|
|
|
|
hi i am using cprogramming
i am trying to write the a link list structure to a binary file using:
fwrite()
anyone know how should i go about doing so?
|
|
|
|
|
can u explain a bit more in detail
|
|
|
|
|
Object serialization is a rather big topic. You can either exploit MFC serialization support http://msdn2.microsoft.com/en-us/library/6bz744w8(VS.80).aspx[^]
or develop your own mechanism (this can be simple provided your structures have fixed sizes).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Serialization in C ?
|
|
|
|
|
Oh, you can do it. You have structs, after all.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
There's an awesome book called 'Mastering Algorithms with C' published by O'Reilly. It's where I learned all this sort of stuff, highly recommended.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I'm developing a C++ program that should check whether SQL 2k5, Exchange 2k7, Oracle 10g are installed on the system. Based on whether one of it is installed the program shall invoke a different C++ function. The check shall be made by probing for certain registry keys/values by the C++ main program.
I would like to know which keys/values are set by the installation of
SQL 2k5
Exchange 2k7
Oracle 10g.
Also are there registy keys/values probing is foolproof enough to guarantee the successfull calling of the appropriate function?
On a sidenote are there any registry keys/values that are common and same for all the above three databases irrespective of different flavours. The idea is that the same registry check works for all the different version of a database.
|
|
|
|
|
hi to all
i am using CButtonBitmap class object and with the help of this object I am calling autoload function to load bitmap on button,bitmap image has no text on it,and "i want to text out programically on that bitmap",it is necessary for me because i am using same bitmap on various button,how can i solve this problem
malik
|
|
|
|
|
You want a bitmap AND text on a button?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I don't know if that is what he wants, but I want to display a bitmap on a button with custom text.
We need to be able to read the button text from an INI file, and display it on a button with an icon.
|
|
|
|
|
See if this or this helps.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
1) Based on your response, am I correct in assuming CBitmapButton does not have this capability?
2) IS it possible to use a transparent image, and set the text behind the image?
modified on Monday, February 04, 2008 3:19:01 PM
|
|
|
|
|
littleGreenDude wrote: 1) Based on your response, am I correct in assuming CBitmapButton does not have this capability?
Read the first few paragraph's of Dr. Newcomer's article.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi Friends,
I have a MHTML file, i have to Split it in to Number of files,
First from the Header of the file as header.
Then we have a String in as "PAGE-BREAK-AFTER". I have to read this file and find this string, till that string i have to make a new file1, like that there are lot of "PAGE-BREAK-AFTER" String, Could any one tell me.
How to do this, some logic.
Thanks and Regards.
SANTHOSH V
|
|
|
|
|
That can be easily done:
(0) if you have reached endo of file exit
(1) Read a line and append it to your buffer
(2) Search the line for the "PAGE-BREAK-AFTER" separator
(3) if the separator is not found go to point (0)
(4) write buffer content to new file
(5) erase buffer
(6) go to point (0)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|