I mean that it does not print out the contents of the array. it prints out a number of the class or something like that: 116c99d.
SWDevil
Posts
-
Printing the contents of a collection -
Printing the contents of a collectionDo you mean: Collection col = funcA(); String sCol = col.toString(); If so it doesn't work... If it's not what you meant, I would appreciate it if you could write some code since I am very new to Java...
-
Printing the contents of a collectiontoString on what? on arrCol[i]? arrCol[i].toString() gives me a cannot find symbol error.
-
Printing the contents of a collectionHi, I have a web application which has a simple java class. In my java class I have a function that returns Collection. For example: Collection coll = funcA(); I want to somehow print the contents of the coll collection to the screen - this is for debugging purposes. How can I do this? I tried throwing an exception - RuntimeException - but it only accepts a string. I tried converting the collection to a string, but it doesn't work: Collection col = funcA(); String str1 = ""; Object[] arrCol = col.toArray(); for (int i = 0; i < col.size(); i++) { str1 = str1 + arrCol[i]+ " "; } Is there another way I can view during runtime the contents of the collection? By the way, I am very new to java - i am a C++ programmer... Thanks!
-
How to add a tag <tag val="N"> to an xml fileumm.. yes... obviously it did not help much, therfore I wrote this post...
-
How to add a tag <tag val="N"> to an xml fileHi, I am using the IXMLDOM objects to create an xml file and write tags to this file. I would like to create a tag <children count="2">, and under that write the names of the children <childname> value </childname>. this should look as folowing: <Root> <Person> <Name> value </Name> <PhoneNumber> value </PhoneNumber> <Children count = 2> <childName> value </childName> <childName> value </childName> </Children> </Person> </Root> 1. Using IXMLDOMDocument or IXMLDOMNode, how do I add a node <Children count =2>, is this an attribute? How do I make sure that it is inserted under the tag? 2. How do I add the sub nodes underneath <childName> value </childName> If you could give me code examples tha twould be great. I've tried all kinds of options using the IXMLDOM functiom and it doesn't work!! Thanks.
-
How to add a tag <tag val="N"> to an xml fileHi, I am using the IXMLDOM objects to create an xml file and write tags to this file. I would like to create a tag <children count="2">, and under that write the names of the children <childname> value </childname>. this should look as folowing: <Root> <Person> <Name> value </Name> <PhoneNumber> value </PhoneNumber> <Children count = 2> <childName> value </childName> <childName> value </childName> </Children> </Person> </Root> 1. Using IXMLDOMDocument or IXMLDOMNode, how do I add a node <Children count =2>, is this an attribute? How do I make sure that it is inserted under the tag? 2. How do I add the sub nodes underneath <childName> value </childName> If you could give me code examples tha twould be great. I've tried all kinds of options using the IXMLDOM functiom and it doesn't work!! Thanks.
modified on Tuesday, July 1, 2008 12:51 PM
-
keep item selected when list control loses focusHi, I have a List Control in my project. When the user clicks anywhere outside the listcontrol view (the control loses focus) the item that was selected loses it's selection. How can I keep this item selected, even if the control loses focus? I am already using the LVS_SHOWSELALWAYS style. this is how I create the list control: CListCtrl cList; cList.CreateEx( WS_EX_STATICEDGE | LVS_EX_TWOCLICKACTIVATE | LVS_EX_DOUBLEBUFFER , LVS_ICON | LVS_SHOWSELALWAYS | LVS_ALIGNTOP | LVS_OWNERDATA | WS_BORDER | WS_TABSTOP |WS_VISIBLE | LVS_SINGLESEL, ClientRect, this, IDC_LIST) Thanks
-
Convert string to longHi, How can I convert a string to long, so that the long value will be exactly the same value as the string? When I use the following code: CString str= "39436573472344"; long temp = atol(str); The value of temp is 2147483647. How can I get the value of temp to be the same as the string? Thanks.
-
How to create a Unique numeric IDI am thinking of using GetTickCount, but I understand that this might return a negative value? Is this true?
-
How to create a Unique numeric IDThe requirement is a 64 char string. But there is a first part that I have to include, and for the second part I have to generate a unique ID. Both parts together should not be mopre than 64 chars.
-
How to create a Unique numeric IDyes - that's exactly my problem :) If I use part of the GUID that is generated and convert that to decimal. will that still be globaly unique?
-
How to create a Unique numeric IDyes - that's exactly my problem :)
-
How to create a Unique numeric IDHi, I need to create a unique id which consists only of numbers (0-9), and needs to be of a certain length (not more than 37 chars). How can I do this? I know that here is GUID, but this creates a hexidecimal number. Thanks
-
disabling and graying out a menu itemHi I am trying to disable a menu item, but it is only disabling it for me and not graying it out. For instance I have a menu as following: File ->Open ->Save So the "Open" and "Save" are grayed out and disabled, but "File" is not. How can I make "File" menu item be grayed out on top of being disabled? By the way - I am using the ON_UPDATE_COMMAND_UI_RANGE command. Thanks
-
How to check if a field already exists in a tableIf I need to add more than one fields can I write than one ALTER statements: IF NOT EXISTS(SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'MyTableName' AND COLUMN_NAME = 'MyColumnName') BEGIN ALTER TABLE .... ALTER TABLE ... ALTER TABLE ... ALTER TABLE ... END
-
How to check if a field already exists in a tableHi, I need to check if a field exists in a certain table (in an SQL database), and if not then add that field to the table. For Instance I have Table "A" that should contain field "a". So I want to check if field a is already defined for the table, and if not then add it. How can I d o this? Is there an SQL statement to check if a field exists? Thanks
-
resizing a group box control during runtimeI don't understand - do I have to call setRect and afterwards call setWindowPos or MoveWindow, or do I not need to call setRect? I tried adding a call to setWindowPos as following: CRect rect; GetDlgItem(IDC_STATIC_GRP_SEARCH)->GetClientRect(rect); rect.SetRect(11,280,66,280); MoveWindow(11,280,198,66); but it just ends up changing the size of the whole dialog and not the control itself.... if you could please write an example of the code it would be very helpful.
-
resizing a group box control during runtimeI would like to resize a group box control during run-time (for instance in the OnInitDialog function). I only need to change it's height (make it smaller). How can I do this? I tried the following (which didn't work..): CRect rect; GetDlgItem(IDC_STATIC_GRP_SEARCH)->GetClientRect(rect); rect.SetRect(11,280,66,280); rect.DeflateRect(0,0,0,rect.Height()-50); SetRect did not work so I tried using DeflateRect - and that also did not work. Please help...
-
compare SW versionHow can I compare two strings that contain a version? For Instance: CString string1 = 10.2.33.4 CString string2 = 10.4.22 so in this case - string2 is higher than string1. Is there a windows function that I can use (or something of the sort), or do I have for each string to break up the string at each '.' insert each part into an integer and compare each part of the two strings separately? Thanks,