|
And how the heck do you expect us to answer that when you don't say what DB API you're using (or even what you'd like to use)? With the information you have given so far I'd say you should go with Firebird.
|
|
|
|
|
Is the debugger in VC++ always indicating mem leaks, or is it necessary to change the settings ?
~RaGE();
|
|
|
|
|
VC++ debugger does not indicate the memory leaks.
You can use CRT libary programatically to check the memory leaks, but this is of not great help compred to third party tools like BoundsChecker, etc.
Thanks,
Ramy
|
|
|
|
|
Ramu Pulipati wrote:
VC++ debugger does not indicate the memory leaks.
Hem .. actually it does ... what I want is (surprisingly) not to know _where_ are memory leaks, but to know if _there are_ memory leaks ...
To be a little bit more clear, I have developped an API. In a test program for this API, I do not have any mem leaks detected by the debugger. But when I use some functions from this API into a more consequent mem leaks free application, then I get the memory leaks. So i suppose this __must_ be the API, and hence I´ve concluded that in the big application, project settings must have changed so that it indicates mem leaks . Is that clear or are you already (BTW is that a new emoticon ? Never saw it before ??)?
~RaGE();
|
|
|
|
|
Yes, it's a new emoticon. VC *tries* to detect memory leaks, third party products do it better.
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
Half the reason people switch away from VB is to find out what actually goes on.. and then like me they find out that they weren't quite as good as they thought - they've been nannied. - Alex, 13 June 2002
|
|
|
|
|
VC detects mem leaks by use of redirecting new and delete functions.
When u'r using API calls for allocation and such, VC debugger can't see that.
For these leaks use boundschecker and such..
|
|
|
|
|
OK. Thanx to all of you.
~RaGE();
|
|
|
|
|
I suspected that I had a memory leak or handle leak of some sort and have spent ages trying to find it. The other day I found a free 30 day demo for an app called GlowCode. It was really easy to use, you don't change your code, just attach it to your app while its running.
Anyway I found my problem in a couple of hours . I thought you might be interested, here's the link ....
http://www.glowcode.com/
Ali
|
|
|
|
|
Ouahh that app is great !
Thank you very much !!!!
~RaGE();
|
|
|
|
|
Hi
I'm just looking for the header file shldisp.h, but could not find it anywhere. MSDN didnt help, and I installed VS SP5, but it didnt contain this file. Where to get it? If somebody got, can you attach this here?
Regards,
Ravi
|
|
|
|
|
|
Help please - I have an INSERT query of the form:
INSERT INTO MyTable (Field1, Field2...) VALUES (Value1, Value2...)
into a SQL Server Database. It is failing due to invalid text in one of the Parameters.
Now, I want to report the SQL query and Parameter Values when the failure is detected to aid debugging any future issues.
But GetSQL() only returns the SELECT query - the m_strUpdateSQL contains the "INSERT ... VALUES (?, ?...)" but there is no access Function!
Also if I try to use GetFieldValue() (to try to report the parameter values) my application just dies with an exception - presumably because they are only valid for a SELECT?
Is there any way to get at the Parameter Values?
Any help from someone out there who is familiar with CRecordsets, etc. would be gratefully received.
|
|
|
|
|
I'm having trouble understanding your question.
Is the Insert generated by your code then executed in a CRecordset Open or CDatabase Execute? If so, just print it out.
Is it in a stored procedure on the SQL server? If so, You're asking the wrong people.
Once you have the statement, copy it into a SQL Server Query Analyzer window to see diagnostics and error messages.
|
|
|
|
|
You need to execute your SQL Statement with CDatabase::ExecuteSQL and get the error with CDBException
CString str = "INSERT INTO MyTable .....";
TRY
{
m_db.ExecuteSQL(str);
}
CATCH(CDBException, e)
{
AfxMessageBox(e->m_strError);
}
END_CATCH
Best Regards
Carlos Antollini.
www.wanakostudios.com
Sonork ID 100.10529 cantollini
|
|
|
|
|
You need to be more specific.
Please catch a CDBException and look at the m_strError member and what it says.
Henry Kafeman wrote:
It is failing due to invalid text in one of the Parameters.
Maybe you forgot to add the apostrophe ' like this:
INSERT INTO Table VALUES ('myvalue') and not INSERT INTO Table VALUES (myvalue)
Best regards,
Alexandru Savescu
|
|
|
|
|
Thanks for your responses so far.
I'll try to clarify - My Query is generated by the CRecordset::Update() Function.
I know why an error was occuring, but I want to build into my Release code enough Reporting to be able to diagnose any future problems.
I have a Try/Catch around the Update() call which is already reporting the SQL Error reported back by SQL Server via CDBException. What I want to do is report the actual Query and Parameters which cause a problem.
|
|
|
|
|
Hi all, I am in a bit of a Dilemma. My app currently takes the format:
Declare Globals.
function InitApp().
function UpdateFrame().
function CallBack WindowProc().
function WinMain().
I would like to incorporate a CD3DApp class which WinMain() would create, initialise and set the Run() function. The CD3DApp class would then handle its own messages in a similar style to the code:
while(GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage(&msg);
ProcessMessage(&msg);
}
which obviously uses the WindowProc CallBack function (so I could specify which buttons do what etc.). I DO NOT want to use MFC. I would like to make my InitApp(), UpdateFrame() and Run() a part of the CD3DApp class and also the global variables as member variables (I think the code is much cleaner then). However, if I put the messaging code listed above in the Run() the CallBack WindowProc cannot access the member variables of the CD3DApp class because the object hasn't been passed through to it (whereas before they were global which allowed for access). There is a timer in the WindowProc which is used to create an animation, which is why I would like access to the CD3DApp class.
What I would like to know is:
1.) Is there any way of creating a class that has its own WindowProc function, so that it can access the member variables?
2.) If not, is there any better way to go about solving this problem of getting the code cleaner (losing the globals)?
"When I left you I was but the learner, now I am the master" - Darth Vader
|
|
|
|
|
Have a look at this, it should help you build a mini-framework.
http://www.dilascia.com/wpp.htm
Michael
Logic, my dear Zoe, merely enables one to be wrong with authority. - The Doctor
|
|
|
|
|
Thanks for the link Michael, I've downloaded the resource and am going to try and rip it apart to get what I need. Essentially, I'd like to do my own framework and just need a little guidance, so hopefully this will be it.
Many Thanks,
Alan.
"When I left you I was but the learner, now I am the master" - Darth Vader
|
|
|
|
|
I have a copy of the book and I used it to build my own little DirectX framework. The book is well worth reading if you can find a copy.
Michael
Logic, my dear Zoe, merely enables one to be wrong with authority. - The Doctor
|
|
|
|
|
Cheers Michael, will keep my eyes peeled for it when I'm in Waterstones or Blackwells next
"When I left you I was but the learner, now I am the master" - Darth Vader
|
|
|
|
|
OK, I have the following code which starts my app rolling:
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR szCommandLine, int nCmdShow)
{
if (FAILED(InitApp(hInstance, nCmdShow)))
return 0;
//*
MSG msg;
while(GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage(&msg);
ProcessMessage(&msg);
}
return 0;
}
I have set up my own WindowProc (Fullscreen Exclusive) and initialised DirectDraw, a Primary Surface and Direct3D (global variables initialised in InitApp). OK, if I then load a bitmap into a plain offscreen surface (same res as screen), and bltfast it to the Primary Surface back buffer at the //* point and call the primary buffer flip() routine, the bitmap appears, magic. However, if I then bltfast the same picture to the backbuffer (that was the primary surface before the flip) but at a ddiferent position and then call the primary buffer flip() routine again, it is blank (sometimes I get a flicker of the picture before it goes blank). So something must be clearing the data of the primary buffer, I assume? Now for the strange things:
1.) If I set up a timer and handle it in my window proc, with the exact same code, it works, I get a small animation where the picture moves from point a to point b.
2.) Every time I start the app the initial Primary Surface gets cleared and is blank (Is this perhaps to do with my WindowClass which sets the screen to blackness - even though the primary surface hasn't been created at this point?), but the back buffer retains any previous image that was drawn into it. Yes thats right, if I eliminate all drawing code and merely flip() the Primary Surface, up comes the image I displayed in a previous debug initiation, but if I flip again its blank etc.
3.) Now for the one that will have you rocking. Assuming the bltfast code etc. is by the //* position of my code above. Insert the line MessageBox(GetActiveWindow(), "YAY", "YAY", MB_OK); at that point, but above the bltfast code, IT WORKS! You get a message box and then once you click ok, the primary surface flips a couple of times and leaves you with a beautiful bitmap (no blank surface).
If anyone can answer any of these strange problems, I would well appreciate it. I have had to buy head and shoulders shampoo cos I've scratched my head so much.
"When I left you I was but the learner, now I am the master" - Darth Vader
|
|
|
|
|
Hi,
I've got an MDI app with a ScrollView which acts strangely when I load a file with more than 2060 lines.
The problem manifests its self like this .... if I click above or below the 'Thumb' on the Vertical Scroll Bar it all works OK, but if I grab the 'Thumb' and drag it downwards it jumps back to the top of the file at around line 2060.
My code to set the ScrollView Size is like this:-
CSize sizeTotal;
// get the number of lines
CSQMDoc *thisDoc = GetDocument();
int nLines = thisDoc->GetCount();
// get the height for 1 line of text
TEXTMETRIC tm;
CDC *pDC = GetDC();
pDC->GetTextMetrics(&tm);
int nLineHeight = tm.tmHeight + tm.tmExternalLeading;
// set the size of the 'view' area
sizeTotal.cx = 400;
sizeTotal.cy = nLines * nLineHeight;
SetScrollSizes(MM_TEXT, sizeTotal);
ResizeParentToFit( );
Anyone got any ideas?
Cheers, Ali.
Ali
|
|
|
|
|
I know this kind of thing is hard to debug. Did you try to save the values of sizeTotal.cy in a text file in order to see if it is your calculation that is wrong or if it is the SetScrollSizes() that fails ?
~RaGE();
|
|
|
|
|
The scroll bars in a scroll view have a scroll range of 32767 counts.
My bet is that the line
sizeTotal.cy = nLines * nLineHeight;
With nLines being 2060 majes sizeTotal.cy > 32767 causing all the vertical scroll ranges to be come messed up.
I have seen an artile that covers how to get around this. I will try and find the reference.
Roger Allen
Sonork 100.10016
If I had a quote, it would be a very good one.
|
|
|
|