473,667 Members | 2,583 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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_MULTITH READED' :
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 3023
"Altman" <No******@SickO fSpam.com> wrote in message
news:Oj******** *****@TK2MSFTNG P12.phx.gbl...
C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\atlmfc \include\atlcom .h(144): error C2065: 'COINIT_MULTITH READED' : 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_MULTITHR EADED = 0x0, // OLE calls objects on any thread.
COINIT_DISABLE_ OLE1DDE = 0x4, // Don't use DDE for Ole1 support.
COINIT_SPEED_OV ER_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(a tlinit.obj)
PortMonitor error LNK2005: _malloc already defined in
atlmincrt.lib(a tlinit.obj)
PortMonitor error LNK2005: _free already defined in
atlmincrt.lib(a tlinit.obj)
PortMonitor error LNK2005: _realloc already defined in
atlmincrt.lib(a tlinit.obj)
PortMonitor warning LNK4222: exported symbol 'DllCanUnloadNo w' should not be
assigned an ordinal
PortMonitor warning LNK4222: exported symbol 'DllGetClassObj ect' should not
be assigned an ordinal
PortMonitor warning LNK4222: exported symbol 'DllRegisterSer ver' should not
be assigned an ordinal
PortMonitor warning LNK4222: exported symbol 'DllUnregisterS erver' should
not be assigned an ordinal
PortMonitor warning LNK4006: __fltused already defined in
atlmincrt.lib(a tlinit.obj); second definition ignored
PortMonitor warning LNK4006: _malloc already defined in
atlmincrt.lib(a tlinit.obj); second definition ignored
PortMonitor warning LNK4006: _free already defined in
atlmincrt.lib(a tlinit.obj); second definition ignored
PortMonitor warning LNK4006: _realloc already defined in
atlmincrt.lib(a tlinit.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******** ********@TK2MSF TNGP10.phx.gbl. ..
"Altman" <No******@SickO fSpam.com> wrote in message
news:Oj******** *****@TK2MSFTNG P12.phx.gbl...
C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\atlmfc \include\atlcom .h(144): error C2065:
'COINIT_MULTITH READED'

:
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_MULTITHR EADED = 0x0, // OLE calls objects on any thread.
COINIT_DISABLE_ OLE1DDE = 0x4, // Don't use DDE for Ole1 support.
COINIT_SPEED_OV ER_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
5764
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 use of checkpoints (for simple recovery and Backup Log for full recovery). On several website people speak about full transaction log and the pace of growing can't keep up with the update. Therefore we want to create a script which flushes the...
0
1532
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 the NSE index was used till recently. after upgrading to DB2 UDB V8.1 FP6 and NSE FP4, even the manually updating went to error: SQL0444N function
2
19520
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) Update TABLE set ACCESS_DATE=current date where SID= (3) Do not commit (4) Next row After each SID in the list is finished being updated I want to commit all the updates. If any update fails I want to rollback the entire
1
2102
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 Database. (Disconnected Datasets). The problem I have is a new SqlAdapter is required before updating the Database: Therefore, to allow the update I have to do the following:
1
1657
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 just the text fields in the row everything works fine with the following command:
1
1231
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 seem to update it. I keep getting this error: System.Data.OleDb.OleDbException: Data type mismatch in criteria expression from this line:
5
2027
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 one row, all of them were updated so i immediatelly figured out that i have to include the id of every entry in the update statement. This is where the problem is raised. My database is an Access database. The table i am updating contains a Date...
0
1053
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
4546
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 set to...it is set to false. Can someone show me what I am doing wrong and tell me the correct way? Thank you. In the page load event, I am doing the following:
11
6060
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 if that's what's causing the behavior or not. It seems like the Update button should at least do something. When the Edit button is clicked, the grid goes into Edit mode and the Cancel button takes the grid out of Edit mode. So, I don't get what...
0
8883
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
7390
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6203
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5675
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4200
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4372
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2776
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2013
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1778
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.