473,503 Members | 1,673 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

issue with #include

Hi,

Under VC++.NET, i have a stupid issue with #include statement.
Usually when we include some *.h file, we need to declare them before
any #using <or #using namespace... to avoid issue at compilation time.

However, when i write #include "commctrl.h" as below in my *.h file :

#pragma once
#include "commctrl.h"
#using <mscorlib.dll>

using namespace System;
using namespace System::Windows::Forms;
using namespace System::Drawing;
using namespace System::ComponentModel;
....

i have a lot of errors like :
D:\Program Files\Microsoft Visual Studio
8\VC\PlatformSDK\include\commctrl.h(29) : error C2146: syntax error :
missing ';' before identifier 'HRESULT'
D:\Program Files\Microsoft Visual Studio
8\VC\PlatformSDK\include\commctrl.h(29) : error C4430: missing type
specifier - int assumed. Note: C++ does not support default-int
and so on...

so now, where the problem ?

thanks a lot,
Al.
Oct 31 '06 #1
1 1717
Additional information :

I did the following thing in my *.h file :

#pragma once
#include <windows.h>
#include "commctrl.h"
#using <mscorlib.dll>
....
LRESULT hWnd;
hWnd = ::SendMessage((HWND)(this->Handle.ToPointer()), LVM_GETHEADER, 0, 0);

but the linker tells :
RAF_ListView.obj : error LNK2028: unresolved token (0A00004B) "extern
"C" long __stdcall SendMessageW(struct HWND__ *,unsigned int,unsigned
int,long)" (?SendMessageW@@$$J216YGJPAUHWND__@@IIJ@Z) referenced in
function "extern "C" long __cdecl SendMessage(struct HWND__ *,unsigned
int,unsigned int,long)" (?SendMessage@@$$J0YAJPAUHWND__@@IIJ@Z)

and

RAF_ListView.obj : error LNK2019: unresolved external symbol "extern "C"
long __stdcall SendMessageW(struct HWND__ *,unsigned int,unsigned
int,long)" (?SendMessageW@@$$J216YGJPAUHWND__@@IIJ@Z) referenced in
function "extern "C" long __cdecl SendMessage(struct HWND__ *,unsigned
int,unsigned int,long)" (?SendMessage@@$$J0YAJPAUHWND__@@IIJ@Z)

except the stdcall changed by cdecl in the error message, everything is
the same...

where is the problem ?

Al.

--== Alain ==-- wrote:
Hi,

Under VC++.NET, i have a stupid issue with #include statement.
Usually when we include some *.h file, we need to declare them before
any #using <or #using namespace... to avoid issue at compilation time.
>
However, when i write #include "commctrl.h" as below in my *.h file :

#pragma once
#include "commctrl.h"
#using <mscorlib.dll>

using namespace System;
using namespace System::Windows::Forms;
using namespace System::Drawing;
using namespace System::ComponentModel;
...

i have a lot of errors like :
D:\Program Files\Microsoft Visual Studio
8\VC\PlatformSDK\include\commctrl.h(29) : error C2146: syntax error :
missing ';' before identifier 'HRESULT'
D:\Program Files\Microsoft Visual Studio
8\VC\PlatformSDK\include\commctrl.h(29) : error C4430: missing type
specifier - int assumed. Note: C++ does not support default-int
and so on...

so now, where the problem ?

thanks a lot,
Al.
Oct 31 '06 #2

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

Similar topics

1
6059
by: Ryan Liu | last post by:
All, When I include <vector> head file in our application. It generates the following following error when complileing. In file included from...
7
1458
by: Prashant | last post by:
Hi, i'm having an issue with combining functions from C and C++. I'm trying to create a logging function that displays the file, function and line number of the code that wants to log a certain...
2
2854
by: David Arden Stevensonn | last post by:
On 'sub1.othercompany.com' there is a simple php file with an include that calls a script on my company's server 'sub2.mycompany.com' The script on my company's server seems to work fine when I...
0
1588
by: Maxwell | last post by:
Hello, I recently completed a MC++ (VS2003) DLL that wraps a non MFC C++ DLL and need to use it in a MC++ Console Application (no forms/guis of any kind just output to console). Trouble is...
1
1876
by: keliie | last post by:
I have a relatively simple (I assume) issue which I am at a complete loss to address. My issues is: I want to populate fields in my tables with summary data from the same table. Let me explain: ...
2
305
by: --== Alain ==-- | last post by:
Hi, Under VC++.NET, i have a stupid issue with #include statement. Usually when we include some *.h file, we need to declare them before any #using <or #using namespace... to avoid issue at...
13
1612
by: Howard Hinnant | last post by:
Hello, I'm writing a brief paper on LWG issue 206: http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-active.html#206 It would help me immensely if I knew more about the current practice of...
2
2092
by: Pedro Pinto | last post by:
Hi there! I'm presented with the following situation: I'm writing a server program that receives information and saves it to a structure i've created that goes by the name of tabela. The...
10
2585
by: Schraalhans Keukenmeester | last post by:
I suspect the following problem IS hosting provider specific, but they haven't been able to help me out so far. Perhaps I am doing something wrong and someone is able to spot the issue... Here...
13
3089
by: treble54 | last post by:
I need to build PHP from source with the pdo_ibm extension and I am having an issue with it. Firstly, I am using Visual Studio .NET 2003 and I am building PHP from source through the Visual Studio...
0
7198
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,...
0
7072
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...
1
6979
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...
0
7449
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...
0
5570
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,...
1
4998
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...
0
1498
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 ...
1
730
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
373
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...

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.