As further trouble, I've started programming vb.net for 1 month.... I'm the
I'm programming my Navigation System... not a PocketPC... so, I can't update
CF 1.0 to v. 2.0.
I can't even update operative system... both are into Flash memory and I
wouldn't touch ti for keeping product warranty...
All I can do is... programming reasonably [VB.net 2003]+[CF1.0]+[WinCE5.0].
version of Visual Studio".
Ok... I've opened each file instead the project... code is C#... I haven't
found VB code.
I've searched for vb code... no source found!!!
I've searching for fontlist.dll... as you foreseen, it is available no more!
find the way to use Windows CE native functions... as I've said before...
> On Dec 14, 12:50 am, "Francesco Ranieri" <francesco.rani...@eng.it>
> wrote:
> > I've found this example... it could be usefull for me if it will run.
> > But an error occurs: MissingMethodException at FontList_Create()
> > Please help me!!
> >
> > ' YaoDurant.Drawing.FontCollection.vb - Font enumeration
> > ' wrapper class for FONTLIST.DLL.
> >
> > ' Code from _Programming the .NET Compact Framework with C#_
> > ' and _Programming the .NET Compact Framework with VB_
> > ' (c) Copyright 2002-2003 Paul Yao and David Durant.
> > ' All rights reserved.
> >
> > Imports System
> > Imports System.Collections
> > Imports System.Runtime.InteropServices
> >
> > Public Class clsFontCollection
> >
> > Private m_alFaceNames As ArrayList = New ArrayList
> >
> > ' P/Invoke declarations for fontlist.dll
> > <DllImport("fontlist.DLL")> _
> > Public Shared Function FontList_Create() As IntPtr
> > End Function
> >
> > [snip posted code]
> >
> > "Francesco Ranieri" <francesco.rani...@eng.it> ha scritto nel
messaggionews:Ou$jr7NPIHA.5264@TK2MSFTNGP02.phx.gbl...
> >
> > > Hi to all,
> > > I'm using CF 1.0 and VB.net 2003.
> >
> > > I wish to enumerate all the character fonts available into the system,
and
> > > the proper size of each one.
> > > The idea is to achieve something like this (pseudo-code):
> >
> > > Dim avilableFonts As Fonts
> > > Dim arraySizesOfThisFont() As Integer
> >
> > > For index=1 to avilableFonts.Count
> > > fontName = avilableFonts(index).name
> > > arrayOfSizesOfThisFont = avilableFonts(index).sizes.toArray()
> > > MyComboBoxFontList.add(fontName)
> > > MyComboBoxCurrentFontSize = arrayOfSizesOfThisFont
> > > Next
> >
> > > and, after selecting a font into first "MyComboBoxFontList", the
second
> > > "MyComboBoxCurrentFontSize" fills up with the character sizes of the
> > > selected font.
> >
> > > There's a way to do this?
> >
> > > Thanks in advance
> > > Francesco
>
> First, a friendly reminder that Google Is Your Friend (TM). A search
> of this newsgroup for "enumerate" and "font" turns up several relevant
> discussions, including one I posted back in March (
>
http://groups.google.com/group/microsoft.public.dotnet.framework.compactframework/browse_thread/thread/b8415fcc040204f8/a767eab055c88691
> ).
>
> As it happens, I'm familiar with the book the sample code came from.
> Several of their managed demo projects make use of native C++ helper
> DLLs. This one is looking for a file called "fontlist.dll". If you
> don't have that DLL included in your project, then there's no method
> to be found.
>
> I've got one piece of bad news and two pieces of good news for you.
> The bad news is that the sample code download page on their website is
> no longer working properly, so you can't get fontlist.dll from there.
> The good news is that I happen to have both the C# and VB sample
> archives stored away, and I've mirrored them on my website at
>
http://www.isquaredsoftware.com/code.php .
>
> The even better news is that since this question has come up a few
> times, and I haven't yet seen a definitive answer, I took some of my
> free time today and put together a sample that shows how to do this
> using 100% managed code. Note that this _does_ require CF 2.0. I've
> uploaded the sample ZIP as EnumFontFamiliesDemo.zip, also available
> from
http://www.isquaredsoftware.com/code.php .
>
> For future reference, and for the benefit of the search engines, I've
> put the code for Form1 at the bottom. All necessary structures have
> been declared in another file, based on the definitions in MSDN.
>
> Hope this helps!
>
> Mark Erikson
>
http://www.isquaredsoftware.com >
>
>
> using System;
> using System.Collections.Generic;
> using System.ComponentModel;
> using System.Data;
> using System.Drawing;
> using System.Text;
> using System.Windows.Forms;
> using System.Runtime.InteropServices;
> using FI = EnumFontFamiliesDemo.FontInformation;
>
> namespace EnumFontFamiliesDemo
> {
> // See description of EnumFontFamProc on MSDN
> delegate int EnumFontDelegate(IntPtr lpelfe, IntPtr lpntme, int
> FontType, int lParam);
>
> public partial class Form1 : Form
> {
> private List<string> fontNames;
> IntPtr fpEnumProc;
> EnumFontDelegate enumFontDelegate;
>
> [DllImport("coredll.dll")]
> private static extern int EnumFontFamilies(IntPtr hdc, string
> fontFamily, IntPtr lpEnumFontFamExProc, IntPtr lParam);
>
> [DllImport("coredll.dll")]
> private static extern IntPtr GetDesktopWindow();
>
> [DllImport("coredll.dll")]
> private static extern IntPtr GetDC(IntPtr hwnd);
>
> [DllImport("coredll.dll")]
> private static extern IntPtr ReleaseDC(IntPtr hdc);
>
> public Form1()
> {
> InitializeComponent();
>
> fontNames = new List<string>();
> }
>
> public int EnumFontFamiliesExProc(IntPtr lpelfe, IntPtr lpntme, int
> FontType, int lParam)
> {
> FI.LOGFONT logFont = (FI.LOGFONT)Marshal.PtrToStructure(lpelfe,
> typeof(FI.LOGFONT));
> fontNames.Add(logFont.lfFaceName);
>
> // Non-zero return continues enumerating
> return 1;
> }
>