|
mahesh.mundackal wrote: but when i include these header files in my VC++ project to access Data from the system, i get Fatal Errors, cannot include the header files.
What errors?
Nobody can give you wiser advice than yourself. - Cicero
|
|
|
|
|
mahesh.mundackal wrote: i get Fatal Errors, cannot include the header files. What could be the problem.
Hint, hint. Linker is unable to find the header files. check your paths.
|
|
|
|
|
what errors? and can you show them.
|
|
|
|
|
Hi all,
I have created an SDI application and 3 dockable toolbars within them. But the problem is these toolbars are appearing in 3 different lines being left aligned. I want them to be in a single line unless the first line is filled.
Is there is any way to align the tool bar just after creation.
Anurag Gandhi.
|
|
|
|
|
Dear,
I want to insert an ActiveX control of DIO card in SDI Application. Previously I tried this in Dialog based application it worked. But when I inserted it in the SDI application. It Compiled with no errors but when I RUN it this is givig some error.
Plz any one of u have solution how to insert an ActiveX control in SDI plz send it.
Murali.S
|
|
|
|
|
Murali_mom wrote: this is givig some error.
Please wait until I search my telescope, so that I can look at your monitor to read those errors.
Nobody can give you wiser advice than yourself. - Cicero
|
|
|
|
|
Plz find some solution I need it badly
|
|
|
|
|
brahmma wrote: Please wait until I search my telescope, so that I can look at your monitor to read those errors.
Maybe dont need to telescope ,like advanced tools (did you see Ring I,II).
|
|
|
|
|
Can you more explain about errors?
|
|
|
|
|
I have a program,using thirdpart code.(there are some C codes in it)
It works when I debug it step by step,but it would crash if I run it weather in release or debug mode.
I found that there are some exceptions occur.But the most strange thing is that the exception cound not be catched using CException but only be catched if I use catch(...).
Someone would tell me why?
BEST REGARDS
|
|
|
|
|
You are probably stomping on memory that you do not own. Can you post relevant portion of the code where the crash occurs?
Nobody can give you wiser advice than yourself. - Cicero
|
|
|
|
|
OK,it very kind of you.
But if you give me your e-mail,that I can send the codes for you?
My E-mail is:kcynic@163.com
Thanks.
|
|
|
|
|
kcynic wrote: But if you give me your e-mail,that I can send the codes for you?
Please don't email me any code. Post the "relevant" code right here. By relevant, I mean the code where the crash occurs. That way, even if I can't figure out the problem, somebody else will! And the reply might be useful to someone who may search the forums for a similar problem in the future. That is the very reason behind having discussion forums.
PS: Edit your previous post to remove your email id from it. You are inviting spam by displaying your email ID on a public forum, which search engines will index.
Nobody can give you wiser advice than yourself. - Cicero
|
|
|
|
|
my codes is so simple,and the exception was occured in the thirdpart codes.
I don't think the error could be handled using such no sense codes.
my codes like this:
CMyODBC db;<br />
int rows=0;<br />
if(!db.ConnectDB("Test","sa",""))<br />
{<br />
AfxMessageBox("Opent the database failed!");<br />
return;<br />
}<br />
CString sql="SELECT * FROM [KB_USERS_ALL]";
CODBCSet set;<br />
<br />
db.PrepareSql(sql,set);<br />
try<br />
{<br />
db.FetchData();<br />
CString str;<br />
char* msg=set.m_coldata[0].value;<br />
}<br />
catch (...)
{<br />
AfxMessageBox("Exception");<br />
}<br />
<br />
try{ <br />
while(db.FetchData())<br />
{<br />
rows++;<br />
CString str;<br />
for(int i=0;i<set.GetCols();++i)<br />
str+=set.m_coldata[i].value;<br />
AfxMessageBox(str);<br />
}<br />
}catch(...)<br />
{<br />
AfxMessageBox("dfgdsg");<br />
}<br />
CString str;<br />
str.Format("there has %d records",rows);<br />
AfxMessageBox(str);<br />
try{<br />
}catch(...)<br />
{<br />
<br />
}
But thanks all the same.
Best regards to you.
|
|
|
|
|
You see, CException is the base class for all exceptions in MFC. I don't know an MFC class named CMyODBC . Check with your third party vendor if they have an exception handling class for their CMyODBC class.
Nobody can give you wiser advice than yourself. - Cicero
|
|
|
|
|
Looks like your third party C may be throwing but C doesn't use CException, that's a C++ class, so catch( CException ) won't work. You could try catch( std::exception ) in case it's throwing something derived from the standard library exception. Other than that I would try catch( char* ). Believe it or not this may be the only way to trap some C exceptions short of catch(...) which really doesn't let you find out what's wrong
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
Matthew Faithfull wrote: Other than that I would try catch( char* ).
The Old Skool method
Nobody can give you wiser advice than yourself. - Cicero
|
|
|
|
|
Yes,I know that you mean.The part C code CMyODBC only a general class using Win Database API,as you said,if there has some try block,it also doesn't throw CException.
Thanks.I would go steep into the code and find the error(because there is no try-catch block in it!)
|
|
|
|
|
|
Thanks,but I want to know why the codes didn't throw an exception when I trace it step by step,but only when I run it there would be some exception.
|
|
|
|
|
There's no obvious reason why you'd get exceptions only when you don't run step by step but there are two related likely causes.
Stepping through the code affects two things, speed and thread synchronisation. If multiple threads are involved then the code may work when single stepped but crash when run for real if data or resouce sharing between the threads is faulty.
If it's single threaded then all you really have left is speed and unless there's any io/comms external or interprocess communication going on then the difference would be hard to explain. Usually single stepping would only make the system work if the code being run is overrunning a buffer in another, flawed, process but doesn't fill the buffer as fast when single stepped so you don't see the bug.;)
The only way you're going to get to the bottom of this is to look at what the excpetion tells you and where it occurs. Find the exception code e.g. 0xC0000005 for Access Violation and make sure the debugger is set to always break on that exception. If the debugger is being cryptic you could always post what it says and someone may recognise it.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
That's not scary, it's normal.
In standard C++ try /catch can only catch C++ exceptions: that is only exceptions that are raised by the C++ throw statement. Unfortunately some version of Microsoft Visual C++ (6.0 and below) do not follow the standard in this regard. This was fixed in later versions but the old non-standard behaviour can be selected with the /EHa[^] switch (not a good idea in general).
__try /__except is a low level construct and can catch any exception. Note however that with __try /__except the destructors of objects on the stack as it is unwound are not called, so this construct doesn’t play nice with C++. It will break the RAII pattern for example.
Steve
|
|
|
|
|
Hi,
Can I allign(right,left,center) text in a message box(MessageBox or AfxMessageBox API).
Warm Regards,
Mushq
|
|
|
|
|
Mushq wrote: Can I allign(right,left,center) text in a message box(MessageBox or AfxMessageBox API).
Left: Yes, by default.
Right: Yes, use MB_RIGHT style.
Center: Not with the standard message box. There might be custom messagebox classes around which will do it. Google for it.
Nobody can give you wiser advice than yourself. - Cicero
|
|
|
|
|
i want the sample c++ code to find the inverse of a 4 by 4 matrix please help
My small attempt...
|
|
|
|