|
I'm poking google's eye right now, but all I get is GPU gems, photoshop gems etc..
Perhaps you know a good starting link?
---
http://sprdsoft.cmar-net.org - We Sprd You Softly
Our site features contents and several images. All of this is very weird.
In the end, war is not about who's right, it's about who's left.
|
|
|
|
|
use emule, download it from www.download.com
|
|
|
|
|
Hi all
When I am trying to delete a COblist list , I get the following assertion
_CrtIsValidHeapPointer fails with the message
Debug assertion failed! in dbgheap.c
The code is below
while(!WzdMsrTable.IsEmpty())
delete WzdMsrTable.RemoveHead()
MSDN says this function _CrtIsValidHeapPointer checks if the block of data is in the local heap or not .
How can this list WzdMsrTable be not-in-local-heap ?
MSDN also says the function _CrtIsValidHeapPointer is not called during Release mode.
Now my question is
1) Why the function _CrtIsValidHeapPointer fails
2) If this function is ignored in release mode , what is the impact of it in the execution . I am asking this becasue , there are some random crashes even during Release mode due to the code segment involved here .
Any one to help me ?
redindian
|
|
|
|
|
NEVER ignore problems like this. Your software has bugs and until you know what the bugs are, you can make NO statements as to the impact of ignoring them.
Check for double deletions. Are you deleting that memory multiple times.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Its not double deletion . In fact I dont understand how a variable's memory can not belong to local heap . And how to get rid of this problem . There is no problem in release exe but I suspect this error is the cause of random crashes in the App
redindian
|
|
|
|
|
I recently installed VS.NET and wanted to create a C++ program, I selected Win32 Console Project to start with. I have one while loop and one for loop. The while loop execute first then follow by the for loop. The problem is after executing the while loop, it closes the window with the black background and will not show me the result. I'd checked my program, it actually run the for loop but the window just close before it can show me anything. This is my test code:
#include "stdafx.h"
#include <iostream>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
int myArray[100];
int count = 0;
int number = 0;
cout << "Please enter some number (-1 to terminate): " << endl;
while (number != -1) {
cin >> number;
myArray[count] = number;
count++;
}
cout << "The numbers you just typed are: ";
for (int counter = 0; counter < count; counter++)
{
cout << myArray[counter] << " ";
}
cout << endl;
return 0;
}
Thanks to anyone that can help me with this so I can start practising my programming skill =)
Jay
|
|
|
|
|
I'm not completely sure, but you might try adding this just before return 0;
#ifndef _DEBUG<br />
cout << "\n\n\tPress any key to continue\n\tor any other key to quit..";<br />
getch();<br />
#endif //_DEBUG
Good luck with programming
---
http://sprdsoft.cmar-net.org - We Sprd You Softly
Our site features contents and several images. All of this is very weird.
In the end, war is not about who's right, it's about who's left.
|
|
|
|
|
Thanks for the reply, I'd tested it, the problem is still the same, really don't understand why this is so complicated compare to Visual C++ 6.0
|
|
|
|
|
Have you tried removing
#ifndef _DEBUG
and
#endif //_DEBUG
? That's a really annoying problem.
---
http://sprdsoft.cmar-net.org - We Sprd You Softly
Our site features contents and several images. All of this is very weird.
In the end, war is not about who's right, it's about who's left.
|
|
|
|
|
That's normal: your program is terminated.
Maybe what you can do is add a line at the end of your prog that will wait until the user presses a key. You can use getch for that:
cout << "Press a key to continue";<br />
getcg();<br />
return 0;
|
|
|
|
|
Thanks for the reply, I got this error message when I do this: identifier not found,even with argument dependent lookup. Anyway,I shall see what I can find from the Internet
|
|
|
|
|
That's because there was a typo in the original message, there's no such thing as getcg() it should be getch().
"Visual SourceSafe? It would be safer to print out all your code, run it through a shredder, and set it on fire." - Fitz
-- modified at 10:19 Tuesday 6th September, 2005
|
|
|
|
|
add #include <conio.h>
add before return 0
getch();
NG
|
|
|
|
|
Hey, thanks, it works ! I think I really need time to get adapted to VS.NET.
Jay
|
|
|
|
|
Hi,
I was wondering if it were possible to have Visual Studio .NET 2003 to use hyperthreading during compilation, so that it would compile two files the same time.
|
|
|
|
|
I think you can build/compile two or more projects simultaneously, atleast with visual stuidio 2005. you might have to change setting from tools->options->projects and solutions->build and run.
-Saurabh
|
|
|
|
|
Ok guys. still can't find solutions with this, I already try the solutions that lhayes00 posted but still can't get me to the right path.
For the specific example, here's I wanted to do with a given html code:
HTM CODE: (This is only an example)
-------------------------
<code>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="ja">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=euc-jp">
<title>製品情報~A01~</title>
</head>
<body>
<a name="top" id="top"></a>
<h1>A01製品</h1>
<ul>
<li> あれこれ
<li> あれこれ
<li> あれこれ
<li> あれこれ TEST ONLY
<li> あれこれ
<li> あれこれ
<li> あれこれ
<li> あれこれ TEST ONLY
<li> あれこれ
<li> あれこれ
<li> あれこれ TEST ONLY
<li> あれこれ
</ul>
<br>
<div align="right">
<a href="#top">↑ページの先頭へ戻る</a><br>
</div>
</body>
</html></code>
---------------------------
*With the given data array that I parsed:
CUIntArray xRow = { 13, 15, 17, 19, 21, 23, 16, 20, 23 }; // refer to the line numbers of html code.
CUIntArray yCol = { 7, 7, 7, 7, 7, 7, 15, 24, 16 }; // refer to the column numbers of html code.
CUIntArray nStrLen = { 4, 4, 4, 4, 4, 4, 9, 9, 9 }; // refer to the length of the word/string to be processed.
From that data input, the edited html should look like this.
EXPECTED OUTPUT HTML CODE:
----------------------------
<code><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="ja">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=euc-jp">
<LINK href="./include/image.css" type=text/css rel=stylesheet>
<title>製品情報~A01~</title>
</head>
<body>
<DIV class=menubar>イメージ表示 <A accessKey=C href="javascript:window.close()">
[ 閉じる (C) ]</A> </DIV>
<a name="top" id="top"></a>
<h1>A01製品</h1>
<ul>
<li> <SPAN class=source-mark>あれこれ</SPAN>
<li> あれこれ
<li> <SPAN class=source-mark>あれこれ</SPAN>
<li> あれこれ <SPAN class=source-mark>TEST ONLY</SPAN>
<li> <SPAN class=source-mark>あれこれ</SPAN>
<li> あれこれ
<li> <SPAN class=source-mark>あれこれ</SPAN>
<li> あれこれ <SPAN class=source-mark>TEST ONLY</SPAN>
<li> <SPAN class=source-mark>あれこれ</SPAN>
<li> あれこれ
<li> <SPAN class=source-mark>あれこれ</SPAN> <SPAN class=source-mark>TEST ONLY</SPAN>
<li> あれこれ
</ul>
<br>
<div align="right">
<a href="#top">↑ページの先頭へ戻る</a><br>
</div>
<DIV class=menubar>イメージ表示 <A accessKey=C href="javascript:window.close()">
[ 閉じる (C) ]</A> </DIV></body>
</html></code>
----------------------------------
Considering that the xRow array varies, it's not incremental.
I tried the solutions above but still I'm stuck on this.
Any help is much appreciated.
Thanks a lot...
With great power comes a great responsibility.
|
|
|
|
|
こにちわ
What exactly is it that you are trying to do? Are you trying to wrap HTML code around certain texts? What are the critieras for wrapping the HTML code?
Good music: In my rosary[^]
|
|
|
|
|
Thanks for the reply.
I'm just a beginner. And as you can see on my example, from the given html file, I'd like to insert some strings within the html code and save it in a another html file. From the given data arrays, which specifies the location of a string in a html file to be inserted by a string "<SPAN class=source-mark>" and after the string is "</SPAN>". I tried everything but it can't insert a string into html. Someone suggests that put the html code in a string then find and replace. without knowing what the string to be inserted by a string"<SPAN....>", I can't use it. But I think, it may be use in inserting the string "<LINK ....>" and "<DIV ....>" in an html file but I don't know how to do that.
Please if you can guide me how I can proceed to this, I will appreciate it a lot.
Thanks...
With great power comes a great responsibility.
-- modified at 20:41 Tuesday 6th September, 2005
|
|
|
|
|
Here's some code, in which I treat words (separated by whitespaces and newlines) as units. I then test these words
to see if they are "special" (I don't know what your critera is for "special"). If the words are special, I wrap them
with [special][/special]. Please note that you will have to extend your word delimiters to include carriage returns (\r) as
well as tabs (\t), since they are legal and common whitespaces in HTML. The basic algorithm treats the input as a sequence of
units, rather than a 2-dimensional structure.
static CString strOriginal =
_T("This is the original text. Small words such as 'is' and 'the', are considered \"special\", and will be\n")
_T("wrapped with [special][/special]. Word delimiters are in this case spaces and newlines.\n")
_T("\n")
_T("The problem with automated accessibility testing tools\n")
_T("by Trenton Moss 5/5 (2 votes)\n")
_T("Are automated accessibility tools a little too good to be true? There are a number of underlying problems associated with ...\n");
static bool IsSpecialWord(const CString strWord)
{
return
strWord == _T("are") || strWord == _T("is") || strWord == _T("and") || strWord == _T("by");
}
void TheAlgorithm()
{
std::cout << strOriginal << std::endl;
int i = 0;
CString strLastWord;
CString strCopy;
strCopy.Preallocate(strOriginal.GetLength() * 2);
for(int i = 0; i < strOriginal.GetLength(); ) {
if(strOriginal[i] == _T(' ') || strOriginal[i] == _T('\n')) {
if(strLastWord.GetLength() > 0) {
if(IsSpecialWord(strLastWord))
strCopy += _T("[special]");
strCopy += strLastWord;
if(IsSpecialWord(strLastWord))
strCopy += _T("[/special]");
strLastWord = _T("");
}
strCopy += strOriginal[i++];
} else {
strLastWord += strOriginal[i++];
}
}
if(strLastWord.GetLength() > 0) {
if(IsSpecialWord(strLastWord))
strCopy += _T("[special]");
strCopy += strLastWord;
if(IsSpecialWord(strLastWord))
strCopy += _T("[/special]");
}
strCopy.FreeExtra();
std::cout << _T("------ the new copy -----") << std::endl;
std::cout << strCopy << std::endl;
} You can easily modify this code to suit your needs, provided that I have correctly understood the level of complexity required
to determining the "special" words, or positions where the HTML elements are to be inserted. If determining where to insert the HTML elements
are more complex, I still advise you to parse the string linearly, as it would be easier to keep the code optimized. Inserting strings into
strings is potentially very slow.
Good music: In my rosary[^]
|
|
|
|
|
Thanks for the response.
Anyway, using trial and error with my codes, I found a little solution with it, though I may say that it's not reliable for some instances, it gives the result I needed. By the way, the strings in html file to be inserted of an additional tag before and after are not known. or meaning to say, I didn't know what are the strings/words, that's why I found it difficult. The only given data are the position and length of it (RowLinePosition, ColumnLinePosition, and stringLength). I'm still looking for a better solution coz I think, a problem may occur in some instances.
With great power comes a great responsibility.
|
|
|
|
|
c:\program files\microsoft visual studio\vc98\include\ios.h(146) : error C2872: 'streambuf' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\ios.h(159) : error C2872: 'ostream' : ambiguous symbol
c:\program files\microsoft visual studio\vc98\include\ios.h(159) : error ..
like this 102 Errors..
i guess its because of the clash between iostream.h and ios.h..
if we use #strings, #vectors ,why do <iostream.h> and IOS.H clash? both are same?
Thanks,
V
|
|
|
|
|
welcome to the world of mutli-inheritance and ambiguity...
you'll have to tell the compiler the namespace to walk through instead of letting it doing by itself...
consider this :
class A {
public:
virtual void debug() { };
};
class B {
public:
virtual void debug() { };
};
class AB : public A, public B {
public:
void f() {
this->debug();
this->A::debug();
this->B::debug();
}
};
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
oops sorry tox, i was away, n back to the seat now.. so what should i do now? the error traces back to the header file IOS.H
V
|
|
|
|
|
if the problem is with my program means i can use :: to access it.. but if it blames the header files?? .. hey tox dont strain yourself.. cuz i removed iostream.h from my .cpp file.. i no more use it..and its working fine. but i just wanted to know if i actually want both ios.h and iostream.h together, what'd i do??.. cool shark
V
|
|
|
|