Re: COM correct choice for my application?
From: Alexander Nickolov (agnickolov_at_mvps.org)
Date: 01/07/05
- Previous message: Prometheus: "Java Beans, VB.NET, ActiveX Bridge and a student's headache :("
- In reply to: David Johansson: "COM correct choice for my application?"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 7 Jan 2005 10:31:35 -0800
I supose you need three pieces here. A device driver communicates
with your hardware. An NT service exposes the programmatic
functionality (COM object is a perfect choice). And finally, a
tray icon application that starts when the user logs in provides
the user with GUI control to your service. Alternatively, you
can also have configuration application as a control panel applet
or an MMC plug-in. For the COM NT service, you'll probably
want to choose ATL as it offer specific support for hosting COM
objects in an NT service. Depending on your hardware's needs,
you may not need a driver and have all that code in the service
instead. Then your service must start automatically at boot time.
OTOH, if you have a separate driver, your API may also be
bundled in a DLL that talks to the driver. A service is only needed
if you accumulate and cache data not specific to any client (say
statistics), and this can be done by the driver if you have one.
However, if you don't have a driver, you do need a service as it
does not terminate with the last client. I outlined some ideas
here, analyze your needs and pick the right approach for your
particular case.
-- ===================================== Alexander Nickolov Microsoft MVP [VC], MCSD email: agnickolov@mvps.org MVP VC FAQ: http://www.mvps.org/vcfaq ===================================== "David Johansson" <DavidJohansson@discussions.microsoft.com> wrote in message news:DE9AB224-2C55-47A4-87E4-7B7878C5B1FA@microsoft.com... > Hi, > > I am trying to develop a simple application, but I am unsure of which > "technology" to use. From what I have read on the web, COM could be it, > and > that's why I post this question. If I explain the desired functionality, > maybe you could help me decide if COM is the correct way to go and how to > high-level design my application. > > The situation: > I am developing a custom piece of hardware that connects to the computer > via > IR. I now want to expose an interface to this hardware in Windows at > runtime, > i.e. a set of functions that any application could call without having > access > to my code at compile-time (just the interface I have defined). > > My requirements: > * My solution should allow any "standard" Windows programming language > (i.e., java, c/c++/c#, vb, delphi, etc..) to start up my hardware > interface > or get a handle to an existing interface (i.e. singleton behaviour) and > execute methods on it, as well as listen to its events (hardware > connected/disconnected etc) > * This should be possible without me writing custom interfaces for each > language > * My solution should expose an icon in the System Tray, which when > selected > displays a small set of menus in Windows, so that the user can monitor the > applications accessing the hardware > > In many ways, to me this looks just like a scaled-down version of what any > Microsoft Office application is capable of. For example, I can easily > start > an instance of Word which is running in a window on my computer, and then > write programs that interface with this document, e.g., adding words to > the > active document. > > How should I structure my application? Is a COM .exe server the correct > way > to go given my requirements, or is there a more appropriate or > "up-to-date" > way? How are Microsoft Office applications constructed in this aspect? > > Thanks in advance / regards, > David Johansson > Sweden
- Previous message: Prometheus: "Java Beans, VB.NET, ActiveX Bridge and a student's headache :("
- In reply to: David Johansson: "COM correct choice for my application?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|