SaveBarState fails when it is called from a thread

Hi,

In my application, I use SaveBarState() for persisting control bar
state.
The code fragment is something like this.

void CMainFrame::OnSavePersistance()
{
	SaveBarState(_T("My Persistence"));
       // Saves some information to an xml file
}

Since my xml saving takes some time I changed the code to execute in a
thread

UINT ThreadFn(LPVOID pParam)
{
	CMainFrame* pThis = (CMainFrame*)pParam;
	pThis->SaveBarState(_T("My Persistence"));

	return 0;
}

void CMainFrame::OnCntrlbartst()
{
	AfxBeginThread( ThreadFn, this );
}

But, now in the thread function SaveBarState() fails. It shows some
assertion in debug version. I think it is due to some mismatch in
MODULE_STATE.

statck trace for assert
CWnd::AssertValid() line 879 + 25 bytes
CControlBar::AssertValid() line 976
CStatusBar::AssertValid() line 732
AfxAssertValidObject(const CObject * 0x00431510 {CStatusBar
hWnd=0x00180c7e}, const char * 0x5f4ccfe8 THIS_FILE, int 531) line 108
CControlBar::GetBarInfo(CControlBarInfo * 0x00433d70) line 534
CFrameWnd::GetDockState(CDockState & {CDockState}) line 520
CFrameWnd::SaveBarState(const char * 0x0041844c `string') line 443
ThreadFn(void * 0x00431450) line 174


How can I avoid this problem.



0
faisalm83 (35)
7/9/2008 8:39:50 AM
vc.mfc 33608 articles. 0 followers. Follow

4 Replies
425 Views

Similar Articles

[PageSpeed] 37

The answer is simple: don't do that.  It is not supported, and it won't work.  You cannot
manipulate a window safely from a thread other than its owner, so it is no surprise when a
method that involves windows fails when invoked from some other thread.  This is expected,
and you should not under any circumstances be manipulating any aspect of a window from a
secondary thread.
				joe

On Wed, 9 Jul 2008 01:39:50 -0700 (PDT), Faisal <faisalm83@gmail.com> wrote:

>Hi,
>
>In my application, I use SaveBarState() for persisting control bar
>state.
>The code fragment is something like this.
>
>void CMainFrame::OnSavePersistance()
>{
>	SaveBarState(_T("My Persistence"));
>       // Saves some information to an xml file
>}
>
>Since my xml saving takes some time I changed the code to execute in a
>thread
>
>UINT ThreadFn(LPVOID pParam)
>{
>	CMainFrame* pThis = (CMainFrame*)pParam;
>	pThis->SaveBarState(_T("My Persistence"));
>
>	return 0;
>}
>
>void CMainFrame::OnCntrlbartst()
>{
>	AfxBeginThread( ThreadFn, this );
>}
>
>But, now in the thread function SaveBarState() fails. It shows some
>assertion in debug version. I think it is due to some mismatch in
>MODULE_STATE.
>
>statck trace for assert
>CWnd::AssertValid() line 879 + 25 bytes
>CControlBar::AssertValid() line 976
>CStatusBar::AssertValid() line 732
>AfxAssertValidObject(const CObject * 0x00431510 {CStatusBar
>hWnd=0x00180c7e}, const char * 0x5f4ccfe8 THIS_FILE, int 531) line 108
>CControlBar::GetBarInfo(CControlBarInfo * 0x00433d70) line 534
>CFrameWnd::GetDockState(CDockState & {CDockState}) line 520
>CFrameWnd::SaveBarState(const char * 0x0041844c `string') line 443
>ThreadFn(void * 0x00431450) line 174
>
>
>How can I avoid this problem.
>
>
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15974)
7/9/2008 1:43:09 PM
Do it from GUI thread only. Also make sure each CControlBar has a distinct 
ID. The ID is the last parameter in the method when you create it.

--
Ajay

"Faisal" <faisalm83@gmail.com> wrote in message 
news:94e71451-6e68-45ae-9986-c1b582d2442c@t54g2000hsg.googlegroups.com...
> Hi,
>
> In my application, I use SaveBarState() for persisting control bar
> state.
> The code fragment is something like this.
>
> void CMainFrame::OnSavePersistance()
> {
> SaveBarState(_T("My Persistence"));
>       // Saves some information to an xml file
> }
>
> Since my xml saving takes some time I changed the code to execute in a
> thread
>
> UINT ThreadFn(LPVOID pParam)
> {
> CMainFrame* pThis = (CMainFrame*)pParam;
> pThis->SaveBarState(_T("My Persistence"));
>
> return 0;
> }
>
> void CMainFrame::OnCntrlbartst()
> {
> AfxBeginThread( ThreadFn, this );
> }
>
> But, now in the thread function SaveBarState() fails. It shows some
> assertion in debug version. I think it is due to some mismatch in
> MODULE_STATE.
>
> statck trace for assert
> CWnd::AssertValid() line 879 + 25 bytes
> CControlBar::AssertValid() line 976
> CStatusBar::AssertValid() line 732
> AfxAssertValidObject(const CObject * 0x00431510 {CStatusBar
> hWnd=0x00180c7e}, const char * 0x5f4ccfe8 THIS_FILE, int 531) line 108
> CControlBar::GetBarInfo(CControlBarInfo * 0x00433d70) line 534
> CFrameWnd::GetDockState(CDockState & {CDockState}) line 520
> CFrameWnd::SaveBarState(const char * 0x0041844c `string') line 443
> ThreadFn(void * 0x00431450) line 174
>
>
> How can I avoid this problem.
>
>
> 

0
ajaykalra (6841)
7/9/2008 1:57:22 PM
On Jul 9, 6:43 pm, Joseph M. Newcomer <newco...@flounder.com> wrote:
> The answer is simple: don't do that.  It is not supported, and it won't work.  You cannot
> manipulate a window safely from a thread other than its owner, so it is no surprise when a
> method that involves windows fails when invoked from some other thread.  This is expected,
> and you should not under any circumstances be manipulating any aspect of a window from a
> secondary thread.
>                                 joe
>
>
>
> On Wed, 9 Jul 2008 01:39:50 -0700 (PDT), Faisal <faisal...@gmail.com> wrote:
> >Hi,
>
> >In my application, I use SaveBarState() for persisting control bar
> >state.
> >The code fragment is something like this.
>
> >void CMainFrame::OnSavePersistance()
> >{
> >    SaveBarState(_T("My Persistence"));
> >       // Saves some information to an xml file
> >}
>
> >Since my xml saving takes some time I changed the code to execute in a
> >thread
>
> >UINT ThreadFn(LPVOID pParam)
> >{
> >    CMainFrame* pThis = (CMainFrame*)pParam;
> >    pThis->SaveBarState(_T("My Persistence"));
>
> >    return 0;
> >}
>
> >void CMainFrame::OnCntrlbartst()
> >{
> >    AfxBeginThread( ThreadFn, this );
> >}
>
> >But, now in the thread function SaveBarState() fails. It shows some
> >assertion in debug version. I think it is due to some mismatch in
> >MODULE_STATE.
>
> >statck trace for assert
> >CWnd::AssertValid() line 879 + 25 bytes
> >CControlBar::AssertValid() line 976
> >CStatusBar::AssertValid() line 732
> >AfxAssertValidObject(const CObject * 0x00431510 {CStatusBar
> >hWnd=0x00180c7e}, const char * 0x5f4ccfe8 THIS_FILE, int 531) line 108
> >CControlBar::GetBarInfo(CControlBarInfo * 0x00433d70) line 534
> >CFrameWnd::GetDockState(CDockState & {CDockState}) line 520
> >CFrameWnd::SaveBarState(const char * 0x0041844c `string') line 443
> >ThreadFn(void * 0x00431450) line 174
>
> >How can I avoid this problem.
>
> Joseph M. Newcomer [MVP]
> email: newco...@flounder.com
> Web:http://www.flounder.com
> MVP Tips:http://www.flounder.com/mvp_tips.htm

Hi,
is it possible to resolve this by changing MODULE_STATE or
THREAD_STATE
 to App's MODULE_STATE?
AfxSetModuleState( AfxGetAppModuleState() )
0
faisalm83 (35)
7/10/2008 4:11:42 AM
No.  Read what I said.  Don't manipulate a window from another thread!  This is an
intrinsic limitation of the operating system, and consequently MFC; in addition, MFC has
per-thread handle maps which add more complexity.  Do not do it, do not consider it, do
not think there is a workaround.  There is not.  Do not do it.

All manipulation of windows takes place from the thread that owns them.  All other
approaches are high-risk, and when they fail, particularly when using MFC, there is no
workaround that will cause the action to work from a secondary thread.  PostMessage a
request from your secondary thread to the main GUI thread and handle it in the main GUI
thread.  That works.
				joe

On Wed, 9 Jul 2008 21:11:42 -0700 (PDT), Faisal <faisalm83@gmail.com> wrote:

>On Jul 9, 6:43 pm, Joseph M. Newcomer <newco...@flounder.com> wrote:
>> The answer is simple: don't do that.  It is not supported, and it won't work.  You cannot
>> manipulate a window safely from a thread other than its owner, so it is no surprise when a
>> method that involves windows fails when invoked from some other thread.  This is expected,
>> and you should not under any circumstances be manipulating any aspect of a window from a
>> secondary thread.
>>                                 joe
>>
>>
>>
>> On Wed, 9 Jul 2008 01:39:50 -0700 (PDT), Faisal <faisal...@gmail.com> wrote:
>> >Hi,
>>
>> >In my application, I use SaveBarState() for persisting control bar
>> >state.
>> >The code fragment is something like this.
>>
>> >void CMainFrame::OnSavePersistance()
>> >{
>> >    SaveBarState(_T("My Persistence"));
>> >       // Saves some information to an xml file
>> >}
>>
>> >Since my xml saving takes some time I changed the code to execute in a
>> >thread
>>
>> >UINT ThreadFn(LPVOID pParam)
>> >{
>> >    CMainFrame* pThis = (CMainFrame*)pParam;
>> >    pThis->SaveBarState(_T("My Persistence"));
>>
>> >    return 0;
>> >}
>>
>> >void CMainFrame::OnCntrlbartst()
>> >{
>> >    AfxBeginThread( ThreadFn, this );
>> >}
>>
>> >But, now in the thread function SaveBarState() fails. It shows some
>> >assertion in debug version. I think it is due to some mismatch in
>> >MODULE_STATE.
>>
>> >statck trace for assert
>> >CWnd::AssertValid() line 879 + 25 bytes
>> >CControlBar::AssertValid() line 976
>> >CStatusBar::AssertValid() line 732
>> >AfxAssertValidObject(const CObject * 0x00431510 {CStatusBar
>> >hWnd=0x00180c7e}, const char * 0x5f4ccfe8 THIS_FILE, int 531) line 108
>> >CControlBar::GetBarInfo(CControlBarInfo * 0x00433d70) line 534
>> >CFrameWnd::GetDockState(CDockState & {CDockState}) line 520
>> >CFrameWnd::SaveBarState(const char * 0x0041844c `string') line 443
>> >ThreadFn(void * 0x00431450) line 174
>>
>> >How can I avoid this problem.
>>
>> Joseph M. Newcomer [MVP]
>> email: newco...@flounder.com
>> Web:http://www.flounder.com
>> MVP Tips:http://www.flounder.com/mvp_tips.htm
>
>Hi,
>is it possible to resolve this by changing MODULE_STATE or
>THREAD_STATE
> to App's MODULE_STATE?
>AfxSetModuleState( AfxGetAppModuleState() )
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15974)
7/10/2008 3:57:25 PM
Reply:

Similar Artilces:

cmc_logon failed with outlook 2002
Hi, I use the cmc_logon function to log a client application to a service provider but the following code failed : if ((ulResult = CMCLogon (NULL,NULL,NULL,0,0,CMC_VERSION,CMC_LOGON_UI_ALLOWED |CMC_ERROR_UI_ALLOWED,&lhSession,NULL))==CMC_SUCCESS) the return code is CMC_E_FAILURE This logon works correctly with Outlook 2000 Thanks, Laurent. ...

Failed delivery msgs for unknown addresses
I am now getting failed delivery messages for addresses I have never seen before. I have AVG running and it has found nothing....but several times a day the hard drive indicator lights up and everything slows to a crawl and email stops. Nothing shows up in the Windows Task Manager under the Applications Tab. What is going on? Chattagator wrote: > I am now getting failed delivery messages for addresses I have never seen > before. I have AVG running and it has found nothing....but several times a > day the hard drive indicator lights up and everything slows to a c...

Failed to find SQL Express installation file SQLEXPRESS\SQLExpr.exe
I am trying to install ms crm laptop client and it keeps giving me this error: "Failed to find SQL Express installation file SQLEXPRESS\SQLExpr.exe" I have tried the following without success: - Copied the ISO Image's files on to laptop and renamed the sql express folder to match the above message - Separately installed the sqlexpress server I am trying to uninstall all the instances of sql/msde/sqlexpress right now. I will try to install again after that. Lets see. ...

SaveBarState fails when it is called from a thread
Hi, In my application, I use SaveBarState() for persisting control bar state. The code fragment is something like this. void CMainFrame::OnSavePersistance() { SaveBarState(_T("My Persistence")); // Saves some information to an xml file } Since my xml saving takes some time I changed the code to execute in a thread UINT ThreadFn(LPVOID pParam) { CMainFrame* pThis = (CMainFrame*)pParam; pThis->SaveBarState(_T("My Persistence")); return 0; } void CMainFrame::OnCntrlbartst() { AfxBeginThread( ThreadFn, this ); } But, now in the thread function SaveBarState...

About LoadBarState and SaveBarState
I wrote a MDI program like the following... // header file mainfrm.h class CMainFrame : public CMDIFrameWnd { ... CToolBar m_wndToolBar1; CToolBar m_wndToolBar2; ... }; // source file mainfrm.cpp int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) { ... LoadBarState( _T("ToolBars\\ToolBar") ); return 0; } void CMainFrame::OnClose() { // TODO: Add your message handler code here and/or call default SaveBarState( _T("ToolBars\\ToolBar") ); CMDIFrameWnd::OnClose(); } The other code was created automatically by wizard. But If the tw...

Threading
I have a dialog application. I want use a button to start a thread. The code is: void CMyDlg::OnBnClickedButton1() { .... CWinThread *pThread = AfxBeginThread(ThreadProc, NULL); .... } UINT CMyDlg::ThreadProc(LPVOID pParam) { DWORD result =0 ; // do somthing ...; AfxEndThread(0); return result; } when compile, I got "error C2665: 'AfxBeginThread' : none of the 2 overloads can convert parameter 1 from type 'UINT (LPVOID)'" What is wrong? kathy wrote: > I have a dialog application. I want use a button to start a thread. The > code is: ...

Relay attempt failed
I get an error when trying to send to a specific external email address. I can send to other external email addresses. Here is my error: The following recipient(s) could not be reached: aash@outsidedomain.org on 5/16/2006 10:33 AM You do not have permission to send to this recipient. For assistance, contact your system administrator. <exchange.mydomain.com #5.7.1 smtp;550 5.7.1 <aash@outsidedomain.org>... relay attempt failed> I don't have any restrictions on the user attempting to send the email. Any comments/suggestions are greatly app...

XslCompiledTransform.Load() fails sometimes
Basically the issue is, when the XSL style sheet is loaded by URI it is cool but when the exact same style sheet loaded by it's contents the load fails (for this particular style sheet). Because our sheets are kept in a DB, loading by content is preferable. Content based load code: Stream xslStream =3D new MemoryStream(xslString); XmlReader xslTextReader =3D XmlReader.Create(xslStream); compliedXsl.Load(xslTextReader); URI based load code: compliedXsl.Load(xslUri); The error states that there in an invalid character for the encoding at line 2140 position 365. Here is the problematic...

Sort fails on one column
I've been working with a spreadsheet, using different sorts on it. But suddenly one of the columns became a no-op for sorting, whether I sort on that column alone or do a multi-column sort. The only thing I did of interest was to define a pulldown list (for a different column) in a column over at the right, which is outside of the sort range. To be specific, I highlight columns A-J to sort, and J is the one that doesn't work. Columns L-M are used to define pulldowns, but not for column J. Any ideas? -- Christopher Brewster Lockheed Martin, Eagan MN Message posted via htt...

All update installs fail
On W2000 windows update was downloading and installing a long list of updates. Had to start several times and restart new update Everything went fine ABout 90 updates were downloaded and install of the started Suddenly after update 14 of 90 the process stopped Lost the KBnr something with Media player. Afterwards no possibility any more to install updates. Even with detailed and only one it does not work any more All installs happen immediately Then I get the message all instaal failed No error message and no possibilty to get it working again Nor manual nor automatic works Where c...

Ctrl-c fails to work
Unusual issue. I don't know if anyone knows a workaround. When a user opens GP (v7.5 sp4 and 7), ctrl-c and ctrl-v work fine for copying and pasting. Once Transactions>>Financial>>Reconcile is opened, ctrl-c no longer works. You can click edit>>copy, but the keyboard shortcut to copy fails (ctrl-v still works). Closing GP and reopening resolves the issue, until you open that window again. Any thoughts? I have a client that has the same issue that the Ctrl-C will fails to work on the SOP item line. However have not yet been able to determine what conditions cause i...

update fails
Every time I try to install KB979906 a MS update for net framework 1.1 sp1 it gets half installed then I hear the HD growl and it fails to install. Keeps coming back as a needed update. Any thoughts? SG Should have mentioned this: running XPpro sp3 with manual update install. This update comes back almost immediately as "updates are ready for your computer" message. "shakey" <NOONE@NOWHERE.NET> wrote in message news:up%23FZp0DLHA.1996@TK2MSFTNGP06.phx.gbl... > Every time I try to install KB979906 a MS update for net framework 1.1 sp1 > i...

Calling Excel from c++
Hi. I want to be able access Excel (read, write, and format data) from within C++. I have been doing it the other way around (calling c++ dlls from VBA) and it's just not quite as powerful as i would like. Any pointers to a good website or something on how to do this? "hamishd" <Hamish.Dean@gmail.com> ha scritto nel messaggio news:2cb9adfb-d00c-4e1c-9ab1-c5a968762c68@d36g2000prf.googlegroups.com... > Hi. I want to be able access Excel (read, write, and format data) from > within C++. > > I have been doing it the other way around (calling c++ dlls from VBA) ...

SaveBarState fails when it is called from a thread #7
Hi, In my application, I use SaveBarState() for persisting control bar state. The code fragment is something like this. void CMainFrame::OnSavePersistance() { SaveBarState(_T("My Persistence")); // Saves some information to an xml file } Since my xml saving takes some time I changed the code to execute in a thread UINT ThreadFn(LPVOID pParam) { CMainFrame* pThis = (CMainFrame*)pParam; pThis->SaveBarState(_T("My Persistence")); return 0; } void CMainFrame::OnCntrlbartst() { AfxBeginThread( ThreadFn, this ); } But, now in the thread function SaveBarState...

Failed to create organization
HI I try to install MS CRM with MSDN Subscriber license. The system returns me : "Failed to provision your initial business" "Failed to create organization" I check services and the one "Crystal APS" isn't started. I try with the Local System account and a error message is returned with no specific error number... I try now with a Domain account, it runs. During the install, when the system ask me with which account I want to start services, I answer a Domain Account... Can the main error message come from this handling ?? I try with the other option...

Problem with LoadBarState/SaveBarState
Hi, I've got multiple toolbars (with unique IDs) and use LoadBarState in OnCreate and SaveBarState in OnClose. It works pretty good with one exception: Wherever the toolbars are when I close the app, the next time I open the app the toolbars are always shifted in the x direction by about 4 units. Using VS .NET. Thanks for any help:). Steve Here's what it looks like: http://www.rick-n-steve.com/temp/help.html Why does MFC and LoadBarState/SaveBarState boink the coordinates? On a side note, the problem appears to be because I am not using the DOC/VIEW architecture in MFC. I'm man...

Access2k3 Application works under XP, fails under Windows 2000
SCENARIO: Application originally developed in Access 97 several years ago. Worked with no problem until recent change from Novell to Active Directory. PROBLEM: Application was converted from Access 97 to Access 2003. It WORKS on machines running Windows XP It FAILS on machines running Windows 2000 as below: In the Form_Load event of one of the forms (which contains a number of subforms) the following lines appear: Forms![frmPartDetails]![fsubNHA_Details].Form.RecordSource = "qryPart_Details_frm_NHA" Forms![frmPartDetails]! [fsubEndUnit_Details].Form.Rec...

CFileDialog fails to domodal when logging on as a power user...
Hi, I have a piece of code shown below: CFileDialog dlg(FALSE, _T("csv"), sDefault, OFN_OVERWRITEPROMPT | OFN_EXTENSIONDIFFERENT, szFilters, NULL); if (dlg.DoModal() != IDOK) return; On some machines, if I loggon as a power user, the DoModal() always fails. Do you have any clue or resolution for this problem? Your help is much appreciated. Tony Forgot to mention one thing. I even didn't see the dialog box popped out. DoModal() simply returned a failure status without popping up a dialog box. Tony Did you try the GetCommDlgErrorCode (or a name very much resembl...

Migrating Incidents Failed with DMF
I'm trying to import our old incident database into CRM 1.2. Everything else was already loaded into CRM with Scribe (license expired). I want to map all the incidents to one account, our company, which is already in the AccountBase table in the CRM database. How do I get our existing account mapped to the AccountID in cdf_Incident? Everything else is mapped fine. IE, the owning users and subjects came over to the cdf database. Thanks Tonya Bednarick Salamander Technologies, Inc. ...

Cannot send a large email. Says 'Operation failed'
I have been trying to send an email to seven people with two Word attachments. However, my outlook say's Operation Failed. I have send other emails with no problems. What does this mean. It means you need to ask in an Outlook newsgroup. "Sadiyah Muhammad" <Sadiyah Muhammad@discussions.microsoft.com> wrote in message news:D2C255B3-8E5B-43C9-9D8F-6B91574E2C7E@microsoft.com... :I have been trying to send an email to seven people with two Word : attachments. However, my outlook say's Operation Failed. I have send other : emails with no problems. : : W...

Service call registration
Hi, We have a service orientated organisation, and we use automatic workflow to inform our clients about their service call. At this moment we don't registrate in the service call who has made the call and that's not very handy. Is it possible to get a dropdown box with all the contactpersons from an account in a service call? And if the answer is yes, how can I do that? regards, ...

WLM 14.0.8089.726 Voice Call not working!
i had WinXP SP2 and everything was fine but since i formated my PC with WinXP SP3 and edited some windows services (services.msc) and disabled Remote Assistance! voice chat in Windows Live Messenger (WLM) not working any more! Everything is fine even sending Voice Clip! It's just when i Call them they answer me. we can't hear each other! i wonder it doesn't work cuz i disabled Remote Assistance!!! While Yahoo Messenger & Skype working very well!!! sorry 4 my weak english. Help! ---------- Windows XP-SP3 - Intel Mobile 2.2 Ghz - 512 MB of ...

Outlook 2003 gives me the error "Failed to update headers"
I have a customer who has not been able to receive any new mail using Outlook, although he can send. When he opens Outlook, there is no error, but when he clicks on Inbox, a message shows up that says "Failed to update headers". We login to a domain here, and he gets the same problem with any machine he logs into. Thought it may have been an issue with his account, but server and account administration support says everything checks out fine. The fact that it happens on every computer, and identical symptoms, is a clear sign to me that it is an issue with his account, although I ...

CRM 1.2 to CRM 3.0 Upgrade failed
I am tring to upgrade CRM 1.2 to 1.3. i uninstalled 1.2 and started a new installation of CRM 3.0 with 1.2 database. every thing is just on one box. Last time i just ran it and it went well but this time it is failing with message Database export failed. There is no clear answer on google groups against this issue. If any one can guide on this issue. Error| Check ExportXmlValidator : Failure: Microsoft CRM 1.2 database export failed. Fruther LOG 9:51:08| Info| === Setup bootstrap logging started 9/29/2006 9:51:08 AM === 09:51:08| Info| Bootstrap version: 3.0.5300.0. 09:51:08| Info| Us...

SMO.Detach fails due to active connection.
I am programming in VS2008 C# using SMO I would like to execute a SMO.Server.Detach(Database) which works if there are no connections open and fails if there is an open connection which makes sense. My question is: Is there an SMO method to force all connections closed or force the dtabase to be in a state so that the server.detach() will not fail? Thanks Morris -- Thanks Morris Morris Neuman (Morris@online.nospam) writes: > My question is: > Is there an SMO method to force all connections closed or force the > dtabase to be in a state so that the server.deta...