Search

Asymmetric Map

Related Topics

News & Events

Asymmetric's New Site
Release of HWAccess v1.10

CDllSample Example

This section describes a typical structure used with the current libraries. It can be used by developers as a starting point for their work.

There are 4 main sections to examine for the members declared in the sample library:
1. CSampleInfo Class where the H/W information is retrieved and analyzed
2. CSampleDlg Class where all the configuration for the library takes place.
3. CActiveDlg Class where the DLL Dynamic GUI is integrated.
4. CSampleDll the root/interface class for this library.

Each item performs a set of functions. Briefly here, the CSampleInfo negotiates H/W information from the main application, performs calculations on the data acquired and stores the formatted data. The CSampleDlg class includes all the static configuration the user may change when the main configuration dialog is invoked within the main menu (via Tools-Options). The CActiveDlg class encapsulates all run-time controls to add/remove watches, acquire H/W information, display results of operations etc. These controls can be activated by the user theoretically at anytime. The CSampleDll class integrates the library interface with HWAccess. It receives and processes the main messages and commands send by the main application. The received information is then dispatched to the appropriate function of the library.

The common library interfaces with the CSampleDll class and receives/dispatches messages to HWAccess. There is a wait event for each message dispatched and the common library must wait for event signal before returning control back to the caller. This implies that a GUI thread should not dispatch requests to acquire information. Developers should create separate threads for calculations, and information retrieval.

Study the samples within the SDK and design your library carefully having in mind multi-threading development. Create error handlers for all critical functions and for all messages dispatched. The common library throws user exceptions in case of an error or program termination. Release handles and resources those may be allocated during separate processes.

 

(c) 2003-2004 ® . All rights Reserved.