![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Hobbyist Programmer
Join Date: Jun 2005
Location: Helltown
Posts: 162
Rep Power: 4
![]() |
yet another vc++ question
hmmm...i hate these warning messages
dis is the list of warnings I get: G:\n02\ServerDialog.cpp(6) : warning C4518: 'int ' : storage-class or type specifier(s) unexpected here; ignored G:\n02\ServerDialog.cpp(6) : warning C4230: anachronism used : modifiers/qualifiers interspersed, qualifier ignored G:\n02\ServerDialog.cpp(8) : warning C4508: 'kailleraSelectServerDialog' : function should return a value; 'void' return type assumed for my code: #include "windows.h"
//#include "n02.h"
__stdcall int kailleraSelectServerDialog(HWND parent){
}why does it ignore type specifier and then complain it doesnot exist? why is the type specifier ignored in the first place? am I doing something wrong? Thanks in advance - Visual c++ 6.0
__________________
Spread your wings and fly! Chicken! |
|
|
|
|
|
#2 | |
|
Expert Programmer
Join Date: Jun 2005
Posts: 893
Rep Power: 4
![]() |
The __stdcall specifier needs to go after the type of the return value.
Quote:
int __stdcall kailleraSelectServerDialog(HWND parent){ |
|
|
|
|
|
|
#3 |
|
Programming Guru
![]() Join Date: Jun 2005
Location: elemental plane
Posts: 1,429
Rep Power: 5
![]() |
Can't you instead do?:
int WINAPI kailleraSelectServerDialog(HWND parent){
__________________
"Employ your time in improving yourself by other men's writings, so that you shall gain easily what others have labored hard for." -- Socrates |
|
|
|
|
|
#4 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
Well, the order was the problem, as The Dark pointed out, and substituting WINAPI does precisely what, given that:
#define WINAPI __stdcall
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#5 |
|
Hobbyist Programmer
Join Date: Jun 2005
Location: Helltown
Posts: 162
Rep Power: 4
![]() |
in visual c++...does __stdcall do more than just calling convention for the function? Some guy has his dll protos declared as:
__declspec(dllexport) WINAPI kailleraModifyPlayValues(void *values, int size); //is the same as: //__declspec(dllexport) __stdcall kailleraModifyPlayValues(void *values, int size);
__________________
Spread your wings and fly! Chicken! |
|
|
|
|
|
#6 |
|
Expert Programmer
Join Date: Jun 2005
Posts: 893
Rep Power: 4
![]() |
I think those declarations are just missing the return type, so it is assumed to be returning an int. This would probably only work when you are compiling a C file, rather than a C++ file. Otherwise Visual Studio 8 puts out the following warning:
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|