LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.vc.atl
external usenet poster
 
Posts: 2
Default SpinButton control loops infinitly when calling a ATL COM server

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

 
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
Excel 2003 Error Cannot Locate the Internet Server or Proxy Server Seabee Excel Discussion (Misc queries) 0 November 20th 05 12:03 AM
problem updating link from Novell server to windows server #REF er Ellen Excel Discussion (Misc queries) 0 May 10th 05 09:18 PM
SpinButton control and focus Matt Dalkie Excel Programming 2 September 14th 04 02:36 PM
calling a stored procedure on MS SQL Server within MS Excel 2000 Witold Domienik Excel Programming 0 March 2nd 04 10:47 AM
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:45 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"