Int to CString conversion

Is there a simple function that can convert from an int to CString?

TIA

Tony


0
8/12/2004 9:27:45 AM
vc.mfc 33608 articles. 0 followers. Follow

3 Replies
496 Views

Similar Articles

[PageSpeed] 0

"Tony" <lazyherbert@homeandresting.com> wrote in message
news:e7TjX6EgEHA.3428@TK2MSFTNGP11.phx.gbl...
> Is there a simple function that can convert from an int to CString?
>
> TIA
>
> Tony
>
>

int SomeIntegerValueThatYouWantToConvert;
CString temp;
temp.Format("%d", SomeIntegerValueThatYouWantToConvert);


0
billt61 (145)
8/12/2004 9:36:25 AM
"Bill Thompson" <billt61@rgv.rr.com> wrote in message
>
> int SomeIntegerValueThatYouWantToConvert;
> CString temp;
> temp.Format("%d", SomeIntegerValueThatYouWantToConvert);
>


    Nice variable name.  :)


--
Alec S.
alec <@> synetech <.> cjb <.> net




0
Alec
8/12/2004 3:40:02 PM
Read my essay on CStrings on my MVP Tips site.
				joe

On Thu, 12 Aug 2004 10:27:45 +0100, "Tony" <lazyherbert@homeandresting.com> wrote:

>Is there a simple function that can convert from an int to CString?
>
>TIA
>
>Tony
>

Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15974)
8/15/2004 4:41:41 AM
Reply:

Similar Artilces:

CArray of stdext::hash_map<int,int> not possible ( access violation ) ?
Hello, I have problems using CArray<> with hash_map<>. What's wrong with the following code ? class A { A() {} A( const A& ) {} ~A() {} void operator=( const A& ) {} stdext::hash_map<int,int> m_member; }; .... A item; CArray<A> test; test.Add( item ); test.Add( item ); test.RemoveAll(); // access violation in hash_map<> destructor ???????? The same code with std::map<> works ok. What is the problem ?. Everything tested under VS.2005. Thanks, Adam "Adam" <adam_mich@gazeta.pl> ha scrit...

OrgPlus conversion
Hi folks, we have many OrgPlus organization charts in OrgPlus 3.0 (pretty old). How can we convert them so that they can be updated in Visio 2000? Thanks, Tom ...

CString undefined with VS.NET?
Hi All, I am trying to port my app from VS6 to VS.NET. Getting many errors like "error C2079: 'QIObvod::m_name' uses undefined class 'CString'" What happened to CString? Any ideas? thank you Vaclav Do you mean you are porting to MFC in VS.NET or are you porting to a managed app ? Makes a big difference. If MFC, the conversion wizard should add the appropriate calls. I notice that projects I have converted have the following in stdafx.h #define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit This may help Vaclav wrote: &g...

Conversion Problem
I know that the Subject might be a little off, but here's my issue. I am importing data from a spreadsheet into an Access database. In this particular column of data, the data looks like this: 911B00, 91FT20, 911000, 91E000. My issue is that when I import that column if data, for some reason it takes the records with a "E" (like 911E00) and displays them as exponential numbers and displays "9.10E+01" - how can I prevent Access from doing that - or what function can a put in a query to fix that? On Mon, 7 Dec 2009 14:50:51 -0800 (PST), Commish <mark.wolv...

Linking to old DLL with CStrings
I am writing in MFC 7 and wish to link to a DLL that was obviously compiled under an earlier version of MFC (i.e. a non-template-based version of CString). The new MFC generates a different signature than the old, so the linker has trouble reconciling the two. I read article 309801 and inserted my template definitions into the stdafx.h file, but that didn't help. I still get many errors like the following: ftLocator error LNK2019: unresolved external symbol "__declspec(dllimport) public: class ATL::CStringT<unsigned short,class StrTraitMFC<unsigned short,class ATL::ChTra...

Problems with INT()
Hi all Whilst in the process of replying to someone's post, I discovered a problem with using INT(). (All cells are formatted as General.) In A1 I have 32.51 In B1 I have =A1-INT(A1) this gives me 0.51 In C1 I have =B1-0.51 this gives me -1.99840144432528E-15 It doesn't give zero, whichever value I use in A1 Why is this? Andy. Hi Andy! Excel is commonly reported as getting its maths all wrong with results that should be equal being treated as not equal. See the Microsoft Knowledge base articles for full coverage of difficulties that Excel and all computi...

File conversion window message with strange characters
Word documents open with the File Conversion window showing first. No matter what encoding I select I still get incomprehensible characters. This occurrs in all my saved and new files and I just can't get them to display normally. That suggests that the files are all corrupt. Where are they stored? How did they get there? How long has this been happening? Which versions of Word and OS are you using? Are they fully patched up to date? -- Terry Farrell - MSWord MVP "jeangladi" <jeangladi@discussions.microsoft.com> wrote in message news:AA5629FD-30A4-44F7-B2...

Difference between CString and CAtlString?
Professional VSIDE 2003 .NET with SP1 install What is the exact difference between CString and CAtlString? Or is this true that CString is MFC's baby and CAtlString is ALT's? Also, has anyone notice this, if you use any type of CString and the momment you create any variable and access any method on it, intelliscence will stop working, no matter, then what project you have in your solution, C#, C, C++, Managed C++ or any one. Intellisence will not work at all. I have to delete the .ncb file in my solution directory, plus, all the files that VSIDE use to create in my Local Settings dir...

PROBLEM WITH ACCESS 95 DATABASE CONVERSION
Hi. I have a problem converting an access 95 database to access 2002. When the conversion is completed, It makes a table with one error field. The error is: " FILE MSJETSQL.TLB NEEDS THE VBE REFERENCE OR IS ERRONEOUS " I tried with other access 95 databases and It happen in everyone. I tried in other computer with the same configuration and it works ok. What can I have to do?. Reinstall the Access 2002?. Search for the file msjetsql.tlb in disk?. Thanks. I've solved copying the file from other PC. "JP" <aspento_quitar_para_correo_@arrakis.es> escribi� en e...

Begginer: How to change the middle of CString contents?
I'm trying to change some contents in the contents in the middle of a CString var. Let me explain. The CString var contains the following: 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ 00,00,00,00,00,00,00,00,00,00,00,43,00,42,00,44,00,30,00,30,00,30,00,30,00,\ 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\ 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,0...

CString to int
How can I convert CString to int? Thank you. "Oliver Young" <none> wrote in message news:uR9xxCZtDHA.3236@tk2msftngp13.phx.gbl... > > How can I convert CString to int? At least one available option is _ttoi. -- Jeff Partch [VC++ MVP] Oliver Young wrote: > How can I convert CString to int? > > Thank you. > > Call atoi -- Scott McPhillips [VC++ MVP] hi try whether it will work or not int CStringToInt(CString data) { int len1,len=data.GetLength(); data.TrimLeft(); data.TrimRight(); char c; LONG num=0; ...

Int to CString??
Hello, I am new in visual c++. How i can convery int to cstring? Sadjad Fouladi wrote: > Hello, > I am new in visual c++. How i can convery int to cstring? > The CString::Format method builds strings from all types of data, using the same format specifiers as the old printf. int i = 3; CString str; str.Format("%d", i); -- Scott McPhillips [VC++ MVP] This works for double, but I'm sure it works for int. double m_double = 0.574562489; CString cell; cell.Format("%0.5f",m_double); This will trim to 0.574562489 to 0.57456. Craig SquareRED Software. If...

Global currency conversion
I have a complex spreadsheet, about four linked worksheets all in US dollars. I have been asked to produce the same thing in pounds sterling. Is there any way that I can divide the value of all cells by say 1.9 to give me the sterling value - I have created a new cell with the correct exchange rate so I can change that at any time but I am not sure how I can apply it to all cells. Many thanks for any assistance enter 1.9 in a cell, copy it, select all the cells you want to divide by it, use Edit/Paste special, select Values AND Divide. For an easier more permanent way, pick a cell to divide...

conversion error
We are upgrading from v7 to v8 and receive the following error: "the conversion process encountered an error and the temporary table did not get removed". What is the cause of this error? Note that another post mentioned that views, tables or stored procuedures named with dashes or spaces in the name can cause this problem. I've already checked that we don't have any. Thanks! Does it refer to the table that it encountered the error on? When ever I encountered this error. I found that is was because it was having difficulty with a dynamics work table. I would h...

dividing up a string of int's
I have a long string of 8-bit int's and need to divide it into several smaller strings. Example: I start out with a string of 354 bytes long. I want to divide this up into 20 smaller strings of fairly equal length but not have any extra bytes left from larger string. Any help would be appreciated. NO, this is not a homework assignment. I need to do this for a project I am working on. Thanks Ed wrote: > I have a long string of 8-bit int's and need to divide it into several > smaller strings. > Example: > I start out with a string of 354 bytes long. > I want to divid...

Start -> From-Till date conversion
Hi, Have a table containg some data, one field being the 'StartDate' When another registration is done, it receives again a 'StartDate'. For some application I need a From-Till date instead of only a StartDate. There is no uninterrupted sequential field to get the 'next record': table = Building int, Unit int, Owner int, StartDate date So the shorthand for this would be: Select StartDate As FromDate, datediff(d,-1,isnull([StartDate of next record],[some big date])) as TillDate from table where Building=@BuildingID and Unit=@UnitID (the [some big dat...

auto number conversion error
I am trying to convert a database from 97 to 2000 and am getting some ambiguous auto number results. The last auto number from prior to the conversion is 120 and now when I enter a new record after conversion the numbers start at 1291848529 and continue from here. I have a backup to try and convert again, but the same thing keeps happening. Is there something I can do to fix this so the next # will be 121 either in the converted database or somehow through the coversion process? Please, any help? These new #'s are way too large. Thanks, Bridget ...

error C4430: missing type specifier
Hi, I have a compile error like this: error C4430: missing type specifier - int assumed. Note: C++ does not support default-int Could any body tell me the root cause for this error, thanks a lot! -ja I can't help but think this error is associated with some line in your source code. How can we tell you what's wrong without seeing that line? -- Jonathan Wood SoftCircuits Programming http://www.softcircuits.com "ja" <josndrsn@yahoo.com> wrote in message news:Oxz1kWN8GHA.1496@TK2MSFTNGP05.phx.gbl... > Hi, > I have a compile error like this:...

CString assignment operator leaks memory?
CString assignment operator documentation for VS.NET 2003 says "You should be aware that memory exceptions may occur whenever you use the assignment operator because new storage is often allocated to hold the resulting CStringT object." Does this mean that if I assign a constant string to a CString object in a function, the memory is leaked when the object goes out of scope? eg. function() { CString foo = "This is a string"; } would this stop memory leak? function() { CString foo = new CString("This is a string"); } >CString assignment operato...

Conversion of Office 2000 Publisher to Office 2000 Word
Does anybody have the secret to this? I don't want to just paste the Pub as a picture I want an editable Word format. Thanks for listening. Sorry, no easy way unless you can turn it into a .pdf and the convert that ..pdf into a .doc with ScanSoft's PDF Converter. Even that isn't 100% reliable but it's close. -- JoAnn Paules MVP Microsoft [Publisher] "Jon Williams" <anonymous@discussions.microsoft.com> wrote in message news:1762901c4491c$34715110$a301280a@phx.gbl... > Does anybody have the secret to this? I don't want to > just paste the Pub as ...

COUNTIF and automatic type conversion problem
Hello I like to have an unique validation rule for a columen which contains id's. I used a therefore simple rule with the build in function "COUNTIF" http://www.cpearson.com/excel/NoDupEntry.htm i.e. "=COUNTIF(E:E;E2)=1" My id's have the format "n.nn" i.e. "1.1", "1.2", "1.3" etc. and the cell format is set to "text". The above rule works fine as long as I have the following id's "5.1" "5.10" "5.100" The problem which I have now is that EXCEL seems to convert the value before th...

MIME conversion
My user sends an email with 15MB attachment. It gets rejected by the recipient's mail server because they have a 25MB limit. I understand that the mail becomes larger during MIME conversion but it couldn't expand that much, could it? In general, how much does it expand? 2x? 1.5x? General rule of thumb is 30-40% On Fri, 21 May 2004 16:13:39 -0700, "Ron" <ron@________dot______> wrote: >My user sends an email with 15MB attachment. It gets rejected by the >recipient's mail server because they have a 25MB limit. I understand that >the mail becomes larger d...

Conversion to thousands
thank you so much!!!!!!!!!!!!!!! -- Pre ----------------------------------------------------------------------- Pree's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=1481 View this thread: http://www.excelforum.com/showthread.php?threadid=26441 ...

Simple question: does a CString object have a byte-length prefix?
Does a CString have a bytelength prefix (I think it does)? If so where what's the byte-resolution of this byte-length prefix and where can I find formal documentation of about this prefix? Thanks in advance. -RP RP2001 wrote: > Does a CString have a bytelength prefix (I think it does)? If so where > what's the byte-resolution of this byte-length prefix and where can I > find formal documentation of about this prefix? > > Thanks in advance. > -RP It does. What does byte-resolution mean? The implementation of CString is not documented, but you have the source co...

Userforms and Inteli mouse scroll functions
Hi all, Can anyone help me? I have added scrollbars to some of the Userforms in my workbook but the scroll button on my wheel mouse does not work with these forms..... Is there a setting in the Properties that can be changed or a Macros that can be written for the form to get the wheel to work with the Vertical Scroll bars in a userform? ...