|
Do you have an example of something that works with VS6 but does not work with VS2005?
"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
|
|
|
|
|
Here is two example:
the first eg:
CFileDialog m_ldFile(TRUE, ".bmp", m_sBitmap, OFN_HIDEREADONLY+OFN_OVERWRITEPROMPT,szFilter);
if i use VC6 compile it is okei, but with VC5 it is a trouble.
the second:
from source code posted on the following link
http://www.codeproject.com/KB/database/usingblob.aspx[^]
once again, i used VC6 compile it can run, while vc5 it showed two errors.
|
|
|
|
|
Thx David, i followed ur suggestion but all is in VC++6.0 that would be error when i used Visual C 2005 to complide.
|
|
|
|
|
I have a project that will need to call the GdiplusStartup / GdiplusShutdown pair about twice a second. Has anyone had experience doing this?
|
|
|
|
|
FossilDocent wrote: I have a project that will need to call the GdiplusStartup / GdiplusShutdown pair about twice a second.
Why? They only have to be called once per process.
Twice a second isn't much overhead but it's way more overhead
than necessary
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
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
|
|
|
|