|
|
Home » Extra libraries, Code snippets, applications etc. » OS Problems etc., Win32, POSIX, MacOS, FreeBSD, X11 etc » Win_CE
Win_CE [message #10406] |
Fri, 06 July 2007 23:06  |
|
Code needs correction
add in Link in MSCBuilder
-NODEFAULTLIB:\"oldnames.lib\"
like :
if(HasFlag("MSC8ARM"))
link << " -subsystem:windowsce,4.20 /ARMPADCODE -NODEFAULTLIB:\"oldnames.lib\" ";
---------------------------------------------------
correct the line with GUI flag
adding || HasFlag("MSC8ARM")
if(HasFlag("GUI") || HasFlag("MSC8ARM"))
link << (HasFlag("WIN32") ? " -subsystem:windows" : " -subsystem:windowsce");
else
link << " -subsystem:console";
---------------------------------------------------
And I added protetic fix for Unicode only on WCE in Core/log.cpp
#if defined(PLATFORM_WIN32)
#if defined(PLATFORM_WINCE)
wchar_t pwcs[512];
mbstowcs(pwcs, backup, strlen(backup));
DeleteFile(pwcs);
#else
DeleteFile(backup);
#endif
#elif defined(PLATFORM_POSIX)
unlink(backup);
#else
#error
#endif
#if defined(PLATFORM_WIN32)
#if defined(PLATFORM_WINCE)
wchar_t wfilename[512];
mbstowcs(wfilename, filename, strlen(filename));
MoveFile(wfilename, pwcs);
#else
MoveFile(filename, backup);
#endif
#elif defined(PLATFORM_POSIX)
!rename(filename, backup);
#else
#error
#endif
---------------------------------------------------
And this one helps digging problems
Add after PutConsole("Linking...");
line PutConsole(link);
[Updated on: Fri, 06 July 2007 23:07] Report message to a moderator
|
|
|
Re: Win_CE [message #10408 is a reply to message #10406] |
Fri, 06 July 2007 23:36   |
|
Next part
Win32DnD.cpp
exclude from PPC CF_HDROP
like
#ifndef PLATFORM_WINCE
if(cf == CF_HDROP)
return "files";
#endif
correct
static int CF_PERFORMEDDROPEFFECT = RegisterClipboardFormat(_T("Performed DropEffect"));
Threads also dosn't compile on PoketPC
|
|
|
|
|
Re: Win_CE [message #10781 is a reply to message #10749] |
Sat, 28 July 2007 21:45   |
|
Some days ago i compiled one app but
Startup of this app was so long so i forget about testing it more.
It was a simple window app nothing more.
Propably i will use in the future Core(NTL, types) on PPC.
|
|
|
Re: Win_CE [message #10919 is a reply to message #10781] |
Sat, 04 August 2007 23:58   |
shalom
Messages: 4 Registered: August 2007 Location: Israel
|
Junior Member |
|
|
I don't know what compilers you people were using, and exactly what you managed to do.
I am using the Mingw32 version of cegcc (i.e. arm-wince-mingw32ce-gcc)
I tried to compile an example (using the IDE) - and I started with compilation errors 'cAlternateFileName not defined'. I added -DPLATFORM_WINCE to the compile options, and that went away.
This definition needs to be added automatically when WINCE is chosen as the platform.
Now I have
CtrlLib\RichTextView.cpp:458: error: 'PrinterJob' was not declared in this scope
I suggest that this function be #ifdef'ed out (and replaced with a stub) on WINCE.
Those are the only problems in the CtrlLib.
There are a few problems with the CtrlCore too.
In general - do these problems appear with other WinCE compilers?
Is anyone else using cegcc?
Any advice?
[Updated on: Sat, 04 August 2007 23:59] Report message to a moderator
|
|
|
Re: Win_CE [message #10920 is a reply to message #10406] |
Sun, 05 August 2007 03:33   |
shalom
Messages: 4 Registered: August 2007 Location: Israel
|
Junior Member |
|
|
Using the same compiler as above, I had to change the sDumpWindow function in Win32Wnd.cpp:
static BOOL CALLBACK sDumpWindow(HWND hwnd, LPARAM lParam) {
String dump;
dump << (IsWindowEnabled(hwnd) ? "ena" : "dis") << ' '
<< (IsWindowVisible(hwnd) ? "vis" : "hid") << ' '
<< Sprintf("owner=0x%x ", GetWindow(hwnd, GW_OWNER));
Ctrl *ctrl = Ctrl::CtrlFromHWND(hwnd);
if(ctrl) {
#ifdef _DEBUG
dump << "Ctrl: " << UPP::Name(ctrl);
#endif
}
else if(!lParam)
return TRUE;
else
{
#ifdef PLATFORM_WINCE
wchar clsname[256], title[1024];
#else
char clsname[256], title[1024];
#endif
::GetClassName(hwnd, clsname, __countof(clsname));
::GetWindowText(hwnd, title, __countof(title));
#ifdef PLATFORM_WINCE
WString wClsName = clsname;
WString wTitle = title;
dump << "HWND: " << Sprintf("0x%x", hwnd) << ", class = "
<< wClsName << ", title = " << wTitle;
#else
dump << "HWND: " << Sprintf("0x%x", hwnd) << ", class = "
<< clsname << ", title = " << title;
#endif
}
LLOG(dump);
return TRUE;
}
I added the second #ifdef. The
I am surprised you didn't have problems with this - as apparently there is no AsString for wchar * since the template version uses ToString, and wchar is a primitive type. There is also a non-template version for PLATFORM_MSC that calls FormatPtr - for some reason I couldn't seem to use this (since the compiler decides that the template version is closer for wchar *).
Now I have a small problem with the compiler itself - after that I think it will all compile correctly.
|
|
|
Re: Win_CE [message #10925 is a reply to message #10919] |
Sun, 05 August 2007 10:47   |
|
shalom wrote on Sat, 04 August 2007 23:58 | I don't know what compilers you people were using, and exactly what you managed to do.
I am using the Mingw32 version of cegcc (i.e. arm-wince-mingw32ce-gcc)
|
1. Microsoft (R) C/C++ Optimizing Compiler Version 14.00.60131 for ARM
2. Code generated by mingw for win32 can be 50 times slower than by other avaialbe compilers for win32(just try for example ntbench). So using mingwce for WinCe propably is mistake...
|
|
|
|
Re: Win_CE [message #10931 is a reply to message #10930] |
Sun, 05 August 2007 16:13   |
|
shalom wrote on Sun, 05 August 2007 15:27 | I have EVC++ 3 and 4
|
Propably evc4 sp4 is better choice than mingwce , hoever evc4 doesn't support full c++ standard and there could be problems for example with templates.
|
|
|
|
Re: Win_CE [message #10942 is a reply to message #10406] |
Mon, 06 August 2007 08:52  |
shalom
Messages: 4 Registered: August 2007 Location: Israel
|
Junior Member |
|
|
Since there is some interest, I will try to document what I have done in this thread.
Use of advapi32.lib etc: I added !GNU_ARM to the 'when' clause of that line in the various packages.
Running ranlib: This can be added to the custom build steps as 'post-link':
arm-wince-mingw32ce-ranlib.exe $(PATH)
The current problem is that I have undefined externals LocalLock and LocalUnlock (and a couple of others). These come mainly from the clipboard code in Win32Wnd.cpp.
There is no LocalLock/Unlock (at least up to CE 4.2) however the Microsoft documentation indicates that GetClipboardData returns a handle. I have never tried the clipboard functions in WinCE, so I don't know if the handle is really a pointer or not.
- Shalom Crown
|
|
|
Goto Forum:
Current Time: Wed May 14 22:16:21 CEST 2025
Total time taken to generate the page: 0.00958 seconds
|
|
|