Results 1 to 40 of 45

Thread: [RESOLVED] Create common event for array of controls

Threaded View

  1. #18
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    10,918

    Re: [RESOLVED] Create common event for array of controls

    Okay, I thought I'd try and replicate Trick's trick with the TextBox control. I was well on my way, but one stumbling block.

    I don't have C++ installed on my new machine, and I don't even have easy access to a CD drive at the moment.

    I'm going to post the IDL file for what I think will be the TextBox version. Someone setup for using MIDL and has C++ installed, if you could compile and then re-attach the resulting TLB, that would be greatly appreciated.

    Thanks,
    Elroy

    Hmmm, it keeps saying "Invalid File" on the attachment. Here's the source to it:

    Code:
    [
       uuid(67f122b6-92cb-4087-939c-ba518ced7c0c),
       helpstring("TextBoxes array events interface"),
    ]
    library chk_arr {
    
       importlib("stdole2.tlb");
       importlib("C:\Program Files (x86)\Microsoft Visual Studio\VB98\VB6.OLB");
       importlib("msvbvm60.dll\3");
       
       typedef float single;
    
    [
      odl,
      uuid(33AD4EE3-6699-11CF-B70C-00AA0060D393),
      helpstring("Displays information entered at design time by the user, or in code at run time."),
      helpcontext(0x000dfa32)
    ]
    interface TextBoxEvents_Array : IUnknown {
        [helpstring("Occurs when the contents of a control have changed."), helpcontext(0x000dfb4d)]
        HRESULT _stdcall Change();
        [helpstring("Occurs when a drag-and-drop operation is completed."), helpcontext(0x000dfb50)]
        HRESULT _stdcall DragDrop(
                        [in, out] Control** Source, 
                        [in, out] single* X, 
                        [in, out] single* Y);
        [helpstring("Occurs when a drag-and-drop operation is in progress."), helpcontext(0x000dfb51)]
        HRESULT _stdcall DragOver(
                        [in, out] Control** Source, 
                        [in, out] single* X, 
                        [in, out] single* Y, 
                        [in, out] short* State);
        [helpstring("Occurs when an object receives the focus."), helpcontext(0x000dfb53)]
        HRESULT _stdcall GotFocus();
        [helpstring("Occurs when the user presses a key while an object has the focus."), helpcontext(0x000dfb55)]
        HRESULT _stdcall KeyDown(
                        [in, out] short* KeyCode, 
                        [in, out] short* Shift);
        [helpstring("Occurs when the user presses and releases an ANSI key."), helpcontext(0x000dfb56)]
        HRESULT _stdcall KeyPress([in, out] short* KeyAscii);
        [helpstring("Occurs when the user releases a key while an object has the focus."), helpcontext(0x000dfb57)]
        HRESULT _stdcall KeyUp(
                        [in, out] short* KeyCode, 
                        [in, out] short* Shift);
        [helpstring("Occurs when a DDE conversation terminates."), helpcontext(0x000dfb58)]
        HRESULT _stdcall LinkClose();
        [helpstring("Occurs when there is an error during a DDE conversation."), helpcontext(0x000dfb59)]
        HRESULT _stdcall LinkError([in, out] short* LinkErr);
        [helpstring("Occurs when a DDE conversation is being initiated."), helpcontext(0x000dfb5c)]
        HRESULT _stdcall LinkOpen([in, out] short* Cancel);
        [helpstring("Occurs when an object loses the focus."), helpcontext(0x000dfb5e)]
        HRESULT _stdcall LostFocus();
        [helpstring("Occurs when the source has changed the DDE data if the LinkMode property of the destination control is Notify."), helpcontext(0x000dfb5b)]
        HRESULT _stdcall LinkNotify();
        [helpstring("Occurs when the user presses the mouse button while an object has the focus."), helpcontext(0x000dfb5f)]
        HRESULT _stdcall MouseDown(
                        [in, out] short* Button, 
                        [in, out] short* Shift, 
                        [in, out] single* X, 
                        [in, out] single* Y);
        [helpstring("Occurs when the user moves the mouse."), helpcontext(0x000dfb60)]
        HRESULT _stdcall MouseMove(
                        [in, out] short* Button, 
                        [in, out] short* Shift, 
                        [in, out] single* X, 
                        [in, out] single* Y);
        [helpstring("Occurs when the user releases the mouse button while an object has the focus."), helpcontext(0x000dfb61)]
        HRESULT _stdcall MouseUp(
                        [in, out] short* Button, 
                        [in, out] short* Shift, 
                        [in, out] single* X, 
                        [in, out] single* Y);
        [helpstring("Occurs when the user presses and then releases a mouse button over an object."), helpcontext(0x000dfb4e)]
        HRESULT _stdcall Click();
        [helpstring("Occurs when the user presses and releases a mouse button and then presses and releases it again over an object."), helpcontext(0x000dfb4f)]
        HRESULT _stdcall DblClick();
        [helpstring("Occurs when the mouse is moved over the control during an OLE drag/drop operation, if its OLEDropMode property is set to manual."), helpcontext(0x000dfb76)]
        HRESULT _stdcall OLEDragOver(
                        [in, out] DataObject** Data, 
                        [in, out] long* Effect, 
                        [in, out] short* Button, 
                        [in, out] short* Shift, 
                        [in, out] single* X, 
                        [in, out] single* Y, 
                        [in, out] short* State);
        [helpstring("Occurs when data is dropped onto the control via an OLE drag/drop operation, and OLEDropMode is set to manual."), helpcontext(0x000dfb77)]
        HRESULT _stdcall OLEDragDrop(
                        [in, out] DataObject** Data, 
                        [in, out] long* Effect, 
                        [in, out] short* Button, 
                        [in, out] short* Shift, 
                        [in, out] single* X, 
                        [in, out] single* Y);
        [helpstring("Occurs at the source control of an OLE drag/drop operation when the mouse cursor needs to be changed."), helpcontext(0x000dfb78)]
        HRESULT _stdcall OLEGiveFeedback(
                        [in, out] long* Effect, 
                        [in, out] VARIANT_BOOL* DefaultCursors);
        [helpstring("Occurs when an OLE drag/drop operation is initiated either manually or automatically."), helpcontext(0x000dfb79)]
        HRESULT _stdcall OLEStartDrag(
                        [in, out] DataObject** Data, 
                        [in, out] long* AllowedEffects);
        [helpstring("Occurs at the OLE drag/drop source control when the drop target requests data that was not provided to the DataObject during the OLEDragStart event."), helpcontext(0x000dfb7a)]
        HRESULT _stdcall OLESetData(
                        [in, out] DataObject** Data, 
                        [in, out] short* DataFormat);
        [helpstring("Occurs at the OLE drag/drop source control after a manual or automatic drag/drop has been completed or canceled."), helpcontext(0x000dfb7b)]
        HRESULT _stdcall OLECompleteDrag([in, out] long* Effect);
        [helpstring("Occurs when a control loses focus to a control that causes validation."), helpcontext(0x000dfb87)]
        HRESULT _stdcall Validate([in, out] VARIANT_BOOL* Cancel);
    };
    }
    I had it named "textbox_arr.idl", and was hoping for a "textbox_arr.tlb" file.
    Last edited by Elroy; Jul 5th, 2017 at 03:04 PM.
    Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width