On Fri, 2007-10-05 at 19:39 +0200, Jacek M. Holeczek wrote:
> Hi,
> thanks for your explanations.
> 
> > For now you can try whether it helps to add -DNOGDI to your compile
> 
> Well, this does not seem to help.
> Without "-DNOGDI", the code compiles fine, and I only get linker problem:
> "undefined reference to `ChangeDisplaySettingsExW'".

As Carsten already pointed out, some of the functions have inconsistent
names, I forgot about that when I replied. Sorry. Turns out that both
ShellExecuteEx and ChangeDisplaySettingsEx are available on CE without
the "W".

If you want to know what "inconsistent API" means, have a look at this :
dannypc: {427} fgrep ExW coredll.def | wc -l
26
dannypc: {428} fgrep Ex coredll.def | fgrep -v ExW | wc -l
85

Oh well. Back to your problem.
> As soon as I add "-DNOGDI", the compiler starts to complain about
> undeclared identifiers DeviceMode and DEVMODE, and about implicit
> declaration of function `ChangeDisplaySettingsEx' (it does not reach the
> linker stage).
> 
> Any idea?

Yes, drop that. Try the patches below.

Another thing I neglected to mention: I hope you are defining macros
that tell the compiler which version of CE you're using ?

I always use something like
        -D_WIN32_WCE=400 -D_WIN32_IE=400

dannypc: {420} svn diff winuser.h shellapi.h
Index: winuser.h
===================================================================
--- winuser.h   (revision 1061)
+++ winuser.h   (working copy)
@@ -3390,12 +3390,16 @@
 WINUSERAPI LRESULT WINAPI
CallWindowProcW(WNDPROC,HWND,UINT,WPARAM,LPARAM);
 WINUSERAPI WORD WINAPI CascadeWindows(HWND,UINT,LPCRECT,UINT,const
HWND*);
 WINUSERAPI BOOL WINAPI ChangeClipboardChain(HWND,HWND);
+#ifndef _WIN32_WCE
 #ifndef NOGDI
 WINUSERAPI LONG WINAPI ChangeDisplaySettingsA(PDEVMODEA,DWORD);
 WINUSERAPI LONG WINAPI ChangeDisplaySettingsW(PDEVMODEW,DWORD);
 WINUSERAPI LONG WINAPI
ChangeDisplaySettingsExA(LPCSTR,LPDEVMODEA,HWND,DWORD,LPVOID);
 WINUSERAPI LONG WINAPI
ChangeDisplaySettingsExW(LPCWSTR,LPDEVMODEW,HWND,DWORD,LPVOID);
 #endif
+#else /* _WIN32_WCE */
+WINUSERAPI LONG WINAPI
ChangeDisplaySettingsEx(LPCWSTR,LPDEVMODEW,HWND,DWORD,LPVOID);
+#endif
 WINUSERAPI BOOL WINAPI ChangeMenuA(HMENU,UINT,LPCSTR,UINT,UINT);
 WINUSERAPI BOOL WINAPI ChangeMenuW(HMENU,UINT,LPCWSTR,UINT,UINT);
 WINUSERAPI LPSTR WINAPI CharLowerA(LPSTR);
Index: shellapi.h
===================================================================
--- shellapi.h  (revision 1061)
+++ shellapi.h  (working copy)
@@ -297,10 +297,10 @@
 BOOL WINAPI Shell_NotifyIconW(DWORD,PNOTIFYICONDATAW);
 int WINAPI ShellAboutA(HWND,LPCSTR,LPCSTR,HICON);
 int WINAPI ShellAboutW(HWND,LPCWSTR,LPCWSTR,HICON);
+#ifndef _WIN32_WCE
 HINSTANCE WINAPI ShellExecuteA(HWND,LPCSTR,LPCSTR,LPCSTR,LPCSTR,INT);
 HINSTANCE WINAPI
ShellExecuteW(HWND,LPCWSTR,LPCWSTR,LPCWSTR,LPCWSTR,INT);
 BOOL WINAPI ShellExecuteExA(LPSHELLEXECUTEINFOA);
-#ifndef _WIN32_WCE
 BOOL WINAPI ShellExecuteExW(LPSHELLEXECUTEINFOW);
 #else
 BOOL WINAPI ShellExecuteEx(LPSHELLEXECUTEINFOW);
dannypc: {421} 

-- 
Danny Backx ; danny.backx - at - scarlet.be ; http://danny.backx.info

Attachment: signature.asc
Description: This is a digitally signed message part

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Cegcc-devel mailing list
Cegcc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cegcc-devel

Reply via email to