473,625 Members | 2,649 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Migration of VC++ 6.0 Project to VC++.NET Compilation Error

I converted my VC++ 6.0 Project to VC++.NET and during compilation, I get the
following error everywhere:

Error 1 error C4430: missing type specifier - int assumed. Note: C++ does
not support default-int g:\argusweb\sou rce\gssutil\xml message.h 20

If is referring to the line:
log_comment(cha r *psz_comment, long bStart=0);

You can see it in the .h file below:
// XmlMessage.h: interface for the XmlMessage class.
//
//////////////////////////////////////////////////////////////////////

#if
!defined(AFX_XM LMESSAGE_H__9D3 221FC_2D98_45A5 _A442_FC067DA20 64D__INCLUDED_)
#define AFX_XMLMESSAGE_ H__9D3221FC_2D9 8_45A5_A442_FC0 67DA2064D__INCL UDED_
#define WINVER 0x0502

#if _MSC_VER 1000
#pragma once
#endif // _MSC_VER 1000

#include "msxml2.h"
#include "gss_types. h"

class XmlMessage
{
public:
static TCHAR* Escape(const TCHAR * pchXML);
log_comment(cha r *psz_comment, long bStart=0);
CString GetParseError() ;
static CString FormatDate(CStr ing sDate, CString sDTFormat = _T("%Y/%m/%d
%H:%M:%S"));
XmlMessage(cons t TCHAR* pchXML, long lSpecial);
XmlMessage();
explicit XmlMessage(cons t long lGssMsg);
virtual ~XmlMessage();
operator long () {
return m_lGssMsg;
};
operator TCHAR* () {
TCHAR* pch = new TCHAR[m_sXml.GetLengt h() + 1];
_tcscpy(pch, m_sXml);
return pch;
};

Feb 16 '07 #1
5 3672
Sounds like a valid error message. You need to change to:

int log_comment(cha r *psz_comment, long bStart=0);

or more likely:

void log_comment(cha r *psz_comment, long bStart=0);

Brian
"Nishal Patel" <Ni*********@di scussions.micro soft.comwrote in message
news:6C******** *************** ***********@mic rosoft.com...
>I converted my VC++ 6.0 Project to VC++.NET and during compilation, I get
the
following error everywhere:

Error 1 error C4430: missing type specifier - int assumed. Note: C++ does
not support default-int g:\argusweb\sou rce\gssutil\xml message.h 20

If is referring to the line:
log_comment(cha r *psz_comment, long bStart=0);

You can see it in the .h file below:
// XmlMessage.h: interface for the XmlMessage class.
//
//////////////////////////////////////////////////////////////////////

#if
!defined(AFX_XM LMESSAGE_H__9D3 221FC_2D98_45A5 _A442_FC067DA20 64D__INCLUDED_)
#define AFX_XMLMESSAGE_ H__9D3221FC_2D9 8_45A5_A442_FC0 67DA2064D__INCL UDED_
#define WINVER 0x0502

#if _MSC_VER 1000
#pragma once
#endif // _MSC_VER 1000

#include "msxml2.h"
#include "gss_types. h"

class XmlMessage
{
public:
static TCHAR* Escape(const TCHAR * pchXML);
log_comment(cha r *psz_comment, long bStart=0);
CString GetParseError() ;
static CString FormatDate(CStr ing sDate, CString sDTFormat = _T("%Y/%m/%d
%H:%M:%S"));
XmlMessage(cons t TCHAR* pchXML, long lSpecial);
XmlMessage();
explicit XmlMessage(cons t long lGssMsg);
virtual ~XmlMessage();
operator long () {
return m_lGssMsg;
};
operator TCHAR* () {
TCHAR* pch = new TCHAR[m_sXml.GetLengt h() + 1];
_tcscpy(pch, m_sXml);
return pch;
};

Feb 16 '07 #2
Thanks. That worked. Needed to set to VOID in front.

Got another questions with compile problem. It does not like this:

friend istream& operator>>(istr eam& ar, AString& string);

Gives the following error:

Error 2 error C2433: 'ostream' : 'friend' not permitted on data
declarations g:\argusweb\sou rce\dbapp\AStri ng.h 115
"Brian Muth" wrote:
Sounds like a valid error message. You need to change to:

int log_comment(cha r *psz_comment, long bStart=0);

or more likely:

void log_comment(cha r *psz_comment, long bStart=0);

Brian
"Nishal Patel" <Ni*********@di scussions.micro soft.comwrote in message
news:6C******** *************** ***********@mic rosoft.com...
I converted my VC++ 6.0 Project to VC++.NET and during compilation, I get
the
following error everywhere:

Error 1 error C4430: missing type specifier - int assumed. Note: C++ does
not support default-int g:\argusweb\sou rce\gssutil\xml message.h 20

If is referring to the line:
log_comment(cha r *psz_comment, long bStart=0);

You can see it in the .h file below:
// XmlMessage.h: interface for the XmlMessage class.
//
//////////////////////////////////////////////////////////////////////

#if
!defined(AFX_XM LMESSAGE_H__9D3 221FC_2D98_45A5 _A442_FC067DA20 64D__INCLUDED_)
#define AFX_XMLMESSAGE_ H__9D3221FC_2D9 8_45A5_A442_FC0 67DA2064D__INCL UDED_
#define WINVER 0x0502

#if _MSC_VER 1000
#pragma once
#endif // _MSC_VER 1000

#include "msxml2.h"
#include "gss_types. h"

class XmlMessage
{
public:
static TCHAR* Escape(const TCHAR * pchXML);
log_comment(cha r *psz_comment, long bStart=0);
CString GetParseError() ;
static CString FormatDate(CStr ing sDate, CString sDTFormat = _T("%Y/%m/%d
%H:%M:%S"));
XmlMessage(cons t TCHAR* pchXML, long lSpecial);
XmlMessage();
explicit XmlMessage(cons t long lGssMsg);
virtual ~XmlMessage();
operator long () {
return m_lGssMsg;
};
operator TCHAR* () {
TCHAR* pch = new TCHAR[m_sXml.GetLengt h() + 1];
_tcscpy(pch, m_sXml);
return pch;
};


Feb 16 '07 #3
Nishal Patel wrote:
Thanks. That worked. Needed to set to VOID in front.

Got another questions with compile problem. It does not like this:

friend istream& operator>>(istr eam& ar, AString& string);

Gives the following error:

Error 2 error C2433: 'ostream' : 'friend' not permitted on data
declarations g:\argusweb\sou rce\dbapp\AStri ng.h 115
The error points to ostream, which I don't see in your code. Where's
AString? You have to show us a short but 100% complete sample that
reproduces the problem, or at least include enough contextual information.

This compiles to me, so it's really not that line of code that causes
the error:

using namespace std;

class AString
{
friend istream& operator>>(istr eam& ar, AString& string);
};

istream& operator>>(istr eam& ar, AString& string)
{
return ar;
}

Tom
Feb 16 '07 #4
Yes, that compiles; however, adding

void main()
{
AString a;
cin >a;
}

gives "error C2593: 'operator >>' is ambiguous."

Though I don't completely understand the cause, one solution appears to be to add prototypes at the beginning, i.e.

class AString;

istream& operator>>(istr eam& ar, AString& string);

class AString
{
friend istream& operator>>(istr eam& ar, AString& string);
};
istream& operator>>(istr eam& ar, AString& string)
{
return ar;
}

void main()
{
AString a;
operator>>(cin, a);
}
However, I don't know if this, in turn, will lead to other problems. If anyone knows of a better, or preferred, solution let me know.
Mar 3 '07 #5
Please ignore my previous comments. I expect that the problems I indicated are due to a known MSDN bug: http://support.microsoft.com/kb/192539/en-us
Mar 3 '07 #6

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

Similar topics

1
1562
by: Paljo | last post by:
Trying to compile VC++ 6 project in VC++ 7 and getting a compiling error, error C2955: '_com_ptr_t' : use of class template requires template argument list Any thoughts? Thanks
6
2778
by: Ben Terry | last post by:
Hello, I have a VS 2003.NET solution which consists of four c++ unmanaged legacy projects. I am adding a new project to the solution which will be in c#. What do I need to do to my c++ projects in order to call my c# modules from within c++? From what I understand, I need to convert my c++ code from unmanaged to managed using the /clr switch (IJW). Is this correct? Are there any other considerations I need to be aware of? Ben
0
1978
by: Ganapathy | last post by:
I have COM dll code written in VC 6.0. When i tried compiling this code in VC 7, The MIDL cmpiler gets called twice. i.e. it initially compiles fully & immediately a line - 64 bit processing' comes, followed by the 64 bit compilation of the IDl file. The comlpilation goes thro' the full stage and then the StdAfx.cpp is compiled. I have another similar VC 6 COM dll code that gets compiled without invoking the 64 bit processing of the...
26
1948
by: _R | last post by:
Given that VS2005 has made an effort to clean up the syntax of VC++ (in C++/CLI), is there any future plans to do away with function protos, ala C#/VB? What are they needed for these days?
4
8104
by: Richard MSL | last post by:
I have a command line project that I am migrating from VS2003 to VS2005. There is a combination of C, C++ and C#. When I build the project, I have this in my call to cl.exe in my batch file: /link /nodefaultlib:libc /nodefaultlib:libcmt /nodefaultlib:libcd My compile gets three unresolved externals: Searching C:\Program Files\Microsoft Visual Studio 8\VC\LIB\kernel32.lib: Searching c:\mbs7\sys\lib\expbin\minofuncs.lib:
1
3861
by: Bonggoy Cruz | last post by:
We have a fairly big size ASP.NET web application that was written VB.NET. We are in the process converting the web project. We used the migration wizard included in VS 2005. I followed step by step guide outlined in here: http://msdn.microsoft.com/asp.net/reference/migration/upgrade/default.aspx?pull=/library/en-us/dnaspp/html/webprojectsvs05.asp. I was able to convert the project without any problem. Compiling and building them is...
3
1589
by: lewisksh | last post by:
hi, i have 1 MFC project which is written using VC++2003 but i need to migrate to VC++2005. The program (VC++2003) is working fine. but there is erros occur when running in VC++2005, and i just able to figure out that the problem was come from the following code. # ifdef WIN32 # if defined(MPSC_EXPORT) # define MPSC_API __declspec( dllexport )
0
1806
by: parekh | last post by:
Hi All , I am facing a problem wherein my VB project is not recognizing a change in the argument list of a method ( the method itself being declared and defined in another VC++ project and it is now updated to accept one more additional argument ). The problem in detail is as follows: I have a Class (named Student ) in an existing VC++ project. One of its Methods has the following signature and accepts 2 arguments ...
4
6243
by: nmrcarl | last post by:
I'm trying to upgrade a large project from VS 6.0 to VS 2005. After fixing a lot of things that changed (mostly sloppy coding in the original project that VS2005 didn't allow), I got the release version to build successfully. Unfortunately, it crashes right away when I start it. So now I need to build the debug version. Unfortunately, the compiler gives innumerable error messages of the sort shown below. The #include file referenced...
0
8253
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8635
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8354
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8497
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6116
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
5570
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();...
1
2621
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
1
1802
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1499
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.