Thanks for the reply but I am still having problems. First off I have
#define _WIN32_WINNT 0x0400 in my stdafx.h file and I noticed that has the
include for atlcom.h. Shouldn't this be enough? Anyway I did add the
#define to my objbase.h and I didn't get that error but I then get these
errors
PortMonitor error LNK2005: __fltused already defined in
atlmincrt.lib(atlinit.obj)
PortMonitor error LNK2005: _malloc already defined in
atlmincrt.lib(atlinit.obj)
PortMonitor error LNK2005: _free already defined in
atlmincrt.lib(atlinit.obj)
PortMonitor error LNK2005: _realloc already defined in
atlmincrt.lib(atlinit.obj)
PortMonitor warning LNK4222: exported symbol 'DllCanUnloadNow' should not be
assigned an ordinal
PortMonitor warning LNK4222: exported symbol 'DllGetClassObject' should not
be assigned an ordinal
PortMonitor warning LNK4222: exported symbol 'DllRegisterServer' should not
be assigned an ordinal
PortMonitor warning LNK4222: exported symbol 'DllUnregisterServer' should
not be assigned an ordinal
PortMonitor warning LNK4006: __fltused already defined in
atlmincrt.lib(atlinit.obj); second definition ignored
PortMonitor warning LNK4006: _malloc already defined in
atlmincrt.lib(atlinit.obj); second definition ignored
PortMonitor warning LNK4006: _free already defined in
atlmincrt.lib(atlinit.obj); second definition ignored
PortMonitor warning LNK4006: _realloc already defined in
atlmincrt.lib(atlinit.obj); second definition ignored
PortMonitor error LNK2001: unresolved external symbol ___xt_z
PortMonitor error LNK2001: unresolved external symbol ___xt_a
PortMonitor error LNK2001: unresolved external symbol ___xp_z
PortMonitor error LNK2001: unresolved external symbol ___xp_a
PortMonitor fatal error LNK1120: 4 unresolved externals
And this I really have no clue on. I'm sorry, I feel like an idiot but I am
pretty fresh out of college and the main language they taught there was
Java, and my other languages are like VB, and VFP, and JavaScript so it is a
little different, then I get out in the workplace and get a job where I am
the only programmer trying to update code that was written 5 years ago and I
have no one that has experience in C++ to ask. I can understand the basic
syntax of the language but its all this extra stuff that throws me off.
"William DePalo [MVP VC++]" <wi***********@mvps.org> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
"Altman" <No******@SickOfSpam.com> wrote in message
news:Oj*************@TK2MSFTNGP12.phx.gbl... C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\atlmfc\include\atlcom.h(144): error C2065:
'COINIT_MULTITHREADED'
: undeclared identifier
OK.
I have limited experience with C++ and I cannot figure this out.
Here is a hint that you can use to solve a similar problem on your own the
next time. Highlight or double-click a "token" in your source. Click the
right mouse button and choose "Go to definition" from the context menu. I
haven't tried that but you should be taken here in <objbase.h>
#if (_WIN32_WINNT >= 0x0400 ) || defined(_WIN32_DCOM) // DCOM
// These constants are only valid on Windows NT 4.0
COINIT_MULTITHREADED = 0x0, // OLE calls objects on any thread.
COINIT_DISABLE_OLE1DDE = 0x4, // Don't use DDE for Ole1 support.
COINIT_SPEED_OVER_MEMORY = 0x8, // Trade memory for speed.
#endif // DCOM
The first check makes sure you are running on an NT platform
(NT/2K/XP/2K+3)
at least as recent as version 4.00. The second checks if the target as
distributed COM installed.
To fix the problem add this line
#define _WIN32_WINNT 0x0400
if you only intend to support NT kernels or
#define _WIN32_DCOM
if you presume DCOM has been installed.
Alternatively you can set the defines in your project settings of the C++
options.
Regards,
Will