|
welcome at the codeproject...
if you have any (specific) questions, don't hesitate.
|
|
|
|
|
Welcome to Codeproject and this forum for start do you have a question or problem on the vc++(your program)?
|
|
|
|
|
Hi,
am sundar.I have one question in vc++.I have a problem when i accessing the https site through code.But its working in .net as well as in browser. How to access the https through vc++ code?
how to set the SSLClientCertificate Name in code?
SoapClient3.ConnectorProperty("SSLClientCertificat eName") =LOCAL_MACHINE\[store-name\]]cert-name ;
The http site is working when i access through the code?
Please give me the procedures to access the https site through vc++ code?
Anyhelp would be appreciated.
Regards,
R.Sundar
sundar
|
|
|
|
|
Hi
Please How I can delete element from the struct that contain arrays
This is My Code
<br />
struct Member<br />
{<br />
char name[50];<br />
char address[30];<br />
int number;<br />
};<br />
struct Member member[100];<br />
<br />
And i have this Function for delete elements But how i can complete it<br />
<br />
void delete_member ()<br />
{<br />
int search;<br />
<br />
cout <<"Enter Your Number of member:";<br />
cin >> search;<br />
<br />
for (int i=0;i<100;i++)<br />
{<br />
if (member[i].number == search)<br />
{<br />
<br />
<br />
}<br />
}<br />
<br />
-*-*-*-*-*-*-*-*-*
To Be Or Not To Be
(KARFER)
-*-*-*-*-*-*-*-*-*
|
|
|
|
|
You can't remove elements in such an array. And even worse, your array will be initialized with garbage structures (except if you provide a default constructor to your structure).
I suggest you take a look at a std::list, this will do what you are looking for (but you'll probably need some time to learn how to use it, look for some tutorials).
|
|
|
|
|
You cannot remove an element from a "hard-coded" array like that, you will need to either mark/tag the element as "removed" or copy the elements that you want to keep to a new array and remove the old one. but that sucks.
If you need to add and remove elements to an "array", I suggest you have a look at ode>std::list (not std::vector ).
|
|
|
|
|
Since the array is allocated onto the stack you cannot delete (i.e. remove) items. However you can erase the info wherein, for instance:
...
for (int i=0;i<100;i++)
{
if (member[i].number == search)
{
member[i].number = -1;
memset( member[i].name, 0, 50);
memset( member[i].address, 0, 30);
break;
}
}
...
You can also use an old (soft removing) trick: swap the found item content with the (currently) last one and decrease the element count.
BTW: don't use explicitely numbers (eg. 50 , ...) in code, use meaningful symbolic consts instead (e.g. NAME_SIZE , ...).
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.
|
|
|
|
|
think STL buddy, think STL !
|
|
|
|
|
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) ?
|
|
|
|