Installing the SDK puts it in a separate directory tree from the one that
came with Visual Studio. Therefore, the existing one is safe.
Visual Studio can be set to use the original one or the new one by changing
the order these appear in the VC++ Directories settings (specifically the
Include and Lib directories). As Visual Studio searches the directories in
order, you can have it give preference to either the original one or the new
one.
As you found, it seems to use strsafe you need to be building with the new
one, so you would put the new directories before the original ones. This
will let you at least try strsafe. If problems arise, you can always just
not use strsafe and put the directories back in the settings.
-- David
****
I'm sorry, there is no such thing as "a whole bunch of errors". There is a list of
errors, which have specific text and which have specific error numbers, and they are
reporting on specific lines of the files. WIthout knowing what those error messages say,
and where you included strsafe.h relative to the other header files, there is no way to
tell what happened.
I usually put strsafe.h at the end of my list of header files in stdafx.h.
joe
****
>Appreciate any input.
>
Joseph M. Newcomer [MVP]
email: newc...@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
Hey Joe, I kinda had a feeling you would ask for this but didn't want to clog
up the issue with a big text paste prior to maybe a simple solution with the SDK
Anyhow here are the errors and warnings, they are the same whether I put the
#include <strsafe.h> at the beginning or end of StdAfx.h.
I am going to try the other posters suggestion of installing the SDK to a separate
folder. I was afraid the install might foobar the registy if it spotted my VC 6.x install.
But it appears I can switch back and forth by just changing the include folders path.
Anyhow here they are, I meant to get back sooner but got bogged down at work
---------------Configuration: Try_2 - Win32 Debug--------------------
Compiling...
StdAfx.cpp
c:\program files\microsoft visual studio\vc98\include\winbase.h(3418) : warning C4229: anachronism used : modifiers on data are
ignored
c:\program files\microsoft visual studio\vc98\include\winbase.h(3419) : error C2226: syntax error : unexpected type 'LPSTR'
c:\program files\microsoft visual studio\vc98\include\winbase.h(3425) : warning C4229: anachronism used : modifiers on data are
ignored
c:\program files\microsoft visual studio\vc98\include\winbase.h(3426) : error C2226: syntax error : unexpected type 'LPWSTR'
c:\program files\microsoft visual studio\vc98\include\winbase.h(3432) : warning C4005: 'lstrcpy' : macro redefinition
c:\program files\microsoft visual studio\vc98\include\strsafe.h(6500) : see previous definition of 'lstrcpy'
c:\program files\microsoft visual studio\vc98\include\winbase.h(3438) : warning C4229: anachronism used : modifiers on data are
ignored
c:\program files\microsoft visual studio\vc98\include\winbase.h(3439) : error C2226: syntax error : unexpected type 'LPSTR'
c:\program files\microsoft visual studio\vc98\include\winbase.h(3445) : warning C4229: anachronism used : modifiers on data are
ignored
c:\program files\microsoft visual studio\vc98\include\winbase.h(3446) : error C2226: syntax error : unexpected type 'LPWSTR'
c:\program files\microsoft visual studio\vc98\include\winbase.h(3452) : warning C4005: 'lstrcat' : macro redefinition
c:\program files\microsoft visual studio\vc98\include\strsafe.h(6524) : see previous definition of 'lstrcat'
c:\program files\microsoft visual studio\vc98\include\winerror.h(7933) : warning C4005: 'FAILED' : macro redefinition
c:\program files\microsoft visual studio\vc98\include\strsafe.h(44) : see previous definition of 'FAILED'
c:\program files\microsoft visual studio\vc98\include\winuser.h(188) : warning C4229: anachronism used : modifiers on data are
ignored
c:\program files\microsoft visual studio\vc98\include\winuser.h(189) : error C2226: syntax error : unexpected type 'LPSTR'
c:\program files\microsoft visual studio\vc98\include\winuser.h(195) : warning C4229: anachronism used : modifiers on data are
ignored
c:\program files\microsoft visual studio\vc98\include\winuser.h(196) : error C2226: syntax error : unexpected type 'LPWSTR'
c:\program files\microsoft visual studio\vc98\include\winuser.h(202) : warning C4005: 'wvsprintf' : macro redefinition
c:\program files\microsoft visual studio\vc98\include\strsafe.h(6575) : see previous definition of 'wvsprintf'
c:\program files\microsoft visual studio\vc98\include\winuser.h(205) : warning C4229: anachronism used : modifiers on data are
ignored
c:\program files\microsoft visual studio\vc98\include\winuser.h(205) : error C2226: syntax error : unexpected type 'LPSTR'
c:\program files\microsoft visual studio\vc98\include\winuser.h(206) : warning C4229: anachronism used : modifiers on data are
ignored
c:\program files\microsoft visual studio\vc98\include\winuser.h(206) : error C2226: syntax error : unexpected type 'LPWSTR'
c:\program files\microsoft visual studio\vc98\include\winuser.h(210) : warning C4005: 'wsprintf' : macro redefinition
c:\program files\microsoft visual studio\vc98\include\strsafe.h(6566) : see previous definition of 'wsprintf'
c:\program files\microsoft visual studio\vc98\include\tchar.h(55) : warning C4005: '_ftcscat' : macro redefinition
c:\program files\microsoft visual studio\vc98\include\strsafe.h(6563) : see previous definition of '_ftcscat'
c:\program files\microsoft visual studio\vc98\include\tchar.h(57) : warning C4005: '_ftcscpy' : macro redefinition
c:\program files\microsoft visual studio\vc98\include\strsafe.h(6521) : see previous definition of '_ftcscpy'
c:\program files\microsoft visual studio\vc98\include\tchar.h(444) : warning C4005: '_stprintf' : macro redefinition
c:\program files\microsoft visual studio\vc98\include\strsafe.h(6590) : see previous definition of '_stprintf'
c:\program files\microsoft visual studio\vc98\include\tchar.h(445) : warning C4005: '_sntprintf' : macro redefinition
c:\program files\microsoft visual studio\vc98\include\strsafe.h(6593) : see previous definition of '_sntprintf'
c:\program files\microsoft visual studio\vc98\include\tchar.h(448) : warning C4005: '_vstprintf' : macro redefinition
c:\program files\microsoft visual studio\vc98\include\strsafe.h(6584) : see previous definition of '_vstprintf'
c:\program files\microsoft visual studio\vc98\include\tchar.h(449) : warning C4005: '_vsntprintf' : macro redefinition
c:\program files\microsoft visual studio\vc98\include\strsafe.h(6587) : see previous definition of '_vsntprintf'
c:\program files\microsoft visual studio\vc98\include\tchar.h(465) : warning C4005: '_getts' : macro redefinition
c:\program files\microsoft visual studio\vc98\include\strsafe.h(6596) : see previous definition of '_getts'
c:\program files\microsoft visual studio\vc98\include\tchar.h(493) : warning C4005: '_tcscat' : macro redefinition
c:\program files\microsoft visual studio\vc98\include\strsafe.h(6560) : see previous definition of '_tcscat'
c:\program files\microsoft visual studio\vc98\include\tchar.h(494) : warning C4005: '_tcscpy' : macro redefinition
c:\program files\microsoft visual studio\vc98\include\strsafe.h(6518) : see previous definition of '_tcscpy'
Error executing cl.exe.
Creating browse info file...
Try_2.exe - 8 error(s), 22 warning(s)
--End of errors
Key here is you must not put strsafe.h ahead of ANY of the standard Windows header files,
which it looks as if you have done.
joe
From my own viewpoint, being told you are likely to be dead shortly is very sobering. This
is why I have no qualms about telling people very bluntly that they are wrong. I'm 20
years since one surgery that was mandatory ("or you'll be dead in a year") and 15 years
one that was accidental (I didn't know when I went into the OR if I'd be coming out,
having lost most of my blood supply). So I don't have to maintain any pretenses. WYSIWYG
with me. I've already outlived two projections, both due to living in a city with some of
the world's best hospitals. I seem to be fixed right now, but I realize that I could not
be here tomorrow. I have three linear feet of scar tissue on my body from various
surgeries (one 8" scar has to be counted twice, since the second surgery reused it) and
don't feel I need to be overly polite when things are going wrong. I have a sense of
proportion about what matters.
I heard Jim Lovell (Apollo 13 commander) explain that after his last flight, he doesn't
have any problem coping with any problem; I don't recall his exact words, but they were
along the lines of "I know what serious problems are, and I haven't had one since I
landed". I feel the same way. So while the care is time-consuming, I know how to get
through these crises. This is the fifth "eldercare" situation I've had to handle, and I
pretty much know who I have to talk to, what questions to ask, and what to do with the
answers. Being trained as a problem-solver helps a lot.
joe
>I heard Jim Lovell (Apollo 13 commander) explain that after his last flight, he doesn't
>have any problem coping with any problem; I don't recall his exact words, but they were
>along the lines of "I know what serious problems are, and I haven't had one since I
>landed".
Wow, that really transcends all description. If memory serves me correctly Jim is the one
that did hand calculus with pen and paper on the projected reentry path due to technical
failures on the return trip from the Moon. He really was quite a talented individual.
> This is the fifth "eldercare" situation I've had to handle, and I pretty much know who I
> have to talk to, what questions to ask, and what to do with the answers. Being trained
> as a problem-solver helps a lot. joe
Boy that is the truth. My dad died first and 10yrs later when my Mom was ill she was so
out of congnitiveness due to the cancer and medications that I literally had to be her brain
as far as conversing with the various doctors during her care. I had to learn a lot about the
logistics of hospital protocol etc and I can definitely relate to what you are describing.
Take care Joe and hope the best for your family member.
The functions listed in
http://msdn.microsoft.com/en-us/library/ff468910(v=VS.85).aspx starting with
"String" are what you want.
-- David