|
also, in the properties tab, there is a macro $(ConfigurationName) it will associate debug files for debug build and release files for release. checkout the different macros, they can help a lot with different configurations or different file paths for different configurations.
[Insert Witty Sig Here]
|
|
|
|
|
I'm dumping values from an array to a file,
like
<br />
typedef int** _2dArray;<br />
_2dArray pIntArray[10];<br />
I can traverse through all the pointers in 'pIntArray' and make a call like
<br />
loop<br />
{<br />
fwrite((void*)&pIntArray,sizeof..,fp);<br />
}<br />
this will write down all the values every pointer in pIntArray is pointing too.
That's fine.
I had to include some more values while dumping these integers. Without thinking about it twice, I implemented a struct all accross like,
<br />
struct mystruct<br />
{<br />
int myval1;<br />
int myval2;<br />
_2dArray* arr2D;<br />
}<br />
mystruct myst;<br />
myst.myval1 =10;<br />
myst.myval2 =20;<br />
myst.arr2D = [another-pointer-to-intpointers.]<br />
And made a stupid implementation like,
<br />
fwrite((void*)&myst,sizeof..,fp);<br />
Crap! This wont work cuz it's a pointer! it wouldn't be dumped with it's content. .. can someone help me out to get away with this design and still manage to dump it's content? sounds stupid, ok tell me what'd be your way to implement it? But please note, with a single stretch, I should be able to fetch all these values with an fread()
Jemmy : Deadline? Pfft, a real programmer eats deadlines for breakfast. :P
Mark: I thought real programmers ignored deadlines
Best wishes to Rexx[^]
|
|
|
|
|
VuNic wrote: But please note, with a single stretch, I should be able to fetch all these values with an fread()
There's no way I know of for getting around it. arr2D can't be a pointer when its time to serialize.
VuNic wrote: Jemmy
That my new nickname?
|
|
|
|
|
Jeremy Falcon wrote: That my new nickname?
Mine is Mary apparently
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark Salsbery wrote: Mine is Mary apparently
|
|
|
|
|
I thought of putting you as "Maakie"
Jemmy : Deadline? Pfft, a real programmer eats deadlines for breakfast. :P
Mark: I thought real programmers ignored deadlines
Best wishes to Rexx[^]
|
|
|
|
|
No, that's my friend's name. Who lives in the US, and has a bird's name as his family name.
Jemmy : Deadline? Pfft, a real programmer eats deadlines for breakfast. :P
Mark: I thought real programmers ignored deadlines
Best wishes to Rexx[^]
|
|
|
|
|
VuNic wrote: No, that's my friend's name. Who lives in the US, and has a bird's name as his family name.
I've heard of that guy before. I hear he's a PITA.
|
|
|
|
|
Jeremy Falcon wrote:
I've heard of that guy before. I hear he's a PITA.
Exactly
Jemmy : Deadline? Pfft, a real programmer eats deadlines for breakfast. :P
Mark: I thought real programmers ignored deadlines
Best wishes to Rexx[^]
|
|
|
|
|
VuNic wrote: Exactly
|
|
|
|
|
hope that he never reads you here ! ;P lol
|
|
|
|
|
VuNic wrote: fwrite((void*)&myst,sizeof..,fp);
Did you mean to do something like this:
fwrite((void *) &myst.arr2D, sizeof(), fp);
"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
|
|
|
|
|
Just redesigned the implementation:
<br />
code was here. <br />
Works fine David, Please have a look at it once and kindly point out the mistakes if I've done somewhere. You may ignore the coding conventions, this is just a sample I made.
-- modified at 15:34 Tuesday 25th September, 2007
Jemmy : Deadline? Pfft, a real programmer eats deadlines for breakfast. :P
Mark: I thought real programmers ignored deadlines
Best wishes to Rexx[^]
|
|
|
|
|
Hello,
I'm using structure to be save data. I now how I pleased data into the struct. but I can't delete them by run time. How can I delete the data from de struct.
This is the code :
Struct Display :
{
char Regel[10][24];
char UnitName[30];
int Count;
}
I put data into this struct on run time, no problem. But I can't delete the data on runtime. It create a fould.
Can sombody help me.
Jelle.
|
|
|
|
|
sorry. i really can't undertand anything in your question.
if you're using an automatic translator, definitely forget to use it...
So, what exactly are you trying to do here, and what's your problem ??
|
|
|
|
|
Jelle De Vos wrote: But I can't delete the data on runtime.
Are you referring to memset() ?
"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
|
|
|
|
|
|
memset should do the job perfect. Didn't you try that?
Jemmy : Deadline? Pfft, a real programmer eats deadlines for breakfast. :P
Mark: I thought real programmers ignored deadlines
Best wishes to Rexx[^]
|
|
|
|
|
thanks,
the memset works goed.
Jelle.
|
|
|
|
|
You may also like to do it:
Create it in heap. Delete it.
<br />
Display* pDisp = new Display;<br />
pDisp->Count=10;<br />
delete pDisp;<br />
Jemmy : Deadline? Pfft, a real programmer eats deadlines for breakfast. :P
Mark: I thought real programmers ignored deadlines
Best wishes to Rexx[^]
|
|
|
|
|
If you have an object of type Display, then any data in the Display object
will be deleted when the object is destroyed, either automatically by
going out of scope (for automatic variables) or by freeing a dynamically
allocated object.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi,
I want the project to execute in the system where VC++ is not installed.When i tried to execute my project in 2 systems where there is no VC++, in one system it worked with or without dlls( MFC42D.dll,MFCO42D.dll, MSVCRTD.dll)but in another system first dialog box opens, when i press "ok button" in that dialog box it has to close current dialog box and open next dialog box but the user interface is closing without showing any error.
Help me to know why it is happening.Project is working fine in the system where VC++ is loaded.
Thanks
|
|
|
|
|
First step is to make a "Release" build. Your exe is sreaminf for debug dlls.
On VC6 you can make a static link to MFC, so all dependencies are in the bigger exe.
Greetings from Germany
|
|
|
|
|
I have made release build and also static library then also problem exists
|
|
|
|
|
The failure may or may not be anything to do with the presence or otherwise of VC++. You can use the depends tools from Microsoft ( shipped with VC++6 Pro ) to determine your .exe's static requirement for Dlls but this is not the problem in your case.
You need to add some diagnostic logging/tracing to your application and possibly a crash handler ( There are good examples on CP ) to determine why your app is closing down unexpectedly. It should be able to report the causal error before disappearing even if it's a really nasty fatal problem.
The good news is that it is isn't taking down the clients machine on its way out. The bad news is you may need a lot of cooperation from the client to solve the problem.
Good luck.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|