Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

ServProv.h problem for first time Win32 API user

Hello chaps.

I decided to have a go at using the Win API. Long time C++ coder, first time coding the Win API. I banged out some lines.



#include

int main (void)

{
return 0;
}


Result: No dice. An error tucked away in ServProv.h, apparently. Seemed odd, so I wrote this:



#include

int main (void)

{
return 0;
}


Same errors;

c:Program FilesMicrosoft Visual Studio .NET
2003Vc7PlatformSDKIncludeServProv.h(113): warning C4094: untagged
'struct' declared no symbols
c:Program FilesMicrosoft Visual Studio .NET
2003Vc7PlatformSDKIncludeServProv.h(106): error C2283:
'__unnamed::QueryService' : pure specifier not allowed on unnamed struct


Since I'm doing nothing other than including a standard header file, I must be really, REALLY missing the point here. Could someone please enlighten me as to what I'm doing wrong?

Moschops

Comments

  • stoberstober Member Posts: 9,765 ✭✭✭
    First example is correct, second is wrong. How did you create the project ? a console project or a windows project ? And you have an old compiler -- you should upgrade to VS 2005. You can get VC++ 2005 Express for free.
    =============================================
    never lie -- the government doesn't like the competition. (Author unknown)
  • MoschopsMoschops Member Posts: 3
    Eventually it turned out to be a corrupt ServProv.h file. The *.idl file was fine, but somehow the ServProv.h file had a line missing, resulting in a class becoming an abstract class with a pure virtual function in it.

    When you say the second example is wrong, in what way is it wrong? It's not incorrect C++ - what's the significance of ServProv.h ?
  • stoberstober Member Posts: 9,765 ✭✭✭
    : When you say the second example is wrong, in what way is it wrong?
    : It's not incorrect C++ - what's the significance of ServProv.h ?
    :

    If you want to write a MS-Windows win32 api program you have to include windows.h. Your second example did not do that.
    =============================================
    never lie -- the government doesn't like the competition. (Author unknown)
  • MoschopsMoschops Member Posts: 3
    It became an exercise in 'what's wrong with ServProv.h', rather than a Win32 API exercise.
Sign In or Register to comment.