Re: Updating Controls from a Thread Causes Access Violation
From: Scott McPhillips [MVP] (org-dot-mvps-at-scottmcp)
Date: 11/10/04
- Next message: Scott McPhillips [MVP]: "Re: serial WriteFile hangs"
- Previous message: bicoman: "Re: error C2143"
- In reply to: Brad McMillan: "Updating Controls from a Thread Causes Access Violation"
- Next in thread: Brad McMillan: "Re: Updating Controls from a Thread Causes Access Violation"
- Reply: Brad McMillan: "Re: Updating Controls from a Thread Causes Access Violation"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 10 Nov 2004 18:40:17 -0500
Brad McMillan wrote:
> The problem is that when I run this under Debug I get an access
> violation when UpdateData(FALSE) is executed.
>
> Can anyone tell me why I'm getting an access violation here? Or, is
> there a better way of updating my static control from within the
> thread?
See FAQ 11 for "why" and FAQ 12 for "a better way."
http://www.mvps.org/vcfaq/mfc/index.htm
You also need to use AfxBeginThread instead of _beginthread.
-- Scott McPhillips [VC++ MVP]
- Next message: Scott McPhillips [MVP]: "Re: serial WriteFile hangs"
- Previous message: bicoman: "Re: error C2143"
- In reply to: Brad McMillan: "Updating Controls from a Thread Causes Access Violation"
- Next in thread: Brad McMillan: "Re: Updating Controls from a Thread Causes Access Violation"
- Reply: Brad McMillan: "Re: Updating Controls from a Thread Causes Access Violation"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|