|
Any classes you have that are not related to User Interface should be reusable.
|
|
|
|
|
In your compiler options, remove the _WINDOWS preprocessor symbol and change it to _CONSOLE
In your linker options, change /subsystem:windows to /subsystem:console
--Mike--
Visual C++ MVP
LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
VB > soccer
|
|
|
|
|
Hello comunity,
is there any function to read all contentens from an CTreeCtrl object, in order wich ist showed?
Mean like this:
Root
-Item1
-Item2
-Item3
--Child1
--Child2
--Child3
---Child_a
---Child_b
---Child_c
-Item4
....
-Item_n
in this order to print out or stored in an file!
i make my own but i cant read in the order like this sample
thanx
break;
|
|
|
|
|
You have to use GetNextItem(TVGN_CHILD) / GetNextItem(TVGN_NEXT) in a recursive function to iterate through all items. Start at TVI_ROOT.
Some of us walk the memory lane, others plummet into a rabbit hole
Tree<t> in C# || Fold With Us! || sighist
|
|
|
|
|
Hi,
thank you, i try to solve this..
regards
break;
|
|
|
|
|
use GetRootItem for get root and then use GetNextItem(TVGN_CHILD) maybe it is some helpful to you
whitesky
|
|
|
|
|
HI,
A file "ABC.txt" has already been created using CFile and modes
CFile::modeCreate | CFile::modeWrite | CFile::typeBinary
Now I am opeing it using modes
CFile::modeNoTruncate | CFile::modeWrite | CFile::typeBinary
and write the data in it
but it do not appeand the data at its end.
I am also using CFile::SeekToEnd();
Whats the write ways to add data at the end of already existing file?
thanks
Regards.
|
|
|
|
|
I had a file with some text in it. And this code successfully appends text to it.
CStdioFile file;
file.Open ("C:\\abc.txt",CFile::modeCreate | CFile::modeNoTruncate | CFile::modeWrite );
file.SeekToEnd ();
file.WriteString ("Anshuman");
file.Close ();
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Was there any problem with my way stated in above query?
Regards.
|
|
|
|
|
You can achieve the same with your method.(using CFile) Post some code about how you are going with that and then we can comment on the change or modification you need to make. My Guess is that you may not be closing the file after creating it.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
and this code is work or not work
<br />
CFile file(_T("c:\\test.txt"),CFile::modeNoTruncate | CFile::modeWrite );<br />
file.SeekToEnd();<br />
file.Write(_T("test"),4);<br />
file.Close ();<br />
whitesky
|
|
|
|
|
How do you choose the socket number that you wish to use for a TCP connection?
Is there a band of numbers that you can use, if so what are they?
Thanks for any advice!
Mike
|
|
|
|
|
Mike,
There is no hard fast rule to selecting a port number for your own TCP services. In general the first 1024 are reserved for "well known" services and 49152 to 65535 are reserved for dynamically allocated and/or private port numbers.
Keep in mind where your service will be used, if it is a public service that anyone can connect to via the Internet, then you might want to be fairly selective on what port number you use. However if your service/server is to be used on a private network, then you can just about pick any port you want.
You can find a list of "well known" port numbers at:
http://www.iana.org/assignments/port-numbers[^]
Hope this helps.
|
|
|
|
|
Thanks for this.
My application(s) will be used on a private network, so there shouldnt be any issues with connection over the internet. Looking down the list, the first free block is 3825 - 3835, so I will probably look to us these.
Thanks for you help!
Mike
|
|
|
|
|
Hi
I'm writing some code that uses a set of purchased numerical algorithms. Unfortunately they use c function calls so any array that are passed to the functions are done so with pointers.
I usually use vectors rather than arrays so does anyone know how I can pass the vectors to these functions? Is it as simple as passing vector.front() or is there some other way to convert a c++ vector to a c array/pointer?
cheers
|
|
|
|
|
I usually use &myvector[0] for the array and myvector.size() for the array length.
|
|
|
|
|
vector.front() will work just fine. Just remember that it returns a reference, so take the address of its return value...
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
This technique is fine for vector s but it's not safe for any of the other standard containers.
Steve
|
|
|
|
|
Correct, but he did say he was using vectors...
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
In order to obtain a pointer to vector's values, you can try this: myVector.at(0) .
|
|
|
|
|
I have done the way u have suggested and didnt face any problem , since vector is also an array ,a self growing array and is continous we shouldn't face any problem .
Regards,
FarPointer
Blog:FARPOINTER
|
|
|
|
|
FarPointer wrote: we shouldn't face any problem
just don't assume the front of the vector will stay in the the same place if you add (or remove) elements to the vector. in other words, changing the vector may invalidate your 'pointer'.
Cleek | Image Toolkits | Thumbnail maker
|
|
|
|
|
Cheers everyone
I had thought that essentially vectors could be treated like pointers in this way, but I thought I'd check to see if others hade done it before.
Cheers for the tip on moving Chris, as it happens I'm just passing the vector, geting an answer and then that's it so it should be fine.
Thanks again
-- modified at 7:34 Thursday 22nd June, 2006 - typo
|
|
|
|
|
This technique is used by many. It's fine for vector . The capacity and reserve functions are even provided so the programmer can have some control over when reallocation occurs. Note however that it's can't be done with any of the other standard containers or the vector<bool> specialization.
Steve
|
|
|
|
|
I got a doubt how does a vector grow ,does it allocate using new or other mechanism .
Regards,
FarPointer
Blog:FARPOINTER
|
|
|
|