473,382 Members | 1,705 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Problem updating to .net

We just recently got an MSDN subscription and obtained a copy of .Net. I am
trying to convert a VC++ 6.0 code to .net and when I try to build it I get
the following error
C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\atlmfc\include\atlcom.h(144): error C2065: 'COINIT_MULTITHREADED' :
undeclared identifier

I have limited experience with C++ and I cannot figure this out. The error
is in the header file made by microsoft. How can this be? This seems to be
the only error that I am getting though. Are there any other things in
converting that I should watch out for? Also, in order to run this program
on another machine do they need have the .Net Framework installed?
Nov 17 '05 #1
3 3012
"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


Nov 17 '05 #2
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

Nov 17 '05 #3

Try to change compiler options RunTimeLibrary -> Single-Threaded
Multi-Threade
-
valkavale
-----------------------------------------------------------------------
Posted via http://www.mcse.m
-----------------------------------------------------------------------
View this thread: http://www.mcse.ms/message862993.htm

Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Hennie de Nooijer | last post by:
Hi, Currently we're a building a metadatadriven datawarehouse in SQL Server 2000. We're investigating the possibility of the updating tables with enormeous number of updates and insert and the...
0
by: Hardy | last post by:
A strange problem. the NSE index had been updated automatically according to the configuration but it stoped to autoupdate from months ago. the configuration is still auto.. so manually updating...
2
by: Ray | last post by:
I have a list of about 20,000 rows that I am updating. I loop through each row in my program and basically do the following (1) select * from TABLE where SID= for update /*lock the row*/ (2)...
1
by: Steven Blair | last post by:
Hi, Here is a short decsription of my problem. I have written a dll for Database accessing. I have one method which can return a Dataset and another method which takes a Dataset and upates a...
1
by: delta7 | last post by:
Hi, I'm new to C sharp and currently writing a small program that uses an Access 2003 database. I am currently having a problem when updating a row that includes numeric data. When updating...
1
by: Mark | last post by:
I'm having a problem updating recordsin an Access DB table. I can update other tables in this db with no problem, and I can dreate new record in all of the tables (including this one.)> But I can't...
5
by: junglist | last post by:
Hi guys, I've been trying to implement an editable datagrid and i have been succesful up to the point where i can update my datagrid row by row. However what used to happen was that once i updated...
0
by: Mike P | last post by:
I'm updating a datagrid which works fine, but after updating the datagrid does not return to 'view' status, remaining in 'edit' status. Has anybody else had this problem? Thanks, Mike
2
by: Mike Collins | last post by:
I cannot get the correct drop down list value from a drop down I have on my web form. I get the initial value that was loaded in the list. It was asked by someone else what the autopostback was...
11
by: SAL | last post by:
Hello, I have a Gridview control (.net 2.0) that I'm having trouble getting the Update button to fire any kind of event or preforming the update. The datatable is based on a join so I don't know...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.