|
The code I am working with is part of a larger code base. The rest of the code is not using GDI+.
|
|
|
|
|
If performance is not an issue then making the calls every time
you use GDI+ is a valid solution.
What about adding init and cleanup functions that make the calls?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Performance is indeed an issue. I was hoping someone could tell me how much of a performance hit the code might take. Otherwise I will try to do some timing.
I guess I am being boneheaded. Could you elaborate on the init and cleanup functions you are referring to?
|
|
|
|
|
FossilDocent wrote: Could you elaborate on the init and cleanup functions you are referring to?
I mean add some functions (or methods to a class if appropriate)...
void InitGDIPlus()
{
GdiplusStartup(...
}
void CleanupGDIPlus()
{
GdiplusShutdown(...
}
These don't need to be called on the same thread. Just call
InitGDIPlus() once before using GDI+, and call CleanupGDIPlus()
once when finished with GDI+.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Once I call GdiplusStartup for my class, and before I call GdiplusShutdown, will other classes still be able to use non-GDI+ CDC drawing methods? If GdiplusStartup does not disable use of drawing such as
CDC *pDC;
pDC->LPtoDP(...);
pDC->MoveTo(...);
pDC->LineTo(...);
I can do just as you suggest.
|
|
|
|
|
Regular GDI is not affected in any way
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I just wrote some code to check it out. This should do the trick.
Thank-you!
|
|
|
|
|
Hello,
Till now, I used something like this for this problem:
karstamm::storesort(CString fn)<br />
{<br />
struct satz<br />
{<br />
char karnr[256];<br />
char karsort[256];<br />
char cr;<br />
};<br />
<br />
int k;<br />
satz aussatz;<br />
FILE *ausgabe;<br />
<br />
aussatz.cr = '\n';<br />
ausgabe = fopen(fn, "wt");<br />
if (first())<br />
{<br />
do<br />
if (getkarsort() != "")<br />
{<br />
strcpy(aussatz.karnr, getkarnr().c_str());<br />
strcpy(aussatz.karsort, getkarsort().c_str());<br />
k = fwrite(&aussatz, sizeof(aussatz), 1, ausgabe);<br />
}<br />
while(next());<br />
}<br />
fclose(ausgabe);<br />
}<br />
And it works fine, if I read it in my program to use it there again. But now, I want to export my data in CSV-format - and I have problems with the data-length and the default-characters. Is there any possibilty to export 2 CStrings like "abc" and "def" and get a text-file like "abc;def;"???
Many thanks in advance, GE
|
|
|
|
|
Gerhard-E wrote: Is there any possibilty to export 2 CStrings like "abc" and "def" and get a text-file like "abc;def;"???
No. I don't think that has been supported in any PCs since the Commodore 64
led mike
|
|
|
|
|
Thank you. Seem's, that I have to export chracter by character
But it's a great help for me, to have somebody else who says, that there is no easy way.
Thanks again, GE
|
|
|
|
|
Does the Commodore 64 support .NET?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I'm using VC 6.0 - so it wouldn't be necessary
|
|
|
|
|
Sorry, I guess the reply you got is sort of my fault for starting the whole thing.
led mike
|
|
|
|
|
You can't buy this kind of entertainment!
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Lack of humour in voting people.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
One possibility, although it might be padded oddly, is to change your structure to:
struct satz
{
char karnr[256];
char komma;
char karsort[256];
char cr;
};
...
aussatz.komma = ',';
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
You might want to pick up a C++ book or two. And you should look at the other responses and figure out why they are funny.
You mentioned CString (MFC), but it looks like a Standard C++ string to me.
Anyways, when I want to write to a file, I often use the fprintf() function.
fprintf(ausgabe, "%s;%s;\n", getkarnr().c_str(), getkarsort().c_str());
Good luck,
Jim T.
|
|
|
|
|
That's exactly what I need.
I used fprintf and sprintf years ago, but I forgot this solution.
Many thanks, GE
|
|
|
|
|
James L Turner wrote: And you should look at the other responses and figure out why they are funny.
You have pretty high expectations!
led mike
|
|
|
|
|
I tried looking at the always useful a friendly MSDN site, but my patience grew thin.
What is comsuppw.lib?
I noticed this when I tried to build some code in VC++ 6.0 taken from a set of code in VS2005. I was using a previous .DSW workspace for the "same" set of code that recently was upgraded to VS2005, so it shouldn't have been that far of a stretch.
Thanks,
John John
|
|
|
|
|
john john mackey wrote: I tried looking at the always useful a friendly MSDN site, but my patience grew thin.
Try this[^] specifically the second result
led mike
|
|
|
|
|
Is there any limit, and how much is it?
Would it be practical to send a 100 fully qualified file names as arguments by the command line?
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
sashoalm wrote: Is there any limit...
Yes.
sashoalm wrote: ...and how much is it?
I don't recall for sure, but 8K comes to mind. See here for more.
sashoalm wrote: Would it be practical to send a 100 fully qualified file names as arguments by the command line?
No. Perhaps writing those paths to a file that your program could then parse would be better.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
32K in windows XP + and MAX_PATH Windows 2000 and below.
Best Wishes,
-David Delaune
modified on Thursday, July 31, 2008 12:10 PM
|
|
|
|
|
But I've seen that explorer sends file names through the command line. When you drag files on the icon of an executable, the executable is started with the file names added to the command line. I've tested this on Windows 98 and XP.
I found out this while writing the response here. If the files are too much explorer failed to start the exe and an error message 'Access to the specified device, path or file is denied'.
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|