473,563 Members | 2,895 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Interesting conclusion

Well,
I don't know if this is 100% true and all comments are welcome.

I built statically linked MFC DLL as shell extension.
One function generated stack overflow all the time.
DEBUGGING function was looking like this:
void My_Func(_TCHAR *str1, _TCHAR *str2, _TCHAR arr[][256])
{
My_Func(str1, str2, arr);
{
char CharMap[(_TCHAR)-1];
}
}
this function generate STACK OVERFLOW after SECOND call to itself.
So I concluded that statically linked DLL includes ALL variables from
function, no matter what scope are they in.
I wrote second function :
void My_Func(_TCHAR *str1, _TCHAR *str2, _TCHAR arr[][256])
{
My_Func(str1, str2, arr);
{
char *CharMap;
CharMap = (_TCHAR *)malloc((_TCHA R)-1);
free(CharMap);
}
}
and it works fine! (it work for at least 30 calls to itself)

Am I correct in my assumption(conc lusion)?

Thanks
Nov 16 '05 #1
0 974

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

50
5450
by: Edward K. Ream | last post by:
I would like to say a few (actually more than a few) words here about some recent discoveries I have made concerning the interaction of Leo and Python. If you don't want to hear an inventor enthuse about his work, please feel free not to read further :-) There are at least three, no four, no five, no six, no seven reasons why Leo and Python...
8
1671
by: Bruno R. Dias | last post by:
Perhaps it would be interesting to program a virtual machine simulating an ancient computer (such as the pdp-7). Then, it would be rather interesting to code for it (porting gcc to it maybe?). I think it would be fun to play with the long-forgotten art of coding in machine language. And what about a fictional computer, such as one that works...
8
4514
by: adrien | last post by:
Thanks for all the answers about how to hide scrollbars in netscape. The conclusion is that it's not possible. My initial purpose is to compare some Netscape and IE possibilities and it's the second time that i have to conclude that Netscape can't do something while IE does: 1) IE is able to hide scrollbars (even only vertical or only...
12
1637
by: rawrite | last post by:
I am just finishing watching a documentary about Rod Serling. It was cool, but after 20 minutes it got boring and all I wanted to do is subscribe to Net Flix and rent the Twilight Zone episodes. Some times the work is more interesting than the life.
12
1835
by: Davy | last post by:
I found a interesting pointer problem. What does the pointer mean? EXTERN short (*blocks); And what does the malloc mean? blocks = (short (*))malloc(count*sizeof(short )); Any suggestions will be appreciated!
3
1556
by: eBob.com | last post by:
Is there a namespace of interesting and important constants such as maximum length of a filename, maximum length of a path, maximum and minimum values which can be held by a Long (and other data types of course), etc., etc.? In C there is a header file (I forget its name at the moment) with things like MAX_PATH. Most useful. I know...
27
2306
by: Frederick Gotham | last post by:
I thought it might be interesting to share experiences of tracking down a subtle or mysterious bug. I myself haven't much experience with tracking down bugs, but there's one in particular which comes to mind. I was writing usable which dealt with strings. As per usual with my code, I made it efficient to the extreme. One thing I did was...
66
3637
by: prady | last post by:
hi all, could any one solve the following C program. If any one knows the answer please post it Ques: A C function that will print 1 to N one per each line on the stdout , where N is a int parameter to the function. The function should not
126
4301
by: jacob navia | last post by:
Buffer overflows are a fact of life, and, more specifically, a fact of C. All is not lost however. In the book "Value Range Analysis of C programs" Axel Simon tries to establish a theoretical framework for analyzing C programs. In contrast to other books where the actual technical difficulties are "abstracted away", this books tries to...
0
7665
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7888
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8106
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7642
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
5213
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3643
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1200
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
924
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.