Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.vc.atl
external usenet poster
 
Posts: 2
Default SpinButton control spins forever when calling COM function from Excel

I have a SpinButton control on an Excel 2002 spreadsheet. On the
SpinButton1_SpinDown() function I call a ATL COM server method which
just sleeps for 200 milliseconds and then returns. When I hold the
mouse button on the down button( for a few seconds) and then release
it, the SpinButton control keeps the down button depressed and keeps
calling the SpinButton_SpinDown function for ever, i.e it is still
calling the SpinDown function long after i have released the mouse
button. The Spreadsheet will not accept any other commands, and the
only way I can get control back to the spreadsheet is by hitting the
escape button to break the code, or moving another window infront of
the excel application.

The Excel code is

Dim SCS As SimpleCOMServerLib.CSpinButtonOperation

Private Sub SpinButton1_SpinDown()
If SCS Is Nothing Then
Set SCS = CreateObject("SimpleCOMServer.CSpinButtonOperation ")
End If

SCS.DoSpinOperation
end Sub

The CSpinButtonOperation exe is an Apartment threaded ATL COM exe. The
DoSpinOperation funtion is

STDMETHODIMP CCSpinButtonOperation::DoSpinOperation()
{
Sleep(200);
return S_OK;
}

Is there some rules with the SpinButton you need to follow so it
doesn't loop infinitly.
I notice that when using the up and down keys to tick down, the loop
doesn't happen. Its only when I hold down the mouse button

Any help is greatly appreciated

Cheers
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy-Paste function takes forever DONALD Excel Discussion (Misc queries) 0 July 21st 09 05:03 PM
calling a new function Excel gives me #NAME? Mark Dvorkin Excel Worksheet Functions 4 July 10th 05 01:29 AM
SpinButton control loops infinitly when calling a ATL COM server [email protected] Excel Programming 0 March 16th 05 05:43 PM
SpinButton control and focus Matt Dalkie Excel Programming 2 September 14th 04 02:36 PM
Keep userform visible, but return control to calling routine Ryan Poth[_2_] Excel Programming 0 August 21st 03 05:28 AM


All times are GMT +1. The time now is 06:15 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"