Pelles C forum

C language => Pocket PC and Smartphone questions => Topic started by: ks65 on April 12, 2008, 04:50:23 PM

Title: POLINK: error: Unresolved external symbol 'CheckDlgButton'
Post by: ks65 on April 12, 2008, 04:50:23 PM
I have problems linking the functions CheckDlgButton() and IsDlgButtonChecked() in pocket PC applications.

For investigation I started a new project using the pocket PC application wizard. I added a check box in main.rc and CheckDlgButton() in main.c.

From the linker I get the message "POLINK: error: Unresolved external symbol 'CheckDlgButton'".

Adding the user32.lib to the linker objects gave no solution.

CheckRadioButton() can be linked without link error, but IsDlgButtonChecked() is necessary for this way too.

Vers.: Pelles C 4.50.113.

Please give some help.
Title: Re: POLINK: error: Unresolved external symbol 'CheckDlgButton'
Post by: Pelle on April 15, 2008, 06:06:04 PM
In version 5.0 (beta), the following definitions are available for Windows CE (CheckDlgButton and IsDlgButtonChecked are not real exported functions like on desktop Windows):

Code: [Select]
__inline UINT WINAPI IsDlgButtonChecked(HWND hDlg, int nIDButton) {
    return SendDlgItemMessage((hDlg), (nIDButton), BM_GETCHECK, (WPARAM)0, (LPARAM)0);
}
Code: [Select]
__inline BOOL WINAPI CheckDlgButton(HWND hDlg, int nIDButton, UINT uCheck) {
    return SendDlgItemMessage((hDlg), (nIDButton), BM_SETCHECK, (WPARAM)uCheck, (LPARAM)0);

perhaps you can use this for now in 4.50...?
Title: Re: POLINK: error: Unresolved external symbol 'CheckDlgButton'
Post by: ks65 on April 15, 2008, 11:41:21 PM
Thanks Pelle!

Your posted code solves my problem (in vers. 4.50..).

Is an overview available which WinAPI-functions for desktop Windows are exported to WinCE?
Title: Re: POLINK: error: Unresolved external symbol 'CheckDlgButton'
Post by: Stefan Pendl on April 16, 2008, 12:45:50 PM
Is an overview available which WinAPI-functions for desktop Windows are exported to WinCE?
Make Microsoft MSDN (http://msdn2.microsoft.com/en-us/default.aspx) your friend, it is the source for WinAPI.
Title: Re: POLINK: error: Unresolved external symbol 'CheckDlgButton'
Post by: ks65 on April 16, 2008, 05:15:09 PM
Following Microsoft MSDN the functions IsDlgButtonChecked() and CheckDlgButton() are available under Windows Mobile. I checked this before my first post.