|
crossie wrote: I thought the number of tabs and the positions of tabs are determined by the "\t"s contained in lpString, but it does not turn out to be that simple.
True, the position of the tabs are determined by the values in the 7th argument to TabbedTextOut() (e.g., lpnTabStopPositions ).
crossie wrote: How do these three parameters work?
Aren't the comments in your code snippet sufficient?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I think by interpreting lpString , TabbedTextOut itself can figure out how many "\t"s there are and thus the sixth parameter nTabPositions and the seventh lpnTabStopPositions , which together indicate the number and the positions of the tabs in lpString, do not make any sense.
Besides,
for example, when I call TabbedTextOut the following way,
<br />
int nTabStopPositions[] = { 105,110,120 };<br />
TabbedTextOut(hdc, 100, 100, <br />
"aaa\tbbb\tccc",<br />
11, 3, nTabStopPositions, 50);<br />
Supposing the map mode is MM_TEXT,and the char width is 5.
TabbedTextOut will draw the string where it is 100 pixels to the left and 100 pixels to the top of the client area, breaking the string with tabs at 100+3*5 and 100+6*5+8( a tab equals 8 blanks ).
This is the way I think how TabbedTextOut works, but it seems not working that way.
Thus I don't understand how the last three parameters work.
thank you
|
|
|
|
|
Hello boys.
I discovered a thing that leaves me upset...
I compiled a C-"Hello World" and a C++"Hello world" using MS VC++ 2008 Express edition default release settings and
I noticed that, inspecting files with "Dependencies Walker",
both of them depend on some kind of "Runtime Libraries".
They are MSVC90R.DLL for pure C EXE and MSVC90R.DLL plus
MSCVP90DLL for C++ EXE.
I compiled the same sources with gcc/g++ compilers and, of course, there are no dependencies on external DLL.
I compiled the sourcers with my old VC++ compiler (Visual Studio 6, professional edition) and, again, I found
no dependencies on external DLL.
So
1) Why Ms decided to make EXE files DLL-dependent as default setting? Shouldn't C/C++ produce an executable the
most library-free as it can?
2) How can I avoid this? As I expect I CAN produce an executable which doesn't need VC2008 runtime libraries...can't I?
TNX!
[note: there is a similar post in VB forum, too, but now my "VB-thread" has changed to a "VC++-Thread", and so I duplicate this unique question here, too.]
|
|
|
|
|
By default (I think since VS2003 ) projects are now linked with the dynamic library version of the runtime library. However you can change such setting:
Select Project->Porperties menu item, then Configuration Properties->C/C++->Code Generation node in the newly appeared window and finally change the Runtime Library value (from Multi-threaded DLL (/MD) ) to Multi-Threaded (/MT) .
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
|
|
|
|
|
|
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
|
|
|
|
|
Capitanevs wrote: Why Ms decided to make EXE files DLL-dependent as default setting?
MS's opinion is that it's better for apps to use the DLL version of the CRT. It means less memory usage when multiple apps are running, because only one copy of the DLL has to be loaded. It also means the apps will automagically pick up updates when the CRT DLLs are updated.
|
|
|
|
|
Yeah, but also means that a simple "Hello World" program needs a cortège of DLLs in order to work...
And I suppose this also means that any function call I performs whieghts twice as it could, as there is an interpreter library between my EXE and processor directives....
I mean, if I need a high performance executable, with a lot of calculations and functions calls (whose simulation lasts about one hour or so), isn't this external DLL linkage very taxing?
|
|
|
|
|
Capitanevs wrote: I mean, if I need a high performance executable, with a lot of calculations and functions calls (whose simulation lasts about one hour or so), isn't this external DLL linkage very taxing?
No.
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
|
|
|
|
|
On my program, I need to import file in format:
- AI (adobe illustrator)
- CDR (corel draw)
Someboby know a library (free or commercial) to import/export this file?
Thanks.
|
|
|
|
|
Open source, maybe INKSCAPE[^]
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Inkscape open only Adobe Illustrator SVG file, not ".ai" files
|
|
|
|
|
Never mind the reply I just deleted...apparently the AI file format is published
publicly
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Yes, you are right ... but
1) AI file format is public only for version 10 or down, for the new CS versions the internal code is PDF.
2) I think it is better to use a library instead of write my own the code, no?
|
|
|
|
|
1) oh bummer
2) I'd agree there. I looked into Adobe compatiblity in the past and it
was difficult to get the specs. I imagine that makes it difficult to write
libraries too.
It doesn't look like the Adobe Partners program gives out too much info either.
If I come across something I'll definitely let you know.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thanks
|
|
|
|
|
For CDR no way.
For .AI I try GhostScript that convert every AI (until version 13) to PS... the with PStoEdit I convert the EPS/PS file to regular SVG thet I import in my prog.
This is the only way I've found.
Bye.
|
|
|
|
|
Hi,
I have to split a string in the format mm/dd/yyyy. This is what I do:
CString date,sMM,sDD,sYY,str;
int yy,mm,dd;
int offset = date_poleSet.Find('/');
date = date_poleSet;
sMM = date_poleSet.Left(offset);
mm = atoi(sMM);
str = date.Mid(offset+1);
offset = str.Find('/');
date = str;
sDD = str.Left(offset);
dd = atoi(sDD);
sYY = date.Mid(offset+1);
yy = atoi(sYY);
Is this good enough? Or can it be done in two or three lines?
Thanks,
Tara
|
|
|
|
|
if your mm/dd/yyyy hypothesis holds then
mm = atoi(str.Left(2));
dd = atoi(str.Mid(3,2));
yy = atoi(str.Right(2));
is a bit more concise.
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
|
|
|
|
|
Wow! Thats nice. Thanks a billion.
Thanks,
Tara
|
|
|
|
|
Have you considered COleDateTime::ParseDateTime() ?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Damn, you beat me to it
|
|
|
|
|
I guess my CPMRU was fully charged.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Keep it in mind that no matter how charged it is, there may be some queries with which the CPMRU will not help you at all.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Indeed. That's a documented bug....won't be fixed for a few releases.
Good luck.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|