NO

Author Topic: Understanding how to use the APIs  (Read 3183 times)

spip

  • Guest
Understanding how to use the APIs
« 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

Online Vortex

  • Member
  • *
  • Posts: 802
    • http://www.vortex.masmcode.com
Re: Understanding how to use the APIs
« Reply #1 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?
Code it... That's all...

spip

  • Guest
Re: Understanding how to use the APIs
« Reply #2 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