Version: |
1.2 |
Description: |
Registers an external window with Visual CADD™, thus enabling messages to be sent back to the application when the specified events have occurred. Retained for backward compatibility; you should use VCSetAlertAppEx instead as it has, now and in the future, expanded messaging capabilities. |
Declaration: |
|
C/C++ |
extern "C" void WINAPI VCSetAlertApp(short* iError, HWND hWnd, short iCode); |
Delphi |
procedure VCSetAlertApp(var iError: Smallint; hWnd: Smallint; iCode: Smallint); stdcall; |
ActiveX/COM |
Sub SetAlertApp(ByVal hWnd As Long, ByVal iCode As Integer) |
Parameters: |
hWnd - the window handle of the
object which will receive the messages from Visual CADD™. |
Notes: |
To initialize Windows messaging between Visual CADD™ and an external application, the hWnd of some control or object must be sent to Visual CADD™ using VCSetAlertApp. When registering the hWnd a code must also be included which specifies which messages an application will receive. These can be added together to get multiple messages. For example iCode of 12 would specify that the command line characters and abort messages would be sent. To handle these messages, an application code must have code specifically to handle a Windows message sent to the control whose hWnd is registered with VCSetAlertApp. In Visual BASIC, this is handled by supplying code in the mousedown event for the control specified for each mouse down message sent by Visual CADD™. Visual CADD™ is fairly intelligent about when to send this message and only send the message when a drawing point has been selected. This means that the user can issue snaps or use tracking without invoking the application code for the mousedown event. To retrieve the point the user selected in the drawing area, use VCGetUserToolLBDown which sets a Point2D of the last point picked. When trapping the user input, register the control with an iCode of either 0 (all messages) or 8 and add code to the control for keypress. When the keypress code is activated by the message from Visual CADD™, use VCGetCmdStr to retrieve the last keypress from Visual CADD™. Once the keypress has been determined through code can act according to process the information or send it back for Visual CADD™ to use with VCSetCmdStr. Once the application has completed with the messaging, use VCClearAlertApp to remove an application from the messaging registry. |
See Also: |
VCClearAlertApp, VCGetUserToolLBDown, VCGetCmdStr, VCClearAlertAppDll, VCSetAlertAppDllEx, SetAlertEvent, VCSetAlertAppDll, |