I have a C++ COM project that was created with Visual C++ 6. I have just converted the project to Visual Studio 2005 and have been trying to build it. I get the following compile errors: -
warning C4290: C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
-
error C2143: syntax error : missing ';' before '__uuidof'
-
error C2059: syntax error : '__uuidof'
-
error C2143: syntax error : missing ';' before '{'
-
error C2447: '{' : missing function header (old-style formal list?)
-
The problem is that these compile errors are in a myproject_i.c file that is auto-generated by the MIDL program. How can I force MIDL to generate code that doesn't have these errors?
Could this be an artifact of the project being converted from VC6?
8 7821
Nice errors. Too bad I can't see the code.
@weaknessforcats
Good point. Duh. Sorry about that.
Here's the snippet of generated code that has the error: -
#define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \
-
const type name = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}}
-
-
MIDL_DEFINE_GUID(IID, IID_IResponse,0xCEB229AF,0x9439,0x43E7,0xB5,0xE1,0xB6,0xE2,0xC7,0xCB,0x2E,0xA7);
-
-
MIDL_DEFINE_GUID(IID, IID_ITransactionElement,0xA1650A7E,0x54D5,0x4f66,0x80,0x6B,0x40,0x28,0xCF,0xB6,0xC2,0x56);
-
-
MIDL_DEFINE_GUID(IID, IID_ITransaction,0xEFCFCD13,0xBE86,0x4793,0xA1,0x4C,0x8D,0x55,0x07,0x1B,0x2A,0x27);
-
The last line of code is the one that produces all four errors.
There must be a file that MIDL uses to determine how to generate the above code.
Did you #include <windows.h> ?
I did and your errors went away.
@weaknessforcats
I did just now, with no luck. I have one source file including the _i.c file, so I included <windows.h> before that include. No dice. I get the same errors.
Maybe you could post the code?
You haven't disabled language extensions have you? __uuidof is a Microsoft-only C++ extension.
I figured it out about an hour ago.
The line it was complaining about was the IID_ITransactio n one. Windows already defines an IID_ITransactio n. For some reason, MSVC 6 didn't complain about it, but VS 2005 does. If I change my interface name, it builds fine.
The errors it gave weren't very helpful. In fact, they led me in the wrong direction, but at least I figured it out.
Thanks for the help.
You might try this with VS 2008 especially since even this version is on its way out.
MS keeps tightening up the compiler.
Tried that. Did the same thing. Plus, I was told to use 2005 for this project.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Ravi Chaudhary |
last post by:
Hi,
We are using VS.Net 2003 and coding in VB.net. The
solution has 38 projects; most of the projects in the
solution reference other projects (without any circular
references) and all the references were added to using the
Projects tab on the Add Reference dialog and not by
browsing to the DLL for the project.
When we build or run the solution "bogus" compile errors
|
by: Carl Youngblood |
last post by:
I recognize that I may not be giving sufficient information with this,
but in the interest of not bogging the list down with too much code,
I'll try and post just a little information and then if that is
insufficient I can post more.
I have a C++ project that compiles fine with no warnings or errors.
It is relying on STL classes where appropriate. In one of my classes,
I needed to create a static member variable that was an STL map. By...
|
by: arthur-e |
last post by:
A new Machine was set up by our IS department -
it came with Office Pro 2003.
Access97, Word97 and Excel 97 were added.
I'm trying to update an Access 97database to 2003 but get weird
compiling errors -
Date, Format and Left give errors.
I've registered the missing (or those ocx's) that were indicated as
missing- iincluding - mscomct2.ocx - and the date picker showed up but
|
by: Ravi Chaudhary |
last post by:
Hi,
We are using VS.Net 2003 and coding in VB.net. The
solution has 38 projects; most of the projects in the
solution reference other projects (without any circular
references) and all the references were added to using the
Projects tab on the Add Reference dialog and not by
browsing to the DLL for the project.
When we build or run the solution "bogus" compile errors
|
by: Jarek |
last post by:
Hello!
I'm trying to fix code of esnacc to compile it in gcc4.0. I've fixed
almost all c/c++ code, but I've completly no idea about yacc.
Can someone help me how to fix the following warnings:
core/parse-asn1.y: In function 'yyparse':
core/parse-asn1.y:1517: warning: format '%ld' expects type 'long int',
but argument 4 has type 'AsnInt'
core/parse-asn1.y: In function 'InitAsn1Parser':
| |
by: donkeyboy |
last post by:
All,
I've tried the jythonc compiler to try and create an applet to see how
it works, but I get a number of Java compile errors that are way above
my knowledge. Does anyone know what any of the following means? I'm
using JDK 1.5.0_09, under Win XP SP2.
Runnnig the file " jython FILENAME" works, so I don't know what's
happening. Any thoughts?
|
by: j |
last post by:
I am getting this error when trying to compile code generated using
xsd.exe:
The type 'TrailerList' already contains a definition for
'rCMSTrailerListRow' c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary
ASP.NET Files\photoblobws\4e7bb29f\6f50d4db\App_Code.vnsjeqin.4.cs
What could cause this error in a generated file? What should I look for
in the code file to fix it?
|
by: John Dalberg |
last post by:
I converted a working web site project to a web application project and I
am getting a bunch of warnings and compile errors.
All code using .NET's profile class is giving an error.
example line:
txtName.Text = Profile.FirstName
gives an error:
... FirstName' is not a member of 'Profile'.
|
by: =?Utf-8?B?SG93YXJkIFBpbnNsZXk=?= |
last post by:
I'm trying to convert a Web Site to the Web Application project model and I'm
running into compile errors that do not seem to be covered by the guidance I
found at "Converting a Web Site Project to a Web Application Project".
The issue is that standard ASP.NET controls that are embedded as child
controls within the ContentTemplate of the Ajax Control Toolkit's
TabContainer/TabPanel are no longer visible to the page (and result in
compile...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
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...
| |
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...
|
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,...
|
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...
|
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...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
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
| |