|
Im not sure its your answer or no Is RasDial helpfuls?
|
|
|
|
|
i m planning to convert all my graphical data (stored in database) to a file that can be of my specific file format i like suggestion on how to proceed in right direction
for eg
for a line the x&y coordinate
how could i store it in a file, what is the correct way to do it and what header in have to take into account so that i can retrive it when i read from it
thanks
Regards
pan_angel
|
|
|
|
|
That depends a lot of what you need to save. And there is not really a general rule for that. Except that you need to read everything in the same order as you saved it.
If you are using MFC, you can take a look at serialization, it provides some usefull classes to help you.
|
|
|
|
|
But what kind of file must be wrote so that it can not be accessable by any other software i.e there must be some kind of coding that is to be dne while writing it
if i write data in binary format then it will work or i hav to encode into some other coing that can not be accessable by others
|
|
|
|
|
Technically, every file can be accessible by any program. See that as stream of bytes. But, in order to use them, they will need to know how the file has been saved, meaning that the first 4 bytes is in fact an int holding the number of shapes of your file, then follows X bytes for each shapes (containing the data of the shape).
You can give it any extension you like (but its nice to avoid the most common ones like .doc, .htm, ...).
|
|
|
|
|
The obvious choice is to use a XML file. Then you can have any amount of metadata (such as x and y postions).
The problem is to make sure you can include the (binary) graphical data inte a XML document, without violating the XML rules. You might have to reformat the data to handle that issue.
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
kakan wrote: The obvious choice is to use a XML file.
I'm not sure it is the most obvious choice. It will be quite overkill to use XML format, especially if you have a lot of data to save. And I think in that case a binary file is easier to handle.
|
|
|
|
|
hi all
i need an implementation of an association rule mining algorithm. (no matter which algorithm)
thanks
|
|
|
|
|
pardis wrote: (no matter which algorithm)
Here it is[ ^]
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
i m using VC++ for desighning an export tool for writing elements in DGN file but a difficulty that i m facing is that i m not able to write the extents of the elements properly i.e low range i m getting in +ve and high range in -ve
i m using "dgnlib" for writing dgn file.
that is why i m not able to fit the view of the dgn when i open it in Microstation
pls reply soon
i'll be highly oblidged
thankx
regards
Pan_angel
|
|
|
|
|
Hi All,
I need to replace char buffer with std::string.
Please find below the code i am using.
AmtInvalidError[50];
long MinimumAmtRequired = (((x*)L_Item)->GetMinAmount()*100);
long MaximumAmtRequired = (((x*)L_Item)->GetMaxAmount()*100);
sprintf(AmtInvalidError, "$%ld.%02d to $%ld.%02d", labs(MinimumAmtRequired/100L),abs((int)(MinimumAmtRequired%100L)), labs(MaximumAmtRequired/100L),abs((int)(MaximumAmtRequired%100L)));
the above code works fine and i get "$25.00 to $100.00" in AmtInvalidError correctly(taking the values for min and max amounts).
Instead of AmtInvalidError array i want to use AmtInvalidError as std::string, and continue populating the string to value "$25.00 to $100.00".
But i am not able to do this becoz, sprintf cannot be used, and hence want to know if there is any other way.
Please kindly help me.
-- modified at 3:55 Thursday 14th December, 2006
Thanks & Regards,
Dhana
|
|
|
|
|
Hello,
Use _vscprintf to predetermine the length of the formatted string, allocate the space using std::string::resize , then vsprintf your text into the buffer pointed to by a dereferenced begin iterator ((char*)&(*Str.begin()) ):
For Unicode version, use _vscwprintf , vswprintf (or vswprintf_s for safe CRT version in VS 2005) and wchar_t , accordingly.
|
|
|
|
|
jana_dhana wrote: now i need to replace the array with std::string, and also keep the formatting that i am doing to show the decimal places.
good. what have you tried for this ?
[edit]
please also apply 5. in the posting guidelines[^]
thanks
[/edit]
|
|
|
|
|
Is there a reason you need to stop using the char array, or do you just need the final answer in a std::string?
If you just need the string, add the final line
std::string strError = AmtInvalidError;
If you want to use std::string all the way through, you'll probably have to stop using sprintf, and use a std::stringstream instead
|
|
|
|
|
You can declare string variable like,
string sMyString(AmtInvalidError);
|
|
|
|
|
prasad_som wrote:
string sMyString(AmtInvalidError);
sMyString variable points to same AmtInvalidError array or creates new one?
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
the constructor copies the array into its own memory...
|
|
|
|
|
toxcct wrote: the constructor copies the array into its own memory...
So its better to write the code which populates the std::string variable instead of just copying an existing array into newone for efficient memory usage.
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
A_LaxmansMyString variable points to same AmtInvalidError array or creates new one?
Creates own version. You can assume its implementation like copy constructor. If there is a pointer, you need to allocate own memory for this class.
This way one can have control over own memory.
|
|
|
|
|
Hi,
I am developing a relativly simple 2D graphics application.
Purpose: displaying lots of rectangles (those come from a
file. There has to be some pre-processing, but basically
all elemets are rectangle.
Now I would like to have the follwoing features: scrolling and
zooming, all in an MFC application.
I was trying to use the ANISOTROPIC mode, this doesn't work in
an MFC application. Any idea how I get this mode to work in an
MFC framework?
Thanks,
Joerg
|
|
|
|
|
Perhaps this[^] would help a little?
|
|
|
|
|
Great, looks like this is what I was looking for.
Thanks so far, I'll need a bit to read
Regards,
Joerg
|
|
|
|
|
MFC used to include some tutorials. Are they not provided anymore? The first tutorial was called Scribble which I think answered most or all of your questions. Is it not provided any more?
|
|
|
|
|
Say I got 20 or more projects in a solution.If the sln file is building under msbuild i.e msbuild mysolution.sln then is that enough to proceed. Well if any body has any experience with integrating msbuild and cc.net please share their thoughts.I'm looking for an easy way to get started.I have gone through many site ah well....
-- modified at 5:37 Thursday 14th December, 2006
_________________________
"When the superior man refrains from acting, his force is felt for a thousand li." Sun Tzu
|
|
|
|
|
mejax wrote: "When the superior man refrains from acting, his force is felt for a thousand li." Sun Tzu
Dude, read the forum rules above.
If you had been a superior man, you would never have asked this in the wrong forum. There are excellent programming forums on this site for such questions.
_____________________________________
Action without thought is not action
Action without emotion is not life
|
|
|
|