|
Stack overflow usually means that you have infinite recursion in your program. Have a look at Call Stack debug window when your program crashes - you'll see where's the problem.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
I found how to avoid this.
But i know now how to increase the stack size with /STACK in link menu.
|
|
|
|
|
Does SetCurrentDirectory() in CFtpConnection throw any exceptions?
Law is meaningless without chaos.
Chaos without Law is equal to destruction.
Chaos and Law create our rich and colorful world.
|
|
|
|
|
The docs say
Returns Nonzero if successful; otherwise 0. If the call fails, the Win32 function GetLastError may be called to determine the cause of the error.
Looking through the FTP code, there doesn't seem to be any code to throw an exception.
Michael
|
|
|
|
|
But when I use SetCurrentDirectory in CFtpConnection calss, I sometimes got a error message from WININET.DLL and KERNEL32.DLL. I don't know why. Could you explain it?
Law is meaningless without chaos.
Chaos without Law is equal to destruction.
Chaos and Law create our rich and colorful world.
|
|
|
|
|
Hello fellow programmers,
I was wondering how a program like Dr.Watson is hooked into the exception handling mechanism.
This question actually has a background:
For my next project, they've asked me to do some bug-hunting in a HUGE (multi threaded) service process (netto > 1 mil. lines of code over 10.000 files). This peace of code (telecommunication related) has been ported from embedded system, and NO active usage of structured exception handling is used (more C than C++ oriented).
The problem is that in some situations an exception occures, and we want to be able to produce *any* possible kind of info. But since the Windows NT exception handling mechanism is taking over everything, no way of getting some runtime-info. And also: it is a service process, so no interface to user exists.
My idea was to implement a kind of 'general exception handling' function within our application, dumping possible information to a file.
Other suggestions are also welcome, or links to site/topics regarding this topic.
Cheers,
EiSl
|
|
|
|
|
Buy John Robbins Debugging Applications (Microsoft Press). I've read it once, so I know it covers everything you want to know and more, but I've not had enough time to read it often enough to actually answer the question without looking it up. I doubt I could do it justice in any case, you need this book.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
> I was wondering how a program like Dr.Watson
> is hooked into the exception handling mechanism.
It's actually a debugger. I suggest reading April 1997 issue of MSJ; there's a column titled 'Under The Hood' by Matt Pietrek. The article presents a way to set the default exception filter per-thread basis. It should be in your VC++ help (look in the 'Periodicals' section), if it's not there, go to MSDN Online.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
I was wondering how to create a simple grid, using the win32 api only.
Dont want to use MFC or something like that. I cant find any predefined
control classes like BUTTON, EDIT and so on to pass in to CreateWindow()..
So howto do it?
|
|
|
|
|
There is no grid control provided with VC except as an OCX. You'll need to create a window, draw it yourself and respond to messages yourself. Chris has done an excellent job of doing this with MFC, and others have ported it to WTL, all available on the site.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
Oh.. Well, I started to expect that. I'm used to c++ builder, were you got a grid control just a mouseclick away, now I'm going to port a project to windows ce, cant use builder then... The MFC grid by Chris looks great, but a bit to complex for my needs... Not sure it would run on ce without some changes.
I'm leaning towards just stacking some edit controls together and doing some functions to achieve grid type functionality.
|
|
|
|
|
I think that the grid control has already been converted to run on CE.
Michael
|
|
|
|
|
Hi !!
I have this DLL in which i the global system hook procedure. also there is an installing and an uninstalling function which i have exported and use it in a separate EXE. i am not going in for shared data segments coz only my process is gonna use this hook.
now i have declared a global flag in the DLL which i want the hook to set upon invocation. now the hook is invoked but it does not set the flag !!
i saw a number of examples on hooks but all examples use PostMessage(). the thing is that i don't want to communicate with the server. i just want to set a global variable in the DLL using the hook, so PM() doesn't make sense.
could you plz suggest something??? i am in dire straits
regards,
Faiz.
|
|
|
|
|
Use #pragma data_seg. More details in MSDN and in KB article Q125677.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Do functions in CSocket class throw exceptions?
Law is meaningless without chaos.
Chaos without Law is equal to destruction.
Chaos and Law create our rich and colorful world.
|
|
|
|
|
Yes, at least searching through MFC source shows an AfxThrowResourceException() in CSocket::PumpMessages(), and other AfxThrow*()s in CAsyncSocket and CSocketFile code.
|
|
|
|
|
Thanks a lot
Law is meaningless without chaos.
Chaos without Law is equal to destruction.
Chaos and Law create our rich and colorful world.
|
|
|
|
|
Can anyone tell meho w to put a conversion constructor in this and implement it?
Matt
#include <iostream.h>
#include <string.h>
#define maxString 32000
class myString
{
int length;
char *stringData;
public:
myString();
myString(myString &);
int lengthof();
void show();
void getString();
};
myString::myString() // default constructor
{
length = 0;
stringData = new char[1];
}
myString::myString(myString &) //copy constructor
{}
void myString::getString()
{
char *firstString = new char[maxString];
cout << "Enter String: ";
cin.getline(firstString,maxString);
length = strlen(firstString);
stringData = new char[length];
for (int I=0;I
|
|
|
|
|
Not sure what you mean by a "conversion constructor". If you mean a copy constructor, then the prototype needs to be myString::myString( const myString& ) Note the parameter is a constant reference, your current code is missing the const.
--Mike--
http://home.inreach.com/mdunn/
your with and
|
|
|
|
|
Well, I was trying to display the date/time stamp (last modified) of a file using the following:
FILETIME ftTmp;
SYSTEMTIME stTmp;
GetFileTime( hFile, NULL, NULL, &ftTmp );
FileTimeToSystemTime( &ftTmp, &stTmp );
And I have noticed that the time I have derived was always 8 hours late. This is true to all the files I tried to read the info from. Am I doing something wrong here? Are there initializations needed? Is this a problem of MFC?
Any help/comment would be appreciated. Thanx!!!
Ryan V. - ryan@mobiling.nec.co.jp
----------------------------------
Discovery consists of looking at
the same thing as everyone else
and thinking something different.
----------------------------------
|
|
|
|
|
I was still looking around to solve my particular problem and I came across this function: FileTimeToLocalFileTime()
And added this to my code:
FILETIME ftTmp, ftLocal;
SYSTEMTIME stTmp;
GetFileTime( hFile, NULL, NULL, &ftTmp );
FileTimeToLocalFileTime( &ftTmp, &ftLocal );
FileTimeToSystemTime( &ftTmp, &stTmp );
This seems to solve my problem. The time returned by GetFileTime was UTC based and I still have to convert it to local time. This would account for the 8 hours discrepancy 'coz my current location is GMT+08:00.
Hehehe... I solved my own problem.
Ryan V. - ryan@mobiling.nec.co.jp
----------------------------------
Discovery consists of looking at
the same thing as everyone else
and thinking something different.
----------------------------------
|
|
|
|
|
http://www.codeproject.com/dialog/stackdialog.asp
A great example with exactley what I need in my program. One problem....how do I derive my dialogs to TStacked Dialog thingy?
Argh if someone can explain this to me and how to get this working in my app, please Id appreiciate it very very much!
Thanks
Ashley 'Ashman' Rowe
www.settlers.net
|
|
|
|
|
I'm not quiet sure what your problem is. Have you looked at the demo project with the article.
Create your dialog resource as normal, create a class for CDialog and then edit the code and replace CDialog with TStackedDialog and make the other changes the article describes.
hope this helps,
Michael
|
|
|
|
|
Thanks man! I will try that....Sounds so easy here I am thinkin there is an option to derive from a class LOL!!
Thanks again
Ashman
www.settlers.net
|
|
|
|
|
Hi,
It seems quite complicated to use tab controls. I tried many times to get it work, but without success...
Could someone briefly explain me how to get things working? What are the different steps?
Thanks very much for your help
|
|
|
|