Click here to Skip to main content
15,909,897 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: tracing DLL in. NET Pin
Abhi Lahare28-Jul-06 2:37
Abhi Lahare28-Jul-06 2:37 
AnswerRe: tracing DLL in. NET Pin
Cedric Moonen28-Jul-06 2:53
Cedric Moonen28-Jul-06 2:53 
GeneralRe: tracing DLL in. NET Pin
Cedric Moonen28-Jul-06 2:57
Cedric Moonen28-Jul-06 2:57 
AnswerRe: tracing DLL in. NET Pin
Eytukan28-Jul-06 7:43
Eytukan28-Jul-06 7:43 
QuestionClosing an application while it is still busy Pin
cv_k3n28-Jul-06 1:51
cv_k3n28-Jul-06 1:51 
AnswerRe: Closing an application while it is still busy Pin
Naveen28-Jul-06 1:58
Naveen28-Jul-06 1:58 
AnswerRe: Closing an application while it is still busy Pin
Cedric Moonen28-Jul-06 2:00
Cedric Moonen28-Jul-06 2:00 
GeneralRe: Closing an application while it is still busy Pin
cv_k3n28-Jul-06 4:21
cv_k3n28-Jul-06 4:21 
Thanks.. I looked up on how to use a thread in my program and i found this article:

To the class (in this example, a CView-derived class), add the following declarations:
<br />
static UINT run(LPVOID p);<br />
void run();<br />
volatile BOOL running;<br />

To start a thread, your handler does
<br />
void CMyView::doInvert()<br />
    {<br />
     running = TRUE;<br />
     AfxBeginThread(run, this);<br />
    }<br />
 <br />
UINT CMyView::run(LPVOID p)<br />
    {<br />
     CMyView * me = (CMyView *)p;<br />
     me->run();<br />
     return 0;<br />
    }<br />
 <br />
void CMyView::run()<br />
   {<br />
     for(int x=y = 0; running && y < image.height; y++)<br />
          for(int x = 0; running && x < image.width; x++)<br />
              changePixel(x, y);<br />
    running = FALSE;<br />
   }<br />

The command to stop the thread is very simple:
<br />
void CMyView::OnStop()<br />
   {<br />
    running = FALSE;<br />
   }


I've tried this out but whenever i run my function, a 'Debug Assertion Failed' dialog pops up. I don't understand why. BTW, i'm working on a dialog based application and i realised the example above is for an SDI application. But it should still work right?
GeneralRe: Closing an application while it is still busy Pin
Eytukan28-Jul-06 7:47
Eytukan28-Jul-06 7:47 
GeneralRe: Closing an application while it is still busy Pin
cv_k3n28-Jul-06 17:03
cv_k3n28-Jul-06 17:03 
QuestionRe: Closing an application while it is still busy Pin
David Crow28-Jul-06 5:00
David Crow28-Jul-06 5:00 
Questiondynamically allocted array question Pin
kitty528-Jul-06 1:22
kitty528-Jul-06 1:22 
AnswerRe: dynamically allocted array question Pin
Cedric Moonen28-Jul-06 1:31
Cedric Moonen28-Jul-06 1:31 
GeneralRe: dynamically allocted array question Pin
Steen Krogsgaard28-Jul-06 1:39
Steen Krogsgaard28-Jul-06 1:39 
GeneralRe: dynamically allocted array question Pin
kitty528-Jul-06 2:08
kitty528-Jul-06 2:08 
GeneralRe: dynamically allocted array question Pin
Cedric Moonen28-Jul-06 2:15
Cedric Moonen28-Jul-06 2:15 
GeneralRe: dynamically allocted array question Pin
kitty528-Jul-06 2:26
kitty528-Jul-06 2:26 
AnswerRe: dynamically allocted array question Pin
Steen Krogsgaard28-Jul-06 1:39
Steen Krogsgaard28-Jul-06 1:39 
GeneralRe: dynamically allocted array question Pin
Cedric Moonen28-Jul-06 1:44
Cedric Moonen28-Jul-06 1:44 
GeneralRe: dynamically allocted array question Pin
Steen Krogsgaard28-Jul-06 1:52
Steen Krogsgaard28-Jul-06 1:52 
GeneralRe: dynamically allocted array question Pin
Cedric Moonen28-Jul-06 1:55
Cedric Moonen28-Jul-06 1:55 
AnswerRe: dynamically allocted array question Pin
Zac Howland28-Jul-06 4:58
Zac Howland28-Jul-06 4:58 
QuestionList Control Help need it........................................ Pin
konstantinos_100028-Jul-06 1:08
konstantinos_100028-Jul-06 1:08 
AnswerRe: List Control Help need it........................................ Pin
Naveen28-Jul-06 1:29
Naveen28-Jul-06 1:29 
GeneralRe: List Control Help need it........................................ Pin
konstantinos_100028-Jul-06 5:22
konstantinos_100028-Jul-06 5:22 

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.