|
I cant check it out right now, but what will atoi(123.567) return? I'm hoping its 123...?
Appreciate your help,
ns
|
|
|
|
|
I'd imagine you want to do this:
floor(atof("123.567"));
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
I think atoi is short for atom to interger...so you'll probably get a compiler error...
atoi("123.567"); would probably work better...
it's 123...
Cheers!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
ascii to integer, I think is the proper long name for it
"The greatest danger to humanity is humanity without an open mind." - Ian Mariano
http://www.ian-space.com/
|
|
|
|
|
Thats works for me...
I tought myself that little abbreviation when I first started programming in windows and now I always associate a with atom...but ascii fits MUCH better...
Thank you...
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Aren't you want to do _itoa(123.567) or something like that?
LPCTSTR Dutch = TEXT("Double Dutch ");
|
|
|
|
|
I am using XML DOM in VC++ to parse an XML document .A person could load a malicious File which isnt Well Formatted (preccursor for XML). How do I safeguard against this ?
As for eg someone could unknowingly load a file with Element tag attributes seperated by commas , which isnt allowed .
How do I safeguard against this ? I am looking for something that will do the task
isWellFormed() !!!!
Please help .
|
|
|
|
|
load the XML into the DOM in a try/catch block.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
Hi,
I'm creating a simple Win32 App (No MFC).
ProgramList = CreateWindow("LISTBOX", "BLAH", WS_VISIBLE|WS_CHILD | LBS_STANDARD | LBS_NOTIFY ,10, 10, 250, 400, hwnd, (HMENU)10, GetModuleHandle(NULL), NULL);
SendMessage(ProgramList,LB_ADDSTRING,0,(LPARAM)(LPTSTR)"test 1");
SendMessage(ProgramList,LB_ADDSTRING,0,(LPARAM)(LPTSTR)"test 2");
SendMessage(ProgramList,LB_ADDSTRING,0,(LPARAM)(LPTSTR)"test 2");
This creates my Listbox and three strings.
Now, how do I change the text and background color in the listbox?
I tried this: SetTextColor(GetDC(ProgramList), RGB(132, 123, 213));,
But nothing happens. I tried adding LBS_OWNERDRAWFIXED to the CreateWindow function of the listbox. But then the listbox just turns white, no text nothing.
What am I doing wrong?
Thanks for any help.
|
|
|
|
|
Read up on the WM_CTLCOLORLISTBOX message...it should let you do all you need...
Cheers!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
I checked it on MSDN, but didnt find anything usefull, do you know the exact page you where talking about?
|
|
|
|
|
The message description...it explains exactly what it's for...
Check MSDN again but look under MFC instead it explains exactly how it works
CWnd::OnCtlColor()
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Thanks, but I can't use MFC.
|
|
|
|
|
Check out CXListBox: http://www.codeproject.com/combobox/xlistbox.asp
Best wishes,
Hans
|
|
|
|
|
Thanks , but I can't use MFC.
|
|
|
|
|
Hello there,
I loaded a file data into void* variable ...
Is there any way to get length from that ?
Regards,
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Can I first ask why you've loaded the data into a void * ? void * is very nasty. You cannot do anything with it until you cast it to something, and you cannot tell what it needs to be cast to. The point of loading is the most likely time to retrieve a length.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
I don't know how you could keep your calm with that question.
How low can you go ? (MS rant)
|
|
|
|
|
I would listen Christian first, but incase your stubborn like me...
void* pBuff = malloc();
UINT nSize = _msize(pBuff);
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Great, That's it
Thanks alot for help
Regards,
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
hi,
i tried to populate a treeview with database calls.. i populate the treeview by populate a node for a record.. each record retrieved from the database call contains an unique id and a description.. i was able to populate the tree with all the description, but i don't know how to store/populate the unique id in the treeview, which is associated to the description.. the unique id and description need to be popuated together in a node.. any help is appreciated.. thank you!
|
|
|
|
|
Use CTreeCtrl::SetItemData()
Cheers
Carlos Antollini.
Pi Five[^]Creator
Sonork ID 100.10529 cantollini
|
|
|
|
|
can you point me to a link with an example on how it's done?
i created a new class, which contains a new datastructure and i tried to append the new datastructure using setitmedata, but didn't work..
this is what i done:
hItem = trCtrl.InsertItem( "some string", 0, 2 );
trCtrl.SetItemData(hItem, (DWORD)myID);
i get error C2440: 'type cast' : cannot convert from 'nodeData' to 'DWORD'
|
|
|
|
|
What kind of data is MyID?
by other side you must to ckeck if hItem has a valid value (hItem != NULL)
Regards
Carlos Antollini.
Pi Five[^]Creator
Sonork ID 100.10529 cantollini
|
|
|
|