Click here to Skip to main content
15,883,737 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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!"
GeneralRe: Unable to get device context Pin
shivditya1-Jun-06 20:10
shivditya1-Jun-06 20:10 
AnswerRe: Unable to get device context Pin
eli1502197931-May-06 4:26
eli1502197931-May-06 4:26 
QuestionRe: Unable to get device context Pin
shivditya1-Jun-06 20:21
shivditya1-Jun-06 20:21 
QuestionProblem With MSOutLook 2003 when using Mapi Pin
narayanagvs31-May-06 2:51
narayanagvs31-May-06 2:51 
QuestionCreateEx and Popup window Pin
includeh1031-May-06 2:47
includeh1031-May-06 2:47 
AnswerRe: CreateEx and Popup window Pin
Hamid_RT31-May-06 2:52
Hamid_RT31-May-06 2:52 
GeneralRe: CreateEx and Popup window Pin
includeh1031-May-06 2:56
includeh1031-May-06 2:56 
GeneralRe: CreateEx and Popup window Pin
Hamid_RT31-May-06 3:10
Hamid_RT31-May-06 3:10 
AnswerRe: CreateEx and Popup window Pin
Gautam Jain31-May-06 3:22
Gautam Jain31-May-06 3:22 
GeneralRe: CreateEx and Popup window Pin
includeh1031-May-06 3:32
includeh1031-May-06 3:32 
QuestionPort forwarding Pin
Girish60131-May-06 2:40
Girish60131-May-06 2:40 
AnswerRe: Port forwarding Pin
sunit531-May-06 4:56
sunit531-May-06 4:56 
QuestionHow to place an edit box and dialog box on a window(SDI,MFC based application))in VC++ dot Net-2003 version Pin
Ashutosh Bagaria31-May-06 2:39
Ashutosh Bagaria31-May-06 2:39 
AnswerRe: How to place an edit box and dialog box on a window(SDI,MFC based application))in VC++ dot Net-2003 version Pin
Sebastian Schneider31-May-06 4:14
Sebastian Schneider31-May-06 4:14 
QuestionHi Pin
Hadi Dayvary31-May-06 2:20
professionalHadi Dayvary31-May-06 2:20 
AnswerRe: Hi Pin
ThatsAlok31-May-06 2:28
ThatsAlok31-May-06 2:28 
GeneralRe: Hi Pin
Hadi Dayvary31-May-06 2:37
professionalHadi Dayvary31-May-06 2:37 

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.