|
Otherwise I'll keep getting tons of 1.0 !!!!
Honestly, I rarely suggest STL usage to newbies.
STL is very good (in fact, state of the art if I have to compare it with, say MFC counterparts) but IMHO a lot of people find too hard the STL learning step and I'm afraid to suggest a rather advanced topic to a newbie (even if the benefits are worthy the effort).
[added]
Furthermore, I think a C++ programmer must be able to do some memory management before switching to container classes. If one just don't like the argument there's a pletora of managed languages...
BTW Who cares about stupid 1.0 of stupid guys ?
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.
|
|
|
|
|
is it better like that ?
lol
actually, i prefer confuse even newbies a bit with STL, rather than push then in dynalically allocating memory, then leading toward memory leaks...
pushing people into STL will make then make the effort of learning it... since then, they will never look around anymore
so, please, edit your post and slide a little STL note in it
|
|
|
|
|
toxcct wrote: actually, i prefer confuse even newbies a bit with STL, rather than push then in dynalically allocating memory, then leading toward memory leaks...
If they shouldn't face memory allocation then is better a C# migration. On the other hand, if they want the metal then metal to them!
toxcct wrote: pushing people into STL will make then make the effort of learning it... since then, they will never look around anymore
STL has the grat advantage of being rigorous. It turns out to be a (learning) disvantage for not-so-rigorous people .
toxcct wrote: o, please, edit your post and slide a little STL note in it
You know I'll never do that.
BTW: who has changed the 1.0 vote(in fact was a 2.0 ) to my post (i.e. only the original poster has the power to?)
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.
|
|
|
|
|
CPallini wrote: BTW: who has changed the 1.0 vote(in fact was a 2.0) to my post (i.e. only the original poster has the power to?)
you prefer i go back to 2.0 ? lol
ok, you got me... was me
but hey, at least, the voting system has that better than the previous one, that if we want to change a vote, we still can...
CPallini wrote: You know I'll never do that
why ?!
|
|
|
|
|
Thank you for all things
-*-*-*-*-*-*-*-*-*
To Be Or Not To Be
(KARFER)
-*-*-*-*-*-*-*-*-*
|
|
|
|
|
KARFER wrote: To Be Or Not To Be
(KARFER)
Are you sure that is yours?
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.
|
|
|
|
|
Can anyone tell which dlls(VC++) need to be added to simple ftp application in order to have transport layer security.
|
|
|
|
|
That would depend on the implementation of FTP that you're using. WinInet does not support FTP over TLS. You'll probably need to obtain a third-party FTP library or implement it yourself. The use of TLS to secure an FTP connection can be found in RFC 4217[^].
To use TLS, consider using Windows' built-in implementation. See Creating a Secure Connection with Schannel[^] for details.
DoEvents : Generating unexpected recursion since 1991
|
|
|
|
|
I have a problem executing a particular child process from my Windows MFC application. The call is simply the name of the executable and an input file as commandline option (see below):
CString commandline = "runall.exe datafile.txt";
switch(WinExec(commandline ,SW_SHOWNORMAL))
{
error handling.....
}
The child process starts, but terminates almost immediately without doing its simulations, and without returning any error values. In a console-window the process runs correctly when using the same call. This puzzles me since I also run several other child processes from my application, whithout experiencing the same problems. Launching the process through functions, like spawn or system, etc., does not help either. This child application uses quite a deal of memory, so it could be a memory problem? However, since it runs correctly in a console window even when the parent application is also running, the total amount of memory on the computer must be large enough. Are there some settings I could alter to increase the memory that can be allocated by my application? Any hint on what might be the problem here will be highly appreciated!
Thank you in advance!
maladuk
I am using Visual C++ 6.0
|
|
|
|
|
My first guess would be a relative vs. absolute path issue.
"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
|
|
|
|
|
No, I have checked this. The call work fine if I use it for another child application.
Thanks anyway!
m
|
|
|
|
|
maladuk wrote: No, I have checked this.
But in your code snippet, commandline is using a relative path. Change it to an absolute path to see what happens.
"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
|
|
|
|
|
Well, using
commandline = "C:\\mydir\\runall.exe C:\\mydir\\datafile.txt";
does not help.
m
|
|
|
|
|
What if you use CreateProcess() instead of WinExec() ?
"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
|
|
|
|
|
The code snippet indicates that some assumptions may not be valid:
1. Does the child program run? Save the result of the WinExec call in
a variable and check it. Add a positive statement that the program was run properly,
2. Does the child program read the command line correctly? You need postive and negative results here too.
3. Can the child process find the input file? WinExec may be able to locate the program to run but the program may not be able to locate the input file. Pay attention to the current directory and how WinExec finds the child program.
My guess is that #3 is the problem since you can run the child program
independently.
modified on Tuesday, December 11, 2007 1:04:27 PM
|
|
|
|
|
I have two methods.. OnCheck() which will check the record in listview control and another method Onchecklist() which will disabel or enable the buttons. Now my query is I want to check more than 1 record in the listview controls and store the indexes in an array. Then I want to pass each one to the OnCheckEPayList() method.
Any pointers would be greatly helpful.
Thanks,
Sai
|
|
|
|
|
Your question isn't clear at all. What are you trying to do exactly ? Please, think that we do not see your code and so we have no idead at all what OnCheck Onchecklist are doing, which buttons you are talking about and what you store in the listview.
Anyway, it seems you are looking for a container class. Did you have a look at std::vector (or std::list) ?
|
|
|
|
|
Cedric Moonen wrote: Please, think that we do not see your code...
Come on, Cedric. When you took the oath to join the super-secret club, the welcome kit contained a pair of "spy" binoculars for just this purpose.
"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
|
|
|
|
|
DavidCrow wrote: the welcome kit contained a pair of "spy" binoculars for just this purpose.
Like those[^] we liked so much when we were kids?
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"
|
|
|
|
|
Are you wanting to know which items in the list control are selected? If so, use the GetSelectedCount() and GetNextItem(..., LVNI_SELECTED) methods.
"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
|
|
|
|
|
if you are using a CListBox , have a look at GetSelItems , but your list but be set to use multiselect (and/or extended select) style.
if you are using a CListCtrl use CListCtrl::GetSelectedCount and CListCtrl::GetNextItem ( see this[^] )
|
|
|
|
|
I have gotten all the code page identifiers using the function EnumSystemCodePages...but i can't seem to find any function that returns the descriptive name of a particular code page...like the names shown in the 'Advanced' tab of Regional and Language Options...anyone know how to get the descriptions?
|
|
|
|
|
Haroon Sarwar wrote: ...but i can't seem to find any function that returns the descriptive name of a particular code page...like the names shown in the 'Advanced' tab of Regional and Language Options...anyone know how to get the descriptions?
I just googled with EnumSystemCodePages and the third entry in the list was this --> http://www.codeproject.com/KB/system/codepage.aspx[^]
Nibu thomas
Microsoft MVP for VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http:\\nibuthomas.wordpress.com
|
|
|
|
|
thanks....don't know how i managed to miss it!
|
|
|
|
|
How to copy a file from pocket PC to destktop PC.I want to get the best method.Please help me.Thank you!The follow is my code,but I need the better measure.Which fuction can do it?
CString strFileNamePC=_T("d:\\nini.txt");
CString strFileNamePPC=_T("\\nini.txt");
CFile oldFile;
oldFile.Open(strFileNamePC, CFile::modeWrite|CFile::modeCreate|CFile::typeBinary);
BSTR bstr = strFileNamePPC.AllocSysString();
SysFreeString(bstr);
CeRapiInit();
HANDLE h;
h = CeCreateFile(bstr, GENERIC_READ, 0/*cannot be shared*/, NULL,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
char cTemp[BUFFER_SIZE];
DWORD nbytes;
CString s;
int iTotBytes = 0;
DWORD n=CeGetFileSize(h,NULL);
if(h!=INVALID_HANDLE_VALUE)
{
//AfxMessageBox("??");
while(CeReadFile(h, cTemp, (DWORD)n,&nbytes,NULL) && (nbytes>=1) )
{
oldFile.Write(cTemp,n);
}
}
CeCloseHandle(h);
oldFile.Close();
CeRapiUninit();
Yunasheng Ni
ni_yuansheng
|
|
|
|