BackgroundThreadProc exits with code 1 on Windows Vista

Hello, 

I'm using Visual Studio 2008 with SP1, MFC Feature Pack 2008, Windows Vista 
32 bit on a quad core machine.

The problem is that when I'm creating an application with the Application 
Wizard, the thread "BackgroundThreadProc" terminates with exit code 1. What 
does this mean ?

I also tried this on another computer (dual core machine) with Windows XP 
Sp2 and it terminates normaly (exit code is 0).

Should I worry about the termination code of BackgroundThreadProc ?

Thank you in advance.
0
Dorin (5)
9/10/2008 8:54:00 AM
vc.mfc 33608 articles. 0 followers. Follow

4 Replies
363 Views

Similar Articles

[PageSpeed] 47

On Wed, 10 Sep 2008 01:54:00 -0700, DorIN <DorIN@discussions.microsoft.com>
wrote:

>Hello, 
>
>I'm using Visual Studio 2008 with SP1, MFC Feature Pack 2008, Windows Vista 
>32 bit on a quad core machine.
>
>The problem is that when I'm creating an application with the Application 
>Wizard, the thread "BackgroundThreadProc" terminates with exit code 1. What 
>does this mean ?
>
>I also tried this on another computer (dual core machine) with Windows XP 
>Sp2 and it terminates normaly (exit code is 0).
>
>Should I worry about the termination code of BackgroundThreadProc ?

I dunno. What's a "BackgroundThreadProc"? Who does it belong to? It sounds
like it belongs to AppWizard, in which case I wouldn't care (how do you
even know?) what it returns, as long as my project gets created correctly.

-- 
Doug Harrison
Visual C++ MVP
0
dsh (2498)
9/10/2008 5:49:02 PM
Hello again,

I'm really sorry, because I just realized that my post was a little bit 
confusing.

Here is a more clear and detalied explanation of the problem:

1. I'm creating a simple application (which has a ribbon) using the App 
Wizard.
    The application is generated fine! There are no errors.
2. I'm starting the application. Four threads are being created by default: 
the MainThread, two RPC threads and the "BackgroundThreadProc" thread. I said 
"created by default", because i'm executing exactly the application that has 
been generated at step 1.
3. I'm closing the application and in the output console I can see that 
"BackgroundThreadProc" exits with code 1. It's the only thread returning the 
code 1.

Thanks again!

"Doug Harrison [MVP]" wrote:

> I dunno. What's a "BackgroundThreadProc"? Who does it belong to? It sounds
> like it belongs to AppWizard, in which case I wouldn't care (how do you
> even know?) what it returns, as long as my project gets created correctly.
> 
> -- 
> Doug Harrison
> Visual C++ MVP
> 
0
Dorin (5)
9/10/2008 10:01:01 PM
On Wed, 10 Sep 2008 15:01:01 -0700, DorIN <DorIN@discussions.microsoft.com>
wrote:

>Hello again,
>
>I'm really sorry, because I just realized that my post was a little bit 
>confusing.
>
>Here is a more clear and detalied explanation of the problem:
>
>1. I'm creating a simple application (which has a ribbon) using the App 
>Wizard.
>    The application is generated fine! There are no errors.
>2. I'm starting the application. Four threads are being created by default: 
>the MainThread, two RPC threads and the "BackgroundThreadProc" thread. I said 
>"created by default", because i'm executing exactly the application that has 
>been generated at step 1.
>3. I'm closing the application and in the output console I can see that 
>"BackgroundThreadProc" exits with code 1. It's the only thread returning the 
>code 1.

Without knowing more what the function does and what the return codes mean,
it's impossible to say for sure, but it may be that it does one thing on
Vista and another on XP and returns different codes to indicate this. Of
course, if it exits without any problem, it should return 0, but not
everyone follows the rules. I did search the MFC sources for
BackgroundThreadProc but came up empty. If Windows itself is creating the
thread behind your back for whatever reason, I wouldn't worry at all about
the return code, unless the program was misbehaving in some noticeable way.

-- 
Doug Harrison
Visual C++ MVP
0
dsh (2498)
9/11/2008 12:04:44 AM

"Doug Harrison [MVP]" wrote:
>
> Without knowing more what the function does and what the return codes mean,
> it's impossible to say for sure, but it may be that it does one thing on
> Vista and another on XP and returns different codes to indicate this. Of
> course, if it exits without any problem, it should return 0, but not
> everyone follows the rules. I did search the MFC sources for
> BackgroundThreadProc but came up empty. If Windows itself is creating the
> thread behind your back for whatever reason, I wouldn't worry at all about
> the return code, unless the program was misbehaving in some noticeable way.
> 
> -- 
> Doug Harrison
> Visual C++ MVP

Hi Doug,

thanks for the answer!

I also tried to find out more about BackgroundThreadProc, but unfortunalty 
without great success! It seems that the BackgroundThreadProc and the two RPC 
threads are created by default only in a ribbon application. In a classical 
application, just the main thread is being created (by default)!

have a nice day!
0
Dorin (5)
9/11/2008 1:00:01 PM
Reply:

Similar Artilces:

The Sum from 1 worksheet cell to another worksheet cell
the sum from one cell on sheet1 from another cell on sheet2,how do you do the formula qwerty: To sum the value on Sheet1, cell A10 with the cell value Sheet2, cell B20, enter =Sheet1!A10 + Sheet2!B20 (or you can enter '=' sign and click on A10, then enter the plus sign and click on B20) jeff >-----Original Message----- >the sum from one cell on sheet1 from another cell on sheet2,how do you do the formula >. > ...

How to Hide Left Panel of Folder Window?
I'm well behind the Windows curve and I'm just now learning to use Windows XP Home. Up to now I've been using Windows 2000 Pro. On my XP desktop I have a shortcut to my music folder which containins my MP3 files. When I double click on the shortcut, a window opens on the desktop displaying the contents of my music folder. This window has a panel along the left side containing items like "File and Folder Tasks" and "Other Places." I can't figure out how to close, hide or otherwise delete this panel. This panel takes up a lot of prec...

Creating a print-macro that'll only print page 1?
Hi, I have a spreadsheet that contains multiple sheets. I want to add a button that runs a macro, which only prints page 1 on the first sheet (called Scorekort). The "Scorekort" sheet contains 13 pages in total, but I only want to print the first page. Any ideas for this macro? Anders hi, Sub Macro1() Sheets("Scorekort").PrintOut From:=1, To:=1, Copies:=1, Preview:=True, Collate:=True End Sub if you don't want a print preview, Preview:=False -- isabelle Le 2011-05-21 04:16, Anders M a �crit : > Hi, > > I have a spreadsheet that contains multiple ...

1 Chart
I presently have an XY line chart showing asset price over time. Pretty simple. X Axis - Time Scale Y Axis - Asset Price I would now like to add an additoinal series showing the volume of assets traded, ideally this would be as a bar chart sitting "underneath" the asset price on the chart. They would share the same X Axis. I have added another series, but this simply displays the volume traded as another line, and even when this is set to a secondary axis the scaling makes this unworkable. i have adjusted the scales of both, still this does not make it workable, i want the series...

Force a page break in code
I need to force a page break in the Detail_OnFormat Event when a value changes. How do I do that? Thanks, Bill Bill wrote: > I need to force a page break in the Detail_OnFormat > Event when a value changes. How do I do that? > > Thanks, > Bill Insert a PageBreak control from the ToolBox bar at the desired location. Even though such a control is never "visible" other than in design view they do still have a Visible property. That property effectively turns on and off the PageBreak so you can minipulate that in your code. -- Rick Brandt, Microsoft Access MVP...

Enter "1", cell show ".01". Why?
Any number typed into a cell is divided by 100. If proceded by "=" the number is correct. What caused this and how can I fix it? Try this .. Click Tools > Options > Edit tab Uncheck "Fixed decimal" > OK Things should be back to normal now .. (it's a fixed decimal setting !) -- Rgds Max xl 97 --- Singapore, GMT+8 xdemechanik http://savefile.com/projects/236895 -- "Yonian" <Yonian@discussions.microsoft.com> wrote in message news:40499CA4-7FAF-42A6-8B19-A90881735C50@microsoft.com... > Any number typed into a cell is divided by 100. > If p...

Outlook and Windows Integrated Authentication
Hello All, Does anyone know if Outlook (not OWA) can use Windows Integrated Authentication (like IE) to automatically log onto Intranet Web sites to retrieve graphics in HTML messages? Right now we get a logon dialog and have to manually log in. Thanks. if you paste the url into a browser, does it work as desired? -- Diane Poremsky [MVP - Outlook] Author, Teach Yourself Outlook 2003 in 24 Hours Coauthor, OneNote 2003 for Windows (Visual QuickStart Guide) Need Help with Common Tasks? http://www.outlook-tips.net/beginner/ Outlook 2007: http://www.slipstick.com/outlook/ol2007/ Outloo...

Integrating Great Plains 8.0 and CRM 1.2 and Windows Small Busines
Integrating Great Plains 8.0 and CRM 1.2 I run a Windows Small Business Server 2003 Premium box along with a Windows Server 2003 Standard box used for my Great Plains 8.0 and SQL 2000. I’m considering introducing CRM 1.2 Professional into the mix. From a hardware stand point I know I’m fine all around. I’ve been researching how I should configure CRM and am a bit confused. The info I’ve found in KB887153 states “When you install Microsoft Business Solutions CRM Integrations for Great Plains 7.0, 7.5, or 8.0, Microsoft BizTalk Server is also installed. However, BizTalk Server 2000 and B...

New message opens up behind outlook window
Everytime I click new in my inbox to open a new message, the new message pops up behind the main oulook window. does anyone know how to make this stop? ...

Can't install windows updates on SBS 2003
I have a SBS 2003 server that has not been updated in a couple years. It has SP2 installed but when I run Microsoft Update it needs to download and install 96 updates. When I try to get them installed it comes back with an error saying not enough disk space. I have tried to just install 1 update at a time and get the same error. The C:\ drive has over 14GB of free space and the other drives have plenty of space as well. I restarted the server and also ran Disk Cleanup, as the error message reccomends, but am still having the same problem. Anyone run across this problem befo...

SK 40175 Tuff-1 1/2-Inch Drive 15-Inch Reversible Ratchet
Price:$90.24 Image: http://thediscounfinder.info/image.php?id=B0009U5RRM Best deal: http://thediscounfinder.info/index.php?id=B0009U5RRM Item #: SKT40175. Features & Benefits:Tuff 1(r) Ratchets 72 tooth head design delivers a short 5" stroke for use in tight areas.17 teeth engage when torque is applied to provide a strong grip without slippage.Thumb falls naturally into position, giving instant control with one hand.Easy to reverse, 4 point cap.SuperKrome plating for long tool life and maximum corrosion resistance.Description: 15" Reversible Tuff Customers also search for:...

Windows media player
Why does windows media player keep popping up? David wrote: > Why does windows media player keep popping up? OK, I give up. Why does Windows Media Player keep popping up ? How to ask a question http://support.microsoft.com/kb/555375 Windows Media Player General Discussion http://www.microsoft.com/communities/newsgroups/en-us/default.aspx?dg=microsoft.public.windowsmedia.player&cat=en_US_44d7101f-71dd-4f9a-b6b9-45215557dd35&lang=en&cr=US MowGreen ================ *-343-* FDNY Never Forgotten ================ banthecheck.com "Security update...

Task Manager window only CPU
Vista Ultimate SP2 When I launch Windows Task Manager, only a CPU meter opens. When I right click icon in task bar, I only get Close & Always on top options. How do I restore task manager? Happy New Year -- ***************** John Lenz JohnLenz@comcast.net Double click on the white frame of the task manager window. That should do it. -- whs THX - it worked Happy New Year -- ***************** John Lenz JohnLenz@comcast.net "whs" <guest@unknown-email.com> wrote in message news:89eee91dbeee8173c55e0008be25b622@nntp-gateway....

How do add another code to a current one?
I have this following code to make the rows changed based on the critea in column 16, and I need add A "Red, Yellow, Green" for status to only one column 30 at the end of the spreadsheet. How do I add another code? I keep getting an error.. Private Sub Worksheet_Change(ByVal Target As Range) Dim c As Range, clr As Long For Each c In Target.Cells If c.Column = 16 Then Select Case c.Value Case "Analyze": clr = RGB(204, 255, 255) Case "Build ": clr = RGB(204, 255, 255) Case ...

URGENT: WINDOWS 8 ANNOUNCEMENT for July 2011!
Think Windows7 just came out & too young? Welcome to the brave future: Windows8! 1) Windows 8 To Contain New Anti-Ha*king Software (antipir*cy). Some may consider anti-pir*cy measures similar to whistling in the wind, but that's certainly not the case. George has posts in Windows7NewsDOTcom, and ConnectedInternet showing how in many cases Microsoft has foiled anti-pir*cy efforts. Many believe that piracy is relegated to just illegal copying or theft. But that is not the case. V*rus distribution and embedded malw*re, and privacy intrusion are typical features that result from...

email address on Service Call Entry window
Add an email address field to the Service Call Entry window for the customer contact on the service call. Even if it is not pulled from the email address of the address id on the service call, at least the dispatcher could enter an email address on the service call in order to communicate with the customer regarding the call. It is common to take email address as part of contact information. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the m...

Windows Update Office 2007 Converter confusion
On my desktop I have Office 2003 (laptop has Office 2007). I recently received an attachment in .docx format (2007). I downloaded the converter to my desktop and opened the document. Now on my desktop (which has Office 2003) I receive update notices for Office 2007. Should I ignore these? Hide them? Install them? Will I still be notified re updates needed for Office 2003? Thank you for whatever insight you can provide. If you can give me some of the background explanation as to why this is happening (I presume related to the 2007 converter viewer install), I can understand bett...

Can Outlook 2003 use MSN Messenger INSTEAD of Windows Messenger?
I didn't get an answer to this question last week so I'm re-posting... I recently purchased a new computer (Windows XP Home Edition w/SP2) and loaded up all of the available updates to the OS, Internet Explorer, etc. Next, I installed Office 2003 Professional. I disabled Messenger integration with Outlook 2003 as discussed in other posts here. Next I installed MSN Messenger 6.2 and it seemed to run properly as a stand-alone application. So I re-enabled Messenger integration on Outlook 2003. The next time I booted up and ran Outlook, the Messenger icon appeared in the taskbar...

Problem with vba code to export query result in excel
Hi, I have a access report that exports to excel with click of a button after choosing parameters. This works well. However I have to modify couple of fields to utilize formula in the export module. I am not sure how to do this. I am writing the above code which seems to cause problem. I appreciate any help to resolve this issue. Thanks. Code: If lngColumn = 12 Then xlc.Offset(0, lngColumn).Value = =([UnitPrice]*[OriginalShippedQty])/1000 End If It seems the fields UnitPrice and OrigianalShippedQty are not being recognized here Jack wrote: >Hi, >I have a acces...

Windows XP SP2
Has anyone else noticed that after installed Windows XP SP2, emails in Outlook sit in the Outbox for several "noticable" seconds before sending. Sam <anonymous@discussions.microsoft.com> wrote: > Has anyone else noticed that after installed Windows XP > SP2, emails in Outlook sit in the Outbox for > several "noticable" seconds before sending. I believe I saw this documented on the Microsoft web site. -- Brian Tillman ...

Code about setting Y Axes scale.
I couldn't understand the lines between 35-42, why he thought the dbMinScale after the change is the one he want. What the logic of this code section. Any one who could understand please help me. thanks in advance!:) Private Sub USP_SetYAxesScal(ByVal i_strWSName As String, ByVal i_strChartName As String, Optional ByVal i_intDecimal As Integer = 2) Dim dbMaxScale As Double, dbMinScale As Double, i As Integer, j As Integer Dim xTargetChart As Chart, vTemp() As Variant, blnInit As Boolean, dbMax As Double, dbMin As Double 1 On Error Resume Next 'get max/m...

Office 2007 on Windows 7
I just purchased a new laptop with Windows 7. I also purchased Office 2007 but I notice that Windows 7 is not shown on the Office package. Can I install Office 2007 without any propblems? Answered your first posting. apensa wrote: > I just purchased a new laptop with Windows 7. I also purchased Office 2007 > but I notice that Windows 7 is not shown on the Office package. Can I > install Office 2007 without any propblems? ...

Help with a code
I have these code and it works find: but i also want to use it for different culumn within the same sheet. how do i add Column D with different target? meaning "S" for Study and "B" for books and s on... and maybe adding a Msg box to it that will only allow the Letters specify.. thank you in advance.. Private Sub Worksheet_Change(ByVal Target As Range) If Target = "" Then Exit Sub If Target.Count > 1 Then Exit Sub If Not Intersect(Target, Range("c6:c50")) Is Nothing Then If UCase(Target) = "C" Then Target = "Contribution" El...

Excel Number Format Codes
I can't figure out how to format numbers so that when you type 3220 it will look like 32.20 kinda like how you can enter numbers on an adding machine. I would greatly appreciate this number format code. Thank you. -- 1:~ Hi, I think you want to go Tools | Options | Edit | Fixed Decimals - 2. That will divide all the numbers you enter by 100. You will also have to format the row or column to display 2 decimals. Select the cells or range, right mouse click, format cells, numbers, 2 decimals. Hope that helps. Best regards, Kevin "MBB" <MBB@discussions.microsoft.com> w...

Volume License copy of Windows Server
Gurus, Is there anyway anymore to get a full Volume License copy of Windows Server (e.g., version 2008) which does NOT require Internet activation? -- Spin Start with Vista/Windows 2008, your options to activate are by Internet or Phone. I believe the command that kicks it off is: slui.exe 4 "Spin" <Spin@invalid.com> wrote in message news:84nk89Far1U1@mid.individual.net... > Gurus, > > Is there anyway anymore to get a full Volume License copy of Windows > Server (e.g., version 2008) which does NOT require Internet activation? > ...