Pelles C forum

C language => Beginner questions => Topic started by: spip on February 17, 2008, 04:26:04 PM

Title: Understanding how to use the APIs
Post by: spip on February 17, 2008, 04:26:04 PM
Hi,

I've just downloaded Pelles C and experimented a little with it. I'm really impressed with the quality of it!

However, I am at a loss as to how I the windows API is used from standard C. I've learned from the examples, but now I'm stuck with a specific call:

hr = SetCooperativeLevel(hwnd, DDSCL_FULLSCREEN);

The linker says "Unresolved external symbol: SetCooperativeLevel".

I've included "ceddraw.h" where the function is defined with a:
STDMETHOD(SetCooperativeLevel)(THIS_ HWND,DWORD) PURE;

Could anyone advice my on what is wrong here?

Generally speaking I find that most of the available documentation is written for C++. Is there any general advice on how to port a C++ example to C?

Thanks,
Jakob
Title: Re: Understanding how to use the APIs
Post by: Vortex on February 17, 2008, 05:09:07 PM
Hi spip,

Welcome to the forum.

In your project settings, did you specify the correct import library referencing the SetCooperativeLevel function?
Title: Re: Understanding how to use the APIs
Post by: spip on February 17, 2008, 08:03:28 PM
Hi spip,

Welcome to the forum.

In your project settings, did you specify the correct import library referencing the SetCooperativeLevel function?

Thanks, and thanks for the quick reply. I didn't specify it for inclusion but just tried it out. That didn't change anything. I should add that when I force Pelles C to compile, it also complains about the missing prototype. I have a hunch I'm missing something regarding the rather speciel declaration of the function?

Regards,
Spip