Tuesday, July 14, 2009
Windows Mobile 6.5 Gestures documented
The documentation for Windows Mobile 6.5 Gestures is now online here.
unresolved external symbol CLSID_ImagingFactory
Just started out a new sample project that illustrates how to use the WM libraries I'm writing, and got the following link errors:
1>wmfw.lib(Image.obj) : error LNK2001: unresolved external symbol CLSID_ImagingFactory
1>wmfw.lib(Image.obj) : error LNK2001: unresolved external symbol IID_IImagingFactory
This means that the linker cannot find the symbols CLSID_ImagingFactory and
IID_IImagingFactory, required to use the imaging library on Windows Mobile. If you look at the documentation, you will see that a link to the imaging.lib file is required but it will not work (at least it does not work for me).
The solution I found is to force the inclusion of these symbols using a dummy file that I usually name guids.cpp. Here's the content:
#include "stdafx.h"
#include <initguid.h>
#include <imgguids.h>
The initguid.h include redefines the DEFINE_GUID macro that is used by imgguids.h so that it declares a GUID along with its value instead of making an external reference to the same symbol.
Compile and link and the error goes away.
1>wmfw.lib(Image.obj) : error LNK2001: unresolved external symbol CLSID_ImagingFactory
1>wmfw.lib(Image.obj) : error LNK2001: unresolved external symbol IID_IImagingFactory
This means that the linker cannot find the symbols CLSID_ImagingFactory and
IID_IImagingFactory, required to use the imaging library on Windows Mobile. If you look at the documentation, you will see that a link to the imaging.lib file is required but it will not work (at least it does not work for me).
The solution I found is to force the inclusion of these symbols using a dummy file that I usually name guids.cpp. Here's the content:
#include "stdafx.h"
#include <initguid.h>
#include <imgguids.h>
The initguid.h include redefines the DEFINE_GUID macro that is used by imgguids.h so that it declares a GUID along with its value instead of making an external reference to the same symbol.
Compile and link and the error goes away.
Tuesday, May 19, 2009
WTL 8.1.9127 is out!
WTL 8.1.9127 is out since May 7 2009.
At firt look they added installation support for VS2008 (setup90.js).
Enjoy!
At firt look they added installation support for VS2008 (setup90.js).
Enjoy!
Thursday, October 9, 2008
Oriented Dialogs and SP platform
Some new SP devices supports screen rotation (ex: HTC S7xx series) but all 'CStdOrientedDialog' classes are only supported for PPC platform in WTL8.0.
So i changed some WTL files to add those classes to SP too.
The only file to change is: 'atlwince.h'
If you want support also in wizard you need to change also: 'AppType.htm' and 'Platforms.htm' in 'AppWizMobile\Files\HTML\1033' folder.
You can find the modified files here
Bye :)
So i changed some WTL files to add those classes to SP too.
The only file to change is: 'atlwince.h'
If you want support also in wizard you need to change also: 'AppType.htm' and 'Platforms.htm' in 'AppWizMobile\Files\HTML\1033' folder.
You can find the modified files here
Bye :)
Wednesday, October 1, 2008
CStdDialogImpl and the OK button
Are using CStdDialogImpl as the base class for your WTL dialogs? Are you having difficulty hiding the "ok" button? Here's a simple solution:
Derive your dialog class (say CMyDialog) from
CStdDialogImpl<CMyDialog, SHIDIF_SIZEDLGFULLSCREEN | SHIDIF_SIPDOWN>
On the OnInitDialog handler, call:
SHDoneButton(m_hWnd, SHDB_HIDE);
ModifyStyle(0, WS_NONAVDONEBUTTON, SWP_NOSIZE);
Make sure you change all the calls to CStdDialogImpl<CMyDialog> methods with the new base (you can use a typedef for that).
Derive your dialog class (say CMyDialog) from
CStdDialogImpl<CMyDialog, SHIDIF_SIZEDLGFULLSCREEN | SHIDIF_SIPDOWN>
On the OnInitDialog handler, call:
SHDoneButton(m_hWnd, SHDB_HIDE);
ModifyStyle(0, WS_NONAVDONEBUTTON, SWP_NOSIZE);
Make sure you change all the calls to CStdDialogImpl<CMyDialog> methods with the new base (you can use a typedef for that).
Tuesday, August 5, 2008
ClearType on a memory DC
I recently developed a small information browser application for Windows CE 5.0 devices. This small application uses a touch list as an item selector and displays an in-memory bitmap with textual information related to the selected item.
The touch list uses a ClearType-rendered font (see the latest Touch List sample) painted to a memory DC. I also used a ClearType font to paint the text on the memory bitmap containing the detailed information about the main list item. Unfortunately the font was not being rendered in ClearType mode. Why was this? Maybe a Windows CE issue?
After quickly recompiling the code to target a Windows Mobile 6.0 device, I got exactly the same result. So I turned to the rendering code looking for a bug, but found none. Instead I found an interesting difference between the touch list rendering and the bitmap rendering.
If you look at the touch list samples, you will see that the memory DC is created from a CPaintDC. On the bitmap rendering code, I was using a memory DC created from a CClientDC (got the same result by using NULL as the HDC value).
So apparently you can only render ClearType fonts to a memory DC when this is created as compatible with the DC you get on BeginPaint... Has anyone else experienced this?
The touch list uses a ClearType-rendered font (see the latest Touch List sample) painted to a memory DC. I also used a ClearType font to paint the text on the memory bitmap containing the detailed information about the main list item. Unfortunately the font was not being rendered in ClearType mode. Why was this? Maybe a Windows CE issue?
After quickly recompiling the code to target a Windows Mobile 6.0 device, I got exactly the same result. So I turned to the rendering code looking for a bug, but found none. Instead I found an interesting difference between the touch list rendering and the bitmap rendering.
If you look at the touch list samples, you will see that the memory DC is created from a CPaintDC. On the bitmap rendering code, I was using a memory DC created from a CClientDC (got the same result by using NULL as the HDC value).
So apparently you can only render ClearType fonts to a memory DC when this is created as compatible with the DC you get on BeginPaint... Has anyone else experienced this?
Monday, August 4, 2008
Windows Mobile API Usage Tool
Microsoft has just released a new tool to determine the Windowm Mobile API usage in your application. This is especially useful for deprecated functions! Go take a look here.
Subscribe to:
Posts (Atom)