|
See here.
"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
|
|
|
|
|
Thanks all, now i have to understand why this value is negative.....and if this value is in client value
|
|
|
|
|
They hide that information in the documentation[^]
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Stealing Mike's thunder, eh?
"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
|
|
|
|
|
Nah - not stealing...it's a tribute!
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
If possible would anyone have time to explain how the following file contents can be used on a windows XP platform to build the BENTO4 SDK for mpeg4 programming. Only new to this and on a high learning curve so any help appreciated. Am trying to convert it to a bat file but am having no success. I also have VS2005 available but can't work out if this file can be used in that environment.
make-sdk.sh file contents:
AP4_ROOT=../../..
SOURCE_ROOT=$AP4_ROOT/Source
BUILD_TARGET_DIR=$AP4_ROOT/Build/Targets/x86-microsoft-win32-vs2005
CP="cp"
MKDIR="mkdir -p"
for config in Debug Release
do
SDK_DIR=$config/SDK
$MKDIR $SDK_DIR
$MKDIR $SDK_DIR/include
$MKDIR $SDK_DIR/bin
$MKDIR $SDK_DIR/lib
$CP $SOURCE_ROOT/Config/*.h $SDK_DIR/include
$CP $SOURCE_ROOT/Core/*.h $SDK_DIR/include
$CP $SOURCE_ROOT/Codecs/*.h $SDK_DIR/include
$CP $SOURCE_ROOT/Crypto/*.h $SDK_DIR/include
$CP $SOURCE_ROOT/MetaData/*.h $SDK_DIR/include
$CP $BUILD_TARGET_DIR/AP4/$config/AP4.lib $SDK_DIR/lib
$CP $BUILD_TARGET_DIR/*/$config/*.exe $SDK_DIR/bin
done
|
|
|
|
|
I have a real strange problem and so far I have been unable to find the cause. I have a vector of 13 structures ( representing playing cards ) which I need to arrange into sets. For this I have created a cSet base class from which I have derived all the various types of sets.
typedef struct _tagged_tile
{
LPTILE Addr;
TILEFACE Face;
TILESUIT Suit;
bool Used;
int Cost;
LPVOID Set;
} TAG, *LPTAG;
Basically a create a set, try adding all the cards ( a pointer within the above vector ) in the hand until the set is full, if not full I fall back to another derived instance. There are six derived types in all, each with it's fallback method ( except the last ).
This part of the code works without problems, but I want to be able to track which instance of a set a certain structure belongs to. For this I have a void* within the structure, when a set is able to accept a structure I store the this pointer ( pointer of the derived class not the base ).
The trouble is, each time I assign the pointer, the data held in each of the following structures within the main vector becomes garbled. Almost as if the memory has been shifted.
Has anybody come across a similar problem?
|
|
|
|
|
I think you cannot keep a pointer to an item in a collection ( are you talking about a std::set ? )
|
|
|
|
|
Maximilien wrote: are you talking about a std::set ?
No, the set class mentioned above is a class of my own creation, not a collection.
cSet is the base class for six derived types. When I say set, think of a combination of playing cards arranged into groups.
|
|
|
|
|
When you add cards, you store the cards in a collection of some sort?
Does this collection rearrange its memory to grow?
Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal. George Orwell, "Keep the Aspidistra Flying", Opening words
|
|
|
|
|
Each instance of a derived class is dynamically allocated and added to a vector of cSet pointers. After all the cards have been processed, I run through this vector deleting any empty sets. So no, the memory is not rearranged. Another point to note, the problem occurs before deleting any empty sets.
|
|
|
|
|
WalderMort wrote: Each instance of a derived class is dynamically allocated and added to a vector of cSet pointers.
And the set holds a pointer into that vector?
You realize that std::vector holds copies of the data you insert?
And you realize that when std::vector needs to grow to accomodate more items, it copies the elements it holds? Thereby, all memory-pointers (e.g. this-pointers) might get invalidated.
But maybe I simply don't understand your data model completly.
Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal. George Orwell, "Keep the Aspidistra Flying", Opening words
|
|
|
|
|
jhwurmbach wrote: You realize that std::vector holds copies of the data you insert?
Yes I realize that, that is why the vector holds only pointers to those classes. Only the address of memory location is copied and not the memory itself.
|
|
|
|
|
Ok, and the structures whose pointers are held in the vector do contain a reference to the vector itself?
Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal. George Orwell, "Keep the Aspidistra Flying", Opening words
|
|
|
|
|
Somebody please kick me up the &^%
The problem, as annoying as it was, was my own stupid mistake. During the restructuring and rewriting of my project, I left a header file which contained an old definition of the structure, without that void pointer.
I just can't understand why the compiler didn't warn me about it.
|
|
|
|
|
can anyone tell me how to load a resource in vc++ in vs2003.net
I mean the steps.....
from creating the resource with IDE to adding it to the project
is there any diffrence between adding with vs6.0 with vs.net2003?
|
|
|
|
|
From the Project menu, the solution explorer (right click on project), or the Resource view (right click on project or resource folder)...
Choose Add/Resource...
In the Add resource dialog, select the resource type and click the New button or
In the Add resource dialog, click the Import... button to import an existing resource from a file.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I'm trying to parse values from a text file. I read the lines and stored them in a std::string, then I maked a
<br />
std::string stTemp;<br />
string::size_type loc = stTemp.find( " ", 0 );<br />
Now this works fine if the values inside the text file are delimited with " " spaces. but they are separated with "tabs". Damnit How do I read them?.. I went mad and tried
:
<br />
string::size_type loc = stTemp.find( "\t", 0 ); X| <br />
I guess I'm missing some basics here. Light please.
|
|
|
|
|
look at the string in the watch window, and you should see the TAB is equal to char 9 (pretty sure, just not 100%).
Then you can do:
string::size_type loc = stTemp.find( (char)9, 0 );
There you go!
Iain.
|
|
|
|
|
Thanks, But please check my reply to David.
|
|
|
|
|
This works fine for me:
void main( void )
{
std::string strTemp = "Now\tis\tthe\ttime\tfor";
int nPos = strTemp.find("\t");
nPos = strTemp.find("\t", nPos + 1);
}
"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
|
|
|
|
|
Both, yours and Ian's didn't work. I see it actually works for the string when you hardcode it but doesn't when you fill the string with the buffer that you read from the file. If you can check this is for me with the file I'm linking here , it will be really great. The Sample File[^] Thanks!
|
|
|
|
|
Is there a particular reason that you cannot copy the data to an allocated buffer (which is basically what std::string does), and then use strtok(...) to skip through it?
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
Yeah I'm having two versions for the same. One is using strtok, but my colleagues here are not using it. So at the last moment if they say I cannot use it , I'd immediately replace it with the substring-find thing
|
|
|
|
|
This (again) works fine:
void main( void )
{
ifstream in("c:\\MapSample.txt");
string sLine = "";
getline(in, sLine);
int nPos = sLine.find("\t");
nPos = sLine.find("\t", nPos + 1);
}
"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
|
|
|
|