|
Now the output from running it is throwing out all these
'kpSim.exe': Loaded 'C:\WINDOWS\system32\ntdll.dll', No symbols loaded.
'kpSim.exe': Loaded 'C:\WINDOWS\system32\kernel32.dll', No symbols loaded.
'kpSim.exe': Loaded 'C:\WINDOWS\system32\msimg32.dll', No symbols loaded.
'kpSim.exe': Loaded 'C:\WINDOWS\system32\gdi32.dll', No symbols loaded.
Any idea of what is happening here because in the call stack it ends it says
[Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll]
ntdll.dll!7c93426d()
Thanks again
|
|
|
|
|
No need to worry about those. That means you aren't going to be able to step into any of those
libraries symbolically. You should get those even in debug builds unless you're using Windows
OS debug symbols.
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Well do you see anything wrong with the way that I declared that array? Cause that is causing my problems?
thanks very much
|
|
|
|
|
Looks good unless N is negative
Does the exception occur on the line "n0_L=new double [N+2];"? If so, and N is a valid value,
then the heap is already corrupt at that point I would guess...
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
The exception occurs on the "n0_L=new double [N+2];" line? If so, is N valid?
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Thank you very much for the help I have a good idea of where too look now for the error, hopefully I will be able to figure it out tomorrow.
|
|
|
|
|
For info on the possible meaning of 0xBAADF00D see here[^].
I give the following advice about once a month (recently every few days); it often helps me track down the nastier heap errors:
Try enabling the page heap[^] for your process. Follow these steps:
1. Download and install WinDBG[^].
2. Select “Start”->“All Programs”->“Debugging Tools for Windows”->“Global Flags”.
3. Select the “Image File” tab.
4. In the “Image: (TAB to refresh)” edit control enter the name of your app then press TAB. Just the name with the extension; not the full path.
5. Tick the following:
- “Enable page heap”
- “Enable heap tail checking”
- “Enable heap free checking”
- “Enable heap parameter checking”
- “Enable heap validation on call”
- “Create user mode stack trace database”
6. Press “Apply”.
7. Debug your application. Any debugger will do but with WinDBG you have access to the stack traces of allocations via the !heap –p –a command, for example. When a heap problem is detected a breakpoint will be generated.
8. When done un-tick all the options you ticked, press “Apply” then dismiss GFlags. This step is important as if it’s skipped all applications named as entered in step 4 will run with the page heap enabled.
Note that when using the page heap your application will run much slower than normal and consume way more memory. It’s good to have a beefy machine to do such tests; and such tests should be ran regularly on all applications you develop as part of regular testing activities. If I find a part of my application that’s too slow with the page heap enabled I optimize the memory allocation in that region.
Steve
|
|
|
|
|
Hi all,
My brain is fried after a long days work, and I'm struggling with a loop that will enable me to enter a if statement every third interval. Can anyone please help me ??
Many Thanks
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
My Blog: ^_^
|
|
|
|
|
if ((number % 3) == 0)
...
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
|
Sorry to bother agin but, the thing I'm trying to do is the following:
I have a structure and a char buffer:
struct record
{
char recordType[3];
char fieldName[30];
char fieldType[2];
char fieldLen[2];
}RecordAttributes[BUFSIZE];
char SemiBuffer[1024]={0};
</code>
The char buffer has a very long string in it and it is delimited by a comma ( , ).
So I do the following to break it up.
char* strToken;
strToken = strtok(SemiBuffer, ",");
while (strToken!=NULL)
{
...
strToken=strtok(NULL, ",");
}
This is where the probelm comes in. Seee the SemiBuffer has values that will match with the structure. For example the string would look something like this:
"MA,"RECORDTYPE","C","32","MA","DEVID","C","4","MD","RECORDTYPE","C","15"
As you can see every fourth element fits with the structure. So how can I code it that it would resemble something like this (for every occurance);
RecordAttributes[x].recordType = MA
RecordAttributes[x].fieldName = RECORDTYPE
RecordAttributes[x].fieldType = C
RecordAttributes[x].fieldLen = 32
Does it make sense .... ???
Many Thanks
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
My Blog: ^_^
|
|
|
|
|
Programm3r wrote: Does it make sense .... ???
Yes. After every third comma is encountered, increment x .
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Could you please elaborate ??? Cause I think you don't understand.
After doing this:
strToken = strtok(SemiBuffer, ",");
while (strToken!=NULL)
{
strcpy(RecordAttributes[x].recordType,strToken);
strcpy(RecordAttributes[x].fieldName,strToken);
strcpy(RecordAttributes[x].fieldType,strToken);
strcpy(RecordAttributes[x].fieldLen,strToken);
strToken = strtok( NULL, "," );
x++;
}
But this will overwite every occurance of the next variable in the structure ....
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
My Blog: ^_^
|
|
|
|
|
Programm3r wrote: Cause I think you don't understand.
Actually, it's the other way around. Try:
struct record
{
char recordType[3];
char fieldName[30];
char fieldType[2];
char fieldLen[3];
} RecordAttributes[3];
char SemiBuffer[1024] = "MA,RECORDTYPE,C,32,MA,DEVID,C,4,MD,RECORDTYPE,C,15";
void main( void )
{
char *strToken;
int x = 0,
nComma = 0;
strToken = strtok(SemiBuffer, ",");
while (strToken != NULL)
{
switch (nComma)
{
case 0:
strcpy(RecordAttributes[x].recordType, strToken);
break;
case 1:
strcpy(RecordAttributes[x].fieldName, strToken);
break;
case 2:
strcpy(RecordAttributes[x].fieldType, strToken);
break;
case 3:
strcpy(RecordAttributes[x].fieldLen, strToken);
break;
}
strToken = strtok(NULL, ",");
nComma++;
if (nComma > 3)
{
nComma = 0;
x++;
}
}
}
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
|
I've seen you on these boards before, so this had better not be homework!
for (i = 0; i < 9860708750; i++)
{
if ( (i % 3) == 0 )
{
Here goes stuff that will happen when i = 0,3,6,9,....
}
}
|
|
|
|
|
Iain Clarke wrote: for (i = 0; i < 9860708750; i++)
Will this run forever (since i will always be less than 9 billion)?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Yes! You've caught my deliberate error!
Maybe i was defined as __int128 ....?
The other remote possibility is I made up a number and it kinda got away from me....
Iain.
|
|
|
|
|
|
In one of table field which I kept memo type (Access),use to have data of around 280 characters long key for some Image purpose. In VB recordset connectivity works fine. But when I developed VC++ application using Recordset simple connectivity. It gives error data truncated
while opening database. I done lot of R&d and found If I make my data type as text
( I cannot store my key in text) ,Everything works fine. This is very strange problem.
I dont have now time to learn OleDB or ADO . Is there any solution to this problem.
VB does not give any problem.
|| ART OF LIVING ||
|
|
|
|
|
I'm not sure how to fix your problem with Memo,
but if you change it to OLE Object it will work.
OLE Object can store CByteArray so you can insert
any binary data, not just text.
<br />
CByteArray m_MyKey;<br />
<br />
RFX_Binary(pFX, _T("[MyKey]"), m_MyKey);
|
|
|
|
|
After Lots of ups and down I found answer by myself, nearby to your answer
// RecordSet Connectivity ODBC MFC internals, autogenerated --
void tt::DoFieldExchange(CFieldExchange* pFX)
{
//{{AFX_FIELD_MAP(tt)
pFX->SetFieldType(CFieldExchange::outputColumn);
RFX_Long(pFX, _T("[Id]"), m_Id);
RFX_Text(pFX, _T("[tt]"), m_tt); // tt is my memo in database.
//}}AFX_FIELD_MAP
}
Now for memo field which exceeds 255 limit ,we can add fourth attribute to RFX_Text
RFX_text(pFX,_T("tt"),m_tt,500); // My Limit is 500 currentely but can be large.
And Now code works very fine
|| ART OF LIVING ||
|
|
|
|
|
I am using Microsoft Visual C++ 6.0 Professional to develop a program that will output data to avionics equipment.
My question is how to run the profiler to do timing analysis on my program.
Here are some details on what I'm trying to do:
The program is dialog based. The dialogs are used to capture user input values for the data to be output.
I created a timer that looks like:
m_UpdateTimer = SetTimer (1, 1, NULL);
From what I understand, this timer should trigger every 1 ms.
I created a message map to trigger when the timer ticks:
BEGIN_MESSAGE_MAP(CbrsttDlg, CDialog)
ON_WM_TIMER()
...
END_MESSAGE_MAP()
I have a procedure which is called every time the timer triggers:
MyProg::OnTimer() { ... code .. }
My procedure does get called regularly. However I don't think it's being called every 1 ms. I want to find out how often this procedure is being called .
I know that there is a profiler that does timing analysis that comes with the Microsoft Visual Studio. I believe I have it installed.
I have set the "Enable Profiling" option on the Link tab in the Project settings.
Under the Build menu there is a Profile... option. I clicked that and chose "Function Timing". According to the MSDN library, if I want to do timing on a single procedure I need to put this in the advanced Settings: box.
MSDN says:
"Or, if you are in the development environment, you might type the following in the Advanced settings text box of the Profile dialog box,
SF ?MyFunc@@YAXPAH@@"
I looked up my function in the map file. The line in the map file says:
0001:00007980 ?OnTimer@CbrsttDlg@@IAEXI@Z 00408980 f brsttDlg.obj
So I put :
SF ?OnTimer@CbrsttDlg@@IAEXI@Z
into the Advanced settings: box.
When I click OK on the Profile box it says in the profile tab:
PREP : fatal error PRF1011: cannot open file p:\brs_taws_sw\tools\brstaw_test_tool\brstt\debug\sf.exe
Now, I'm completely lost. Why is it looking for sf.exe?
Supposedly (according to MSDN lib), the SF is an option to the PREP tool.
I have googled looking for information on how to use the profiler but haven't come up with anything useful. Some of the info I found says to use some .ini files for PREP and a couple other things. But I don't know where these files are, how they get created, or what to put in them.
If someone can point me to a site with some useful information for a newb, it would be greatly appreciated.
Thanks in advance.
|
|
|
|
|
You are correct when you say that your proc wont be called every 1 mSec, far from it in fact. So, there are two ways of looking at this:
1) Finding out what the timing actually is. This can easily be done with the excellent CPerfTimer class by Dean Wyant dwyant@mindspring.com. I think it is available on codeproject.com.
2) Improve the timer resolution and accuracy. This can be done quite simply using multimedia timers. You should be able to get a lot better accuracy than you get with a standard windows timer but you might not get the 1mSec timing that you require. I have some info/code frags on using multimedia timers if you like.
Hope this helps.
Tony
|
|
|
|
|
Thanks for the pointer. I reimplemented the timer using a multimedia timer (using an example I found on the web). It seems vastly better than what I had before.
But...my question still remains.
Does anyone know how to use the Visual Studio Profiler?
|
|
|
|