|
Can you give me some code to see?
I want to have many friends
|
|
|
|
|
kevinalphaxz wrote: Can you give me some code to see?
Honestly? No.
|
|
|
|
|
Is there a "Back" feature in C++?
I often come across a structure reference or variable in a program. I put the cursor on it, hit F12, and jump to the definition of the structure. Then I want to go right back to where I came from. Any neat way to do this other than just navigate back?
Thanks
|
|
|
|
|
CTRL - works in VS2005.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
In VC 6, it's Ctrl + NumPad -
|
|
|
|
|
First of all, I admit freely that I have little knowledge in internet technology.
I want to read in parts of a website using C++/MFC. Using CHttpFile.functions I'm already able to read the webpage into a file. BUT: The problem is, I have to type in my nickname and passwort to reach the data in my account on this website. Can somebody tell me what to do? Or give me a hint what book/article/tutorial to read?
thanks, Veikko.
Additional info:
I analysed the html-code the website returns and I think I found the piece of code that submits the data:
...
I guess that this calls a script on the server to have the subroutine "checkLogin()" executed. checkLogin() is a html-routine that is also available in the website's sourcecode; it reads the values from the edit boxes.
My problem is now: 1. how do I set the value of the edit box to my password and 2. how do I trigger that server-script from my C++ program?
P.S.: Since my question touches C++ as well as internet-programming I posted this question in the "Internet"-board too.
|
|
|
|
|
I know of a way to do this, but it is not C++. It is VB script.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Even if its VB script, let me know. Maybe I find a way to convert it..
Veikko.
|
|
|
|
|
Here's one I used to use with the HowStuffWorks forum:
Dim objIE
Set objIE = WScript.CreateObject("InternetExplorer.Application")
objIE.Navigate "http://forum.howstuffworks.com/login.php?Cat="
objIE.Visible = true
While objIE.Busy = true
Wend
objIE.Document.All("Loginname").Value = "DavidCrow"
objIE.Document.All("Loginpass").Value = "pwd"
objIE.Document.All.Item("option", 0).Click The last line is what "clicked" the button.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Thanks, David, dor the quick answer. I'm going to try this.
veikko.
|
|
|
|
|
Hi,
I have function that i allocate very large data
in Heap, after i create with new & use it
when i want to delete these , there is memory
overrun error & i do not know how can i solve that!
|
|
|
|
|
mostafa_pasha wrote: ...there is memory
overrun error...
What do the new and delete statements look like?
Is the pointer returned from new being changed (e.g., incremented?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
It is hard to help you if you don't at least show the relevant portions of your code.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
Didn't you get the memo, Zac? Today is guess-what's-wrong-with-my-code-without-seeing-it day.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Apparently it fell under the stack of memos reminding me to fill out my damn TPS reports.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
lol - I LOVE that movie!
.... reaching for my red stapler
Charlie Gilley
Will program for food...
Whoever said children were cheaper by the dozen... lied.
My son's PDA is an M249 SAW.
My other son commutes in an M1A2 Abrams
|
|
|
|
|
mostafa_pasha wrote: there is memory
overrun error & i do not know how can i solve that!
Don't overrun the end of your allocated memory.
Mark
|
|
|
|
|
Mark Salsbery wrote: Don't overrun the end of your allocated memory.
HI Mark,
could you explain it further do you mean something like this
int* pnSize=new int[10];
pnSize[10]=10;// which is not available
delete [] pnSize;
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
That is extremely well done, yes
cheers,
Mark
|
|
|
|
|
Actually I was wrong about your code being "well done"...
The original poster said "i allocate very large data".
Therefore, your code sample should be:
int* pnSize=new int[100];
pnSize[100]=10;// which is not available
delete [] pnSize;
Have a great day,
Mark
|
|
|
|
|
excuse me for delay to response,
//OVERRUN is for Pitch array ....
<br />
char *BeginFile = NULL; <br />
BeginFile = new char[44]; <br />
<br />
<br />
try <br />
{<br />
File.Read(BeginFile,44);<br />
}<br />
catch(CFileException *pe) <br />
{<br />
pe->ReportError();<br />
}<br />
<br />
DWORD dwLength = (File.GetLength()-44);<br />
<br />
char *inChar ; <br />
inChar = new char[800000];<br />
<br />
<br />
try <br />
{<br />
File.Read(inChar,dwLength);<br />
}<br />
catch(CFileException *pe) <br />
{<br />
pe->ReportError();<br />
}<br />
File.Close();<br />
<br />
int tmp;<br />
unsigned char c1,c2;<br />
double *in ; <br />
in = new double[400000];<br />
<br />
<br />
int smp=dwLength/2;<br />
<br />
const int fs=22050; <br />
const int fc=7500; <br />
int kc = floor( (double)(fc * N / fs) )+1; <br />
int len=ceil((double)smp/N*2)+1;<br />
double *CBn ;<br />
CBn = new double[kc*len];<br />
<br />
int sizeCB;<br />
sizeCB = Netmfile.Feature( in , kc ,smp , CBn );<br />
<br />
<br />
int *Pitch = NULL;<br />
Pitch = new int[3000];
int LenPitch = Netmfile.PitchExtract( in ,smp ,Pitch );<br />
<br />
delete in;<br />
delete BeginFile;<br />
delete in;<br />
delete BeginFile;<br />
char weigthpath[]="text\\";
<br />
double *CB1t ;<br />
CB1t = new double [kc*len];<br />
<br />
Netmfile.net( CBn , CB1t , kc , weigthpath , sizeCB );<br />
<br />
Netmfile.z = sizeCB * N - (sizeCB-1) * (N/2);<br />
smp2 = new double [Netmfile.z];<br />
for (i=0 ; i<Netmfile.z ; i++)<br />
smp2[i]=0;<br />
<br />
delete CBn;<br />
delete CB1t;<br />
delete Pitch;
<br />
}<br />
<br />
<br />
<br />
int mfile::PitchExtract( double *input ,int lengthwav ,int *pitch )<br />
{<br />
<br />
a=49;<br />
p=0; m=0; k=0; i= 0; j=0;<br />
maxfft=0;<br />
maxpos=0;<br />
int *pichi= NULL;<br />
pichi = pitch;<br />
<br />
<br />
while ( m< lengthwav-N )<br />
{<br />
*pichi= maxpos + 1;<br />
m = m + *pichi;<br />
pichi++;<br />
p++;<br />
}<br />
<br />
<br />
m=1;<br />
i=0;<br />
pichi = pitch;<br />
while (i<p)<br />
{<br />
m=m+pichi[i];<br />
if (m>N/2)<br />
{<br />
for ( j=p ; j>=i+1 ; j--)<br />
pichi [ j ] = pichi [ j - 1 ] ;<br />
pichi [ i ] = N/2;<br />
pichi [ i + 1 ] = m - N/2;<br />
m=0;<br />
p++; <br />
}<br />
i++;<br />
}<br />
return (p);<br />
}<br />
|
|
|
|
|
First of all...what's going on in these sections....you left something out
for (i=0 ; i smp2[i]=0;
delete CBn;
delete CB1t;
delete Pitch; // have problem.......................use devpartner say OVERRUN
}
...
while (i {
m=m+pichi[i];
if ...
Mark
|
|
|
|
|
excuse me for this fault,
i do not know when i ignore HTML tags , the messeage is correct
Netmfile.z = sizeCB * N - (sizeCB-1) * (N/2);
//double *smp2;
smp2 = new double [Netmfile.z];
for (i=0 ; i<Netmfile.z ; i++)
smp2[i]=0;
delete CBn;
delete CB1t;
delete Pitch;
//second
m=1;
i=0;
pichi = pitch;
while (i<p)
{
m=m+pichi[i];
if (m>N/2)
{
for ( j=p ; j>=i+1 ; j--)
pichi [ j ] = pichi [ j - 1 ] ;
pichi [ i ] = N/2;
pichi [ i + 1 ] = m - N/2;
m=0;
p++; //beacause of increase of Pitch length in each atage
}
i++;
}
return (p);
|
|
|
|
|
mostafa_pasha wrote: delete Pitch; // have problem.......................use devpartner say OVERRUN
Use delete [] Pitch instead.
All new[] must have a matching delete[] .
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi, but there is not diffrence , i think before i must use
delete [] when i create two dimensional array in heap such as
this:
vf_Weigth = new float* [nlayer2+1];
for ( i =0 ; i< (nlayer2+1) ; i++)
vf_Weigth[i] = new float[nlayer1];
delete [] vf_Weigth;
// but now i find i delete in these way:
for (int i = 0; i < nlayer2+1 ; i++)
delete vf_Weight[i];
is that code is correct?
at last i say again delete [] Pitch is not work & my code have that serios
error.
Best Regards.
M.J.M.
|
|
|
|