|
Yeah Alok I knew it but U didnt get my ques. I wanted to check them thru my pgm, I might need to use "RegOpenKey()" n "RegEnumKey()" funcs.
I m trying it out. hope U got my point.bye for now.
Thanks n Regards,
Supriya Tonape
|
|
|
|
|
|
|
Thanks Alok and Ravi.
I solved my prob ))) as I told U b4 I used those functions.
Thanks for Ur help.
Regards,
Supriya Tonape
|
|
|
|
|
Ravi Bhavnani wrote:
Corrected link[^]
Thanks
"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
|
|
|
|
|
int x;
for(i=1;i<=10;i++)
{
x=i;
cout<
|
|
|
|
|
in the second case, it may allocate memory on different places, but as it is the system which decides, x may have the same address many times...
in C/C++, a variable declared in a local scope is destroyed when the program gets out of that scope. here, it the case at each loop of the for...
TOXCCT >>> GEII power [toxcct][VisualCalc]
-- modified at 6:11 Monday 5th September, 2005
|
|
|
|
|
Vivekuniq wrote:
int x;
for(i=1;i<=10;i++)
{
x=i;
cout<<x;
}< i="">
Here memory for variable X will allocated in Stack for entire LOOP duration
Vivekuniq wrote:
for(i=1;i<=10;i++)
{
int x;
x=i;
cout<<x;
}< i="">
Here the Memory of Variable X will allocated and deallocated in each cycle of loop!
"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
|
|
|
|
|
Again both came for race greate. I like you both.
Nice talking to you.
|
|
|
|
|
G Haranadh wrote:
I like you both.
Thanks for liking Us
"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
|
|
|
|
|
|
In the second case, variable i will still be on the stack. It's likely that it vill occupy the same memory address at every loop, since the stack doesn't change within the loop.
Or am I wrong?
|
|
|
|
|
kakan wrote:
It's likely that it vill occupy the same memory address at every loop, since the stack doesn't change within the loop.
purly depend on OS, AFAIK, Stack will be cleaned at every iteration!
"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
|
|
|
|
|
Yes, the stack variables will be cleaned, that's true. But the variable i will be recreated for every iteration of the loop.
That's why i beleive that the variable i will occupy the same memory address of the stack for every iteration.
It's the compilers task to handle the stack, depending on calling convention etc., not the OS.
BTW, the stack isn't cleaned or allocated (except when the process/thread starts and exits). So i think 'cleaned' isn't very appropriate. Referenced/dereferenced is better, in my opinion.
Pls do correct me if I'm wrong.
|
|
|
|
|
kakan wrote:
Yes, the stack variables will be cleaned, that's true. But the variable i will be recreated for every iteration of the loop.
That's Whats I am saying...
kakan wrote:
It's the compilers task to handle the stack, depending on calling convention etc., not the OS.
yeah I know but Compiler doesn't allocate address to the stack. That the Work of OS, you can correct if i am wrong..
kakan wrote:
the stack isn't cleaned or allocated (except when the process/thread starts and exits).
But PUSH and POP happens, i.e. variable is push and pop into/from Stack.
"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
|
|
|
|
|
It could happen both situations ... It also depends on the memory usage of others threads.
... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
|
|
|
|
|
hmmmm.... i get it .. n will be back with the next Qn..
thanx
V
|
|
|
|
|
The behavior here is dependent upon the compiler implementation. When you define a variable, two things happen. One, memory is allocated to store the variable, and two, the variable's constructor is called to initialize it.
For atomic data types, the compiler may in effect perform a single static allocation, just prior to the top of the loop. This allocation occurs by virtue of assigning the variable 'x ' a fixed offset from the stack pointer.
Regardless of how the memory is allocated, the compiler will call the constructor at the beginning of each iteration. Since 'x ' is of type int , the constructor doesn't do anything.
How the compiler allocates memory in this case should be immaterial to you. When a variable is defined inside the loop, you should treat it as if it were newly constructed. For simple int values, this means the variable is uninitialized, and you can't rely on it containing the results from the previous iteration.
Software Zen: delete this;
|
|
|
|
|
How to use CByteArray to store and retrieve unsigned char data
|
|
|
|
|
snprani wrote:
How to use CByteArray to store and retrieve unsigned char data
//To Store
CByteArray bytArray;
bytArray.Add(10);
bytArray.Add(11);
bytArray.Add(11);
//to retrieve
for(int i=0;i<bytArray.GetSize();i++)
{
cout<<bytArray.GetAt(i);
}
"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
|
|
|
|
|
A vc project using IHTMLDocument3 interface:
#include <mshtml.h>
//...
class CHTMLDocument2 : public CObject
{
//...
IHTMLDocument3* pHTMLDocument3;
};
When I building this project, report error messages as follows:
error C2143: syntax error : missing ';' before '*'
error C2501: 'IHTMLDocument3' : missing storage-class or type specifiers
And I find that there isn't class IHTMLDocument3 in the file <mshtml.h> of my compuer.
Is there anyone tell me how to upgrade <mshtml.h> and mshtml.dll to use IHTMLDocument3 interface?
Or other way to build this project successfully?
Thanks
Study! Study! Study!
Hard! Hard! Hard!
-- modified at 5:06 Monday 5th September, 2005
|
|
|
|
|
|
I have installed the SDK, and add the path of SDK to Tools-->option-->Directories include files, then when building, another error occurs:
error C2601: 'LONG_PTR' identifier ...
the 'LONG_PTR' appears in <mshtml.h> of SDK.
How can I resolve the problem?
|
|
|
|
|
on what line does it crash within your code ?
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
the error messages are partly listed below:
c:\program files\microsoft platform sdk\include\mshtml.h(40510) : error C2061: syntax error : identifier 'LONG_PTR'
c:\program files\microsoft platform sdk\include\mshtml.h(40513) : error C2061: syntax error : identifier 'LONG_PTR'
c:\program files\microsoft platform sdk\include\mshtml.h(40516) : error C2061: syntax error : identifier 'LONG_PTR'
...
The corresponding codes in the file mshtml.h is listed below:
virtual /* [nonbrowsable][restricted][hidden][id][propget] */ HRESULT STDMETHODCALLTYPE get_imeCompositionChange(
/* [out][retval] */ LONG_PTR *p) = 0;
virtual /* [nonbrowsable][restricted][hidden][id][propget] */ HRESULT STDMETHODCALLTYPE get_imeNotifyCommand(
/* [out][retval] */ LONG_PTR *p) = 0;
virtual /* [nonbrowsable][restricted][hidden][id][propget] */ HRESULT STDMETHODCALLTYPE get_imeNotifyData(
/* [out][retval] */ LONG_PTR *p) = 0;
How to resolve this problem?
Study! Study! Study!
Hard! Hard! Hard!
-- modified at 7:30 Monday 5th September, 2005
|
|
|
|