Click here to Skip to main content
15,894,095 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Problem retrieving fields from a DB using CRecordset object Pin
Cyber Friend1-Jun-06 0:59
Cyber Friend1-Jun-06 0:59 
GeneralRe: Problem retrieving fields from a DB using CRecordset object Pin
David Crow1-Jun-06 2:54
David Crow1-Jun-06 2:54 
QuestionModeless Dialogs? or Distroy Dialogs? Pin
aei_totten31-May-06 4:47
aei_totten31-May-06 4:47 
AnswerRe: Modeless Dialogs? or Distroy Dialogs? Pin
David Crow31-May-06 5:06
David Crow31-May-06 5:06 
GeneralRe: Modeless Dialogs? or Distroy Dialogs? Pin
aei_totten31-May-06 5:28
aei_totten31-May-06 5:28 
GeneralRe: Modeless Dialogs? or Distroy Dialogs? Pin
David Crow31-May-06 5:52
David Crow31-May-06 5:52 
QuestionRegister a TLB file? Pin
Ista31-May-06 4:33
Ista31-May-06 4:33 
AnswerRe: Register a TLB file? Pin
Sarath C31-May-06 4:40
Sarath C31-May-06 4:40 
AnswerRe: Register a TLB file? Pin
James R. Twine31-May-06 4:44
James R. Twine31-May-06 4:44 
AnswerRe: Register a TLB file? Pin
Roger Stoltz31-May-06 5:07
Roger Stoltz31-May-06 5:07 
GeneralRe: Register a TLB file? Pin
Ista31-May-06 5:33
Ista31-May-06 5:33 
GeneralRe: Register a TLB file? Pin
Roger Stoltz31-May-06 6:25
Roger Stoltz31-May-06 6:25 
GeneralRe: Register a TLB file? Pin
Ista31-May-06 7:47
Ista31-May-06 7:47 
AnswerRe: Register a TLB file? Pin
V.31-May-06 8:38
professionalV.31-May-06 8:38 
GeneralRe: Register a TLB file? Pin
Ista31-May-06 8:45
Ista31-May-06 8:45 
GeneralRe: Register a TLB file? [modified] Pin
V.31-May-06 8:57
professionalV.31-May-06 8:57 
GeneralRe: Register a TLB file? [modified] Pin
Ista31-May-06 9:00
Ista31-May-06 9:00 
QuestionIllegal Instruction Pin
Russell'31-May-06 3:22
Russell'31-May-06 3:22 
AnswerRe: Illegal Instruction Pin
Chris Losinger31-May-06 3:28
professionalChris Losinger31-May-06 3:28 
GeneralRe: Illegal Instruction Pin
Russell'31-May-06 3:32
Russell'31-May-06 3:32 
GeneralRe: Illegal Instruction Pin
Cedric Moonen31-May-06 3:46
Cedric Moonen31-May-06 3:46 
GeneralRe: Illegal Instruction Pin
Russell'31-May-06 4:06
Russell'31-May-06 4:06 
QuestionUnable to get device context Pin
shivditya31-May-06 3:02
shivditya31-May-06 3:02 
AnswerRe: Unable to get device context Pin
Hamid_RT31-May-06 3:15
Hamid_RT31-May-06 3:15 
AnswerRe: Unable to get device context Pin
Sarath C31-May-06 3:28
Sarath C31-May-06 3:28 
the reason why we are making a thread static because of to access the local resource of the class.

what u had done in the code is abosolutely wrong let me point out one of them


shivditya wrote:
CWnd *cwnd,*cwnd1;
cwnd1 = cwnd->GetWindow(1);


In the above statement, cwnd* is not an initialized pointer. so u wont anything from there.


shivditya wrote:
cwnd1 = cwnd->GetWindow(1);


This one something seems wrong. what u meant by GetWindow(1)?


it is better u pass this pointer the the function or make it accesseble trough some global static pointers.
i.e
static pszWindow; // declare as static member variable
static CMy5CYLINDERView::pszWindow = NULL; // initialize it globally

on Initial update, update this value with this pointer. then u can access it at the thread function

CMy5CYLINDERView::pszWindow->GetDC();

there is one more option.

define a structure that contains all information u need at thread

the definition may goes like this

typedef struct
{
CMy5CYLINDERView* pView;
Engine* pData;
}MyThreadParam;

now u "allocate memroy" (dont pass local variable) for the type of structure and fill with required informatio and pass to the thread param

at thread function type cast and use it.

SaRath

"D on't blindly follow rules you read somewhere without verifying that it makes sense for your situation!"

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.