PC Review


Reply
Thread Tools Rate Thread

cf app for any device - how to develop?

 
 
Matteo Cima
Guest
Posts: n/a
 
      9th Mar 2004
Hi,
my application will run on very different devices,
everyone has its own .dll provided by its very own sdk... to access
bluetooth, print, use coms, activate barcode, leds... and so on.
Unfortunately the great opennetcf's sdf is not enough mature to supply all
these with my devices.

The best approach is to build a wrapper dll that calls the correct functions
depending on the device (i can provide the type of device via a settings
file, so i don't have the problem to probe exactly on which device i'm
running on).

what should i do?
solution a: more .dlls (one for each device type)
solution b: different .dlls but named with the same name on device

and then, how can i keep everything in the same vs2003 solution? Or what?

Matteo Cima
Senior Developer, Mobile Expert, Project Manager, Lead Analyst,
Digisoft srl Italy
mdm.listISTHENAME and digisoft.itISTHESERVER


 
Reply With Quote
 
 
 
 
Ginny Caughey [MVP]
Guest
Posts: n/a
 
      9th Mar 2004
Matteo,

I'm sure there's an appropriate design pattern for this type of situation.
Basically I think you want separate classes for the different devices but a
common class used by the rest of your app that hides these details by
instantiating the right sort of object based on the settings in your
configuration file. If you program in the rest of your app against an
interface that is implemented by all the different device classes, that
would probably be the simplest way to go while still allowing you to have
all your code in one project.
--
Ginny Caughey
..Net Compact Framework MVP

"Matteo Cima" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Hi,
> my application will run on very different devices,
> everyone has its own .dll provided by its very own sdk... to access
> bluetooth, print, use coms, activate barcode, leds... and so on.
> Unfortunately the great opennetcf's sdf is not enough mature to supply all
> these with my devices.
>
> The best approach is to build a wrapper dll that calls the correct

functions
> depending on the device (i can provide the type of device via a settings
> file, so i don't have the problem to probe exactly on which device i'm
> running on).
>
> what should i do?
> solution a: more .dlls (one for each device type)
> solution b: different .dlls but named with the same name on device
>
> and then, how can i keep everything in the same vs2003 solution? Or what?
>
> Matteo Cima
> Senior Developer, Mobile Expert, Project Manager, Lead Analyst,
> Digisoft srl Italy
> mdm.listISTHENAME and digisoft.itISTHESERVER
>
>



 
Reply With Quote
 
Chris Tacke, eMVP
Guest
Posts: n/a
 
      9th Mar 2004
Personally I'd build a single DLL that supported all the devices. Have
classes that wrap the feature you're after and that check the device at
run-time in the object constructor to see if it's a supported device.

I'm also a bit surprised that you consider the SDF as "not mature enough"
yet you think that starting from zero will get you there faster. Why not
start with the SDF and add and/or test what you need?

--
Chris Tacke, eMVP
Co-Founder and Advisory Board Member
www.OpenNETCF.org
---
Windows CE Product Manager
Applied Data Systems
www.applieddata.net


"Matteo Cima" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Hi,
> my application will run on very different devices,
> everyone has its own .dll provided by its very own sdk... to access
> bluetooth, print, use coms, activate barcode, leds... and so on.
> Unfortunately the great opennetcf's sdf is not enough mature to supply all
> these with my devices.
>
> The best approach is to build a wrapper dll that calls the correct

functions
> depending on the device (i can provide the type of device via a settings
> file, so i don't have the problem to probe exactly on which device i'm
> running on).
>
> what should i do?
> solution a: more .dlls (one for each device type)
> solution b: different .dlls but named with the same name on device
>
> and then, how can i keep everything in the same vs2003 solution? Or what?
>
> Matteo Cima
> Senior Developer, Mobile Expert, Project Manager, Lead Analyst,
> Digisoft srl Italy
> mdm.listISTHENAME and digisoft.itISTHESERVER
>
>



 
Reply With Quote
 
Matteo Cima
Guest
Posts: n/a
 
      9th Mar 2004
Sorry, I didn't mean to offend you... i wrote that part quickly and didn't
mean that!
I need to p/invoke custom dlls, so the sdf as it is it's not an already
ready solution (for me)
of course i will add in it what i need, i love the way it works.
adding support for every device i am gonna use it's a pain in the a..
but right now i don't see any other solution...
i'll let you know if i end up with something interesting!

Matteo Cima



"Chris Tacke, eMVP" <(E-Mail Removed)> ha scritto nel messaggio
news:%23oDND%(E-Mail Removed)...
> Personally I'd build a single DLL that supported all the devices. Have
> classes that wrap the feature you're after and that check the device at
> run-time in the object constructor to see if it's a supported device.
>
> I'm also a bit surprised that you consider the SDF as "not mature enough"
> yet you think that starting from zero will get you there faster. Why not
> start with the SDF and add and/or test what you need?
>
> --
> Chris Tacke, eMVP
> Co-Founder and Advisory Board Member
> www.OpenNETCF.org
> ---
> Windows CE Product Manager
> Applied Data Systems
> www.applieddata.net
>
>
> "Matteo Cima" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
> > Hi,
> > my application will run on very different devices,
> > everyone has its own .dll provided by its very own sdk... to access
> > bluetooth, print, use coms, activate barcode, leds... and so on.
> > Unfortunately the great opennetcf's sdf is not enough mature to supply

all
> > these with my devices.
> >
> > The best approach is to build a wrapper dll that calls the correct

> functions
> > depending on the device (i can provide the type of device via a settings
> > file, so i don't have the problem to probe exactly on which device i'm
> > running on).
> >
> > what should i do?
> > solution a: more .dlls (one for each device type)
> > solution b: different .dlls but named with the same name on device
> >
> > and then, how can i keep everything in the same vs2003 solution? Or

what?
> >
> > Matteo Cima
> > Senior Developer, Mobile Expert, Project Manager, Lead Analyst,
> > Digisoft srl Italy
> > mdm.listISTHENAME and digisoft.itISTHESERVER
> >
> >

>
>



 
Reply With Quote
 
Chris Tacke, eMVP
Guest
Posts: n/a
 
      9th Mar 2004
No argument - it sounds like a pain, but I don't see any way around it
either. The lack of standardization on components is never a good thing.

--
Chris Tacke, eMVP
Co-Founder and Advisory Board Member
www.OpenNETCF.org
---
Windows CE Product Manager
Applied Data Systems
www.applieddata.net


"Matteo Cima" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Sorry, I didn't mean to offend you... i wrote that part quickly and didn't
> mean that!
> I need to p/invoke custom dlls, so the sdf as it is it's not an already
> ready solution (for me)
> of course i will add in it what i need, i love the way it works.
> adding support for every device i am gonna use it's a pain in the a..
> but right now i don't see any other solution...
> i'll let you know if i end up with something interesting!
>
> Matteo Cima
>
>
>
> "Chris Tacke, eMVP" <(E-Mail Removed)> ha scritto nel

messaggio
> news:%23oDND%(E-Mail Removed)...
> > Personally I'd build a single DLL that supported all the devices. Have
> > classes that wrap the feature you're after and that check the device at
> > run-time in the object constructor to see if it's a supported device.
> >
> > I'm also a bit surprised that you consider the SDF as "not mature

enough"
> > yet you think that starting from zero will get you there faster. Why

not
> > start with the SDF and add and/or test what you need?
> >
> > --
> > Chris Tacke, eMVP
> > Co-Founder and Advisory Board Member
> > www.OpenNETCF.org
> > ---
> > Windows CE Product Manager
> > Applied Data Systems
> > www.applieddata.net
> >
> >
> > "Matteo Cima" <(E-Mail Removed)> wrote in message
> > news:%(E-Mail Removed)...
> > > Hi,
> > > my application will run on very different devices,
> > > everyone has its own .dll provided by its very own sdk... to access
> > > bluetooth, print, use coms, activate barcode, leds... and so on.
> > > Unfortunately the great opennetcf's sdf is not enough mature to supply

> all
> > > these with my devices.
> > >
> > > The best approach is to build a wrapper dll that calls the correct

> > functions
> > > depending on the device (i can provide the type of device via a

settings
> > > file, so i don't have the problem to probe exactly on which device i'm
> > > running on).
> > >
> > > what should i do?
> > > solution a: more .dlls (one for each device type)
> > > solution b: different .dlls but named with the same name on device
> > >
> > > and then, how can i keep everything in the same vs2003 solution? Or

> what?
> > >
> > > Matteo Cima
> > > Senior Developer, Mobile Expert, Project Manager, Lead Analyst,
> > > Digisoft srl Italy
> > > mdm.listISTHENAME and digisoft.itISTHESERVER
> > >
> > >

> >
> >

>
>



 
Reply With Quote
 
Lloyd Dupont
Guest
Posts: n/a
 
      9th Mar 2004
I'm not sure in your case, is it a standart win32 function you want to call
or are they different on each device ?

anyway in my case I write interop code which work on both the device and the
desktop this way:

public class WinAPI
{
public const string GDI32 = "GDI32";
public const string USER32 = "USER32";
public const string KERNEL32 = "KERNEL32";
public const string CORECE = "coredll";

public static bool IsDevice
{
get
{
return IsDevice = Environment.OSVersion.Platform ==
PlatformID.WinCE;
}
}

[DllImport(USER32, EntryPoint="GetDC", SetLastError=true)]
static extern IntPtr GetDC_D(IntPtr hWnd);
[DllImport(CORECE, EntryPoint="GetDC", SetLastError=true)]
static extern IntPtr GetDC_P(IntPtr hWnd);
public static IntPtr GetDC(IntPtr hWnd)
{
if(IsDevice)
return GetDC_P(hWnd);
else
return GetDC_D(hWnd);
}
}

"Matteo Cima" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Hi,
> my application will run on very different devices,
> everyone has its own .dll provided by its very own sdk... to access
> bluetooth, print, use coms, activate barcode, leds... and so on.
> Unfortunately the great opennetcf's sdf is not enough mature to supply all
> these with my devices.
>
> The best approach is to build a wrapper dll that calls the correct

functions
> depending on the device (i can provide the type of device via a settings
> file, so i don't have the problem to probe exactly on which device i'm
> running on).
>
> what should i do?
> solution a: more .dlls (one for each device type)
> solution b: different .dlls but named with the same name on device
>
> and then, how can i keep everything in the same vs2003 solution? Or what?
>
> Matteo Cima
> Senior Developer, Mobile Expert, Project Manager, Lead Analyst,
> Digisoft srl Italy
> mdm.listISTHENAME and digisoft.itISTHESERVER
>
>



 
Reply With Quote
 
Matteo Cima
Guest
Posts: n/a
 
      10th Mar 2004
Thank you for you reply,
i need to use different devices and every device has its own "way" to
provide functions...
e.g. for barcode:
- Intermec700, has a laser barcode reader and intermec provides its .net
sdk, within intermec namespace
- hhp9500, has a ccd barcode reader and (afaik) has evc4 dll i can
p/invoke...
and others...
i don't want to add support to every device inside my app, but i want to
provide some sort of standardization in a way that i can call the barcode
function in just one way, and then my component takes care on how to
interact with the device...

I like the way you implemented it, thanks!

Matteo.


"Lloyd Dupont" <net.galador@ld> ha scritto nel messaggio
news:%(E-Mail Removed)...
> I'm not sure in your case, is it a standart win32 function you want to

call
> or are they different on each device ?
>
> anyway in my case I write interop code which work on both the device and

the
> desktop this way:
>
> public class WinAPI
> {
> public const string GDI32 = "GDI32";
> public const string USER32 = "USER32";
> public const string KERNEL32 = "KERNEL32";
> public const string CORECE = "coredll";
>
> public static bool IsDevice
> {
> get
> {
> return IsDevice = Environment.OSVersion.Platform ==
> PlatformID.WinCE;
> }
> }
>
> [DllImport(USER32, EntryPoint="GetDC", SetLastError=true)]
> static extern IntPtr GetDC_D(IntPtr hWnd);
> [DllImport(CORECE, EntryPoint="GetDC", SetLastError=true)]
> static extern IntPtr GetDC_P(IntPtr hWnd);
> public static IntPtr GetDC(IntPtr hWnd)
> {
> if(IsDevice)
> return GetDC_P(hWnd);
> else
> return GetDC_D(hWnd);
> }
> }
>
> "Matteo Cima" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
> > Hi,
> > my application will run on very different devices,
> > everyone has its own .dll provided by its very own sdk... to access
> > bluetooth, print, use coms, activate barcode, leds... and so on.
> > Unfortunately the great opennetcf's sdf is not enough mature to supply

all
> > these with my devices.
> >
> > The best approach is to build a wrapper dll that calls the correct

> functions
> > depending on the device (i can provide the type of device via a settings
> > file, so i don't have the problem to probe exactly on which device i'm
> > running on).
> >
> > what should i do?
> > solution a: more .dlls (one for each device type)
> > solution b: different .dlls but named with the same name on device
> >
> > and then, how can i keep everything in the same vs2003 solution? Or

what?
> >
> > Matteo Cima
> > Senior Developer, Mobile Expert, Project Manager, Lead Analyst,
> > Digisoft srl Italy
> > mdm.listISTHENAME and digisoft.itISTHESERVER
> >
> >

>
>



 
Reply With Quote
 
Ronald
Guest
Posts: n/a
 
      10th Mar 2004
Most unlikely you will find a unified BarcodeReader class for all the
devices with a barcode scanner.
Just curious, I know how the Intermec.DataCollection.BarcodeReader class
works, but how does Symbols' work? or for that matter, all the other .NET
implementations?

Ronald.
 
Reply With Quote
 
Matteo Cima
Guest
Posts: n/a
 
      10th Mar 2004
But e.g. for barcode,
let's say that for a device (intermec700) i have a .net sdk and so i have to
reference it, and then wrap into sdf,
and i have another device that exposes me barcode functionality via
p/invoke...
and maybe another device with .net sdk...

ok, matteo, we got it, get to the point!

do i have to reference everything, so everything is copied on every
device... so i'll have intermec dlls installed on hhp handheld... and so
on...
is this true?

and the declaration of p/invokes won't be correct on intermec (the one with
..net sdk) ...

what a mess!

Matteo.





"Chris Tacke, eMVP" <(E-Mail Removed)> ha scritto nel messaggio
news:(E-Mail Removed)...
> No argument - it sounds like a pain, but I don't see any way around it
> either. The lack of standardization on components is never a good thing.
>
> --
> Chris Tacke, eMVP
> Co-Founder and Advisory Board Member
> www.OpenNETCF.org
> ---
> Windows CE Product Manager
> Applied Data Systems
> www.applieddata.net
>
>
> "Matteo Cima" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Sorry, I didn't mean to offend you... i wrote that part quickly and

didn't
> > mean that!
> > I need to p/invoke custom dlls, so the sdf as it is it's not an already
> > ready solution (for me)
> > of course i will add in it what i need, i love the way it works.
> > adding support for every device i am gonna use it's a pain in the a..
> > but right now i don't see any other solution...
> > i'll let you know if i end up with something interesting!
> >
> > Matteo Cima
> >
> >
> >
> > "Chris Tacke, eMVP" <(E-Mail Removed)> ha scritto nel

> messaggio
> > news:%23oDND%(E-Mail Removed)...
> > > Personally I'd build a single DLL that supported all the devices.

Have
> > > classes that wrap the feature you're after and that check the device

at
> > > run-time in the object constructor to see if it's a supported device.
> > >
> > > I'm also a bit surprised that you consider the SDF as "not mature

> enough"
> > > yet you think that starting from zero will get you there faster. Why

> not
> > > start with the SDF and add and/or test what you need?
> > >
> > > --
> > > Chris Tacke, eMVP
> > > Co-Founder and Advisory Board Member
> > > www.OpenNETCF.org
> > > ---
> > > Windows CE Product Manager
> > > Applied Data Systems
> > > www.applieddata.net
> > >
> > >
> > > "Matteo Cima" <(E-Mail Removed)> wrote in message
> > > news:%(E-Mail Removed)...
> > > > Hi,
> > > > my application will run on very different devices,
> > > > everyone has its own .dll provided by its very own sdk... to access
> > > > bluetooth, print, use coms, activate barcode, leds... and so on.
> > > > Unfortunately the great opennetcf's sdf is not enough mature to

supply
> > all
> > > > these with my devices.
> > > >
> > > > The best approach is to build a wrapper dll that calls the correct
> > > functions
> > > > depending on the device (i can provide the type of device via a

> settings
> > > > file, so i don't have the problem to probe exactly on which device

i'm
> > > > running on).
> > > >
> > > > what should i do?
> > > > solution a: more .dlls (one for each device type)
> > > > solution b: different .dlls but named with the same name on device
> > > >
> > > > and then, how can i keep everything in the same vs2003 solution? Or

> > what?
> > > >
> > > > Matteo Cima
> > > > Senior Developer, Mobile Expert, Project Manager, Lead Analyst,
> > > > Digisoft srl Italy
> > > > mdm.listISTHENAME and digisoft.itISTHESERVER
> > > >
> > > >
> > >
> > >

> >
> >

>
>



 
Reply With Quote
 
Ginny Caughey [MVP]
Guest
Posts: n/a
 
      10th Mar 2004
Robert,

Symbol's .Net wrapper for barcode reading wrapper uses a Barcode.Reader
class, which internally uses a ReaderData class to manage the different
types of barcode data. You set up a delegate to handle read events and then
enable the Reader. That's an oversimplification, but you get the idea. You
can choose to handle Read events however you want, but I choose to handle
Read events at the form level so users can read a barcode no matter which
control has focus. I believe that other implementations barcode readers are
different though, so I'm also curious as to all the different flavors out
there.
--
Ginny Caughey
..Net Compact Framework MVP

"Ronald" <(E-Mail Removed)> wrote in message
news:lRF3c.83880$(E-Mail Removed)...
> Most unlikely you will find a unified BarcodeReader class for all the
> devices with a barcode scanner.
> Just curious, I know how the Intermec.DataCollection.BarcodeReader class
> works, but how does Symbols' work? or for that matter, all the other .NET
> implementations?
>
> Ronald.



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to develop .net application on MC70 Device visalavats@aztecsoft.com Microsoft Dot NET Compact Framework 2 10th Oct 2007 01:50 PM
Device manager Unknown Device & PCI Device (yellow warning) Alora Duncan Windows XP Hardware 1 2nd Feb 2004 05:52 PM
Device manager Unknown Device & PCI Device (yellow warning) Alora Duncan Microsoft Windows 2000 1 2nd Feb 2004 05:52 PM
Device manager Unknown Device & PCI Device (yellow warning) Alora Duncan Microsoft Windows 2000 Upgrade 1 2nd Feb 2004 05:52 PM
Device manager Unknown Device & PCI Device (yellow warning) Alora Duncan Microsoft Windows 2000 Hardware 1 2nd Feb 2004 05:52 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:25 PM.