Click here to Skip to main content
15,919,341 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: MFC Pin
jhwurmbach19-Apr-07 1:42
jhwurmbach19-Apr-07 1:42 
AnswerRe: MFC Pin
CPallini19-Apr-07 1:52
mveCPallini19-Apr-07 1:52 
AnswerRe: MFC Pin
Paresh Chitte19-Apr-07 2:23
Paresh Chitte19-Apr-07 2:23 
AnswerRe: MFC Pin
Maximilien19-Apr-07 2:34
Maximilien19-Apr-07 2:34 
AnswerRe: MFC Pin
Mark Salsbery19-Apr-07 9:06
Mark Salsbery19-Apr-07 9:06 
QuestionCWinThread use Pin
CDRAIN19-Apr-07 1:15
CDRAIN19-Apr-07 1:15 
AnswerRe: CWinThread use Pin
Roger Stoltz19-Apr-07 2:17
Roger Stoltz19-Apr-07 2:17 
AnswerRe: CWinThread use Pin
bob1697219-Apr-07 3:36
bob1697219-Apr-07 3:36 
For starters, you need something like this...

CSomeThread* pThread=(CsomeThread*)AfxBeginThread(RUNTIME_CLASS(CSomeThread));

it's much more advisable to start the thread suspended so you can prep the thread before it takes off to do work...

pThread=(CSomeThread*)AfxBeginThread(RUNTIME_CLASS(CSomeThread),
THREAD_PRIORITY_NORMAL,0,CREATE_SUSPENDED);

// Set up the thread members (if any)

// Then call resume thread to let it loose
pThread->ResumeThread();


However, you have a slight issue with what you are trying to do. As far as I know, most ActiveX controls (if not all) expect to have a parent container so they can feed off of it's ambient properties. There are many different types of COM objects and some aren't designed to need a container. If your COM object is indeed an ActiveX control, it will likely need some sort of container to appease it. If I need to get the functionality of an ActiveX control but don't necessarily want it to show itself, I create a dummy container for it...

// Need a parent container window to host the ActiveX control.
// Make it invisible and popup

CWnd wndInvisible;
CString sWndClass=AfxRegisterWndClass(0);
if (wnd.CreateEx(0,sWndClass,NULL,WS_POPUP,CRect(),NULL,0)) {
// Use the dummy CWnd as a container for the control
}
GeneralRe: CWinThread use Pin
CDRAIN19-Apr-07 4:32
CDRAIN19-Apr-07 4:32 
GeneralRe: CWinThread use Pin
bob1697219-Apr-07 6:33
bob1697219-Apr-07 6:33 
QuestionHow to Change top menu font ? Pin
Atul2319-Apr-07 0:57
Atul2319-Apr-07 0:57 
AnswerRe: How to Change top menu font ? Pin
Hamid_RT19-Apr-07 1:13
Hamid_RT19-Apr-07 1:13 
Questionfile encoding problem Pin
amitmistry_petlad 19-Apr-07 0:28
amitmistry_petlad 19-Apr-07 0:28 
AnswerRe: file encoding problem Pin
Paresh Chitte19-Apr-07 2:14
Paresh Chitte19-Apr-07 2:14 
GeneralRe: file encoding problem Pin
amitmistry_petlad 19-Apr-07 2:45
amitmistry_petlad 19-Apr-07 2:45 
GeneralRe: file encoding problem Pin
Mark Salsbery19-Apr-07 9:33
Mark Salsbery19-Apr-07 9:33 
GeneralRe: file encoding problem Pin
amitmistry_petlad 22-Apr-07 20:31
amitmistry_petlad 22-Apr-07 20:31 
GeneralRe: file encoding problem Pin
Mark Salsbery23-Apr-07 5:12
Mark Salsbery23-Apr-07 5:12 
GeneralRe: file encoding problem Pin
amitmistry_petlad 23-Apr-07 17:30
amitmistry_petlad 23-Apr-07 17:30 
QuestionVC++/MFC Pin
SumitMandal19-Apr-07 0:10
SumitMandal19-Apr-07 0:10 
QuestionRe: VC++/MFC Pin
toxcct19-Apr-07 0:19
toxcct19-Apr-07 0:19 
QuestionVC++/MFC Pin
SumitMandal19-Apr-07 0:08
SumitMandal19-Apr-07 0:08 
AnswerRe: VC++/MFC Pin
Hamid_RT19-Apr-07 1:14
Hamid_RT19-Apr-07 1:14 
AnswerRe: VC++/MFC Pin
Hamid_RT19-Apr-07 1:21
Hamid_RT19-Apr-07 1:21 
QuestionScale control Pin
kasturi_haribabu18-Apr-07 23:48
kasturi_haribabu18-Apr-07 23:48 

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.