CreateThread Problem 
Author Message
 CreateThread Problem

I am writing codes for the CreateThread API. However, when I run the debug.
It always inform me with the following:

"Platform Manager cannot create the communication streams needed by the
de{*filter*}."

What's wrong with this?  My code is as follows:

----------------------------------------------------------------------------
---------------------------------------------------

// fffDlg.cpp : implementation file
//

#include "stdafx.h"
#include "fff.h"
#include "fffDlg.h"
#include "Winbase.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

unsigned long _cdecl Test(void*);

////////////////////////////////////////////////////////////////////////////
/
// CFffDlg dialog

CFffDlg::CFffDlg(CWnd* pParent /*=NULL*/)
 : CDialog(CFffDlg::IDD, pParent)
{
 //{{AFX_DATA_INIT(CFffDlg)
  // NOTE: the ClassWizard will add member initialization here
 //}}AFX_DATA_INIT
 // Note that LoadIcon does not require a subsequent DestroyIcon in Win32
 m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);

Quote:
}

void CFffDlg::DoDataExchange(CDataExchange* pDX)
{
 CDialog::DoDataExchange(pDX);
 //{{AFX_DATA_MAP(CFffDlg)
  // NOTE: the ClassWizard will add DDX and DDV calls here
 //}}AFX_DATA_MAP

Quote:
}

BEGIN_MESSAGE_MAP(CFffDlg, CDialog)
 //{{AFX_MSG_MAP(CFffDlg)
 ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
 //}}AFX_MSG_MAP
END_MESSAGE_MAP()

////////////////////////////////////////////////////////////////////////////
/
// CFffDlg message handlers

BOOL CFffDlg::OnInitDialog()
{
 CDialog::OnInitDialog();

 // Set the icon for this dialog.  The framework does this automatically
 //  when the application's main window is not a dialog
 SetIcon(m_hIcon, TRUE);   // Set big icon
 SetIcon(m_hIcon, FALSE);  // Set small icon

 CenterWindow(GetDesktopWindow()); // center to the hpc screen

 // TODO: Add extra initialization here

 return TRUE;  // return TRUE  unless you set the focus to a control

Quote:
}

void CFffDlg::OnButton1()
{
 // TODO: Add your control notification handler code here
 HANDLE check=::CreateThread(NULL,0,Test,NULL,0,NULL);

Quote:
}

unsigned long _cdecl Test(void*)
{
 MessageBox(NULL,_T("ff"),0,0);
 return(10);

Quote:
}

----------------------------------------------------------------------------
---------------------------------------------------

Any comments?

Best Regards,
Derek



Sat, 12 Jun 2004 15:02:38 GMT  
 CreateThread Problem
Derek,

may be you have incorrect Platform Manager settings?

Best regards,
Alex.


Quote:
> I am writing codes for the CreateThread API. However, when I run the
debug.
> It always inform me with the following:

> "Platform Manager cannot create the communication streams needed by the
> de{*filter*}."

> What's wrong with this?  My code is as follows:

> --------------------------------------------------------------------------
--
> ---------------------------------------------------

> // fffDlg.cpp : implementation file
> //

> #include "stdafx.h"
> #include "fff.h"
> #include "fffDlg.h"
> #include "Winbase.h"

> #ifdef _DEBUG
> #define new DEBUG_NEW
> #undef THIS_FILE
> static char THIS_FILE[] = __FILE__;
> #endif

> unsigned long _cdecl Test(void*);

////////////////////////////////////////////////////////////////////////////

- Show quoted text -

Quote:
> /
> // CFffDlg dialog

> CFffDlg::CFffDlg(CWnd* pParent /*=NULL*/)
>  : CDialog(CFffDlg::IDD, pParent)
> {
>  //{{AFX_DATA_INIT(CFffDlg)
>   // NOTE: the ClassWizard will add member initialization here
>  //}}AFX_DATA_INIT
>  // Note that LoadIcon does not require a subsequent DestroyIcon in Win32
>  m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
> }

> void CFffDlg::DoDataExchange(CDataExchange* pDX)
> {
>  CDialog::DoDataExchange(pDX);
>  //{{AFX_DATA_MAP(CFffDlg)
>   // NOTE: the ClassWizard will add DDX and DDV calls here
>  //}}AFX_DATA_MAP
> }

> BEGIN_MESSAGE_MAP(CFffDlg, CDialog)
>  //{{AFX_MSG_MAP(CFffDlg)
>  ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
>  //}}AFX_MSG_MAP
> END_MESSAGE_MAP()

////////////////////////////////////////////////////////////////////////////

- Show quoted text -

Quote:
> /
> // CFffDlg message handlers

> BOOL CFffDlg::OnInitDialog()
> {
>  CDialog::OnInitDialog();

>  // Set the icon for this dialog.  The framework does this automatically
>  //  when the application's main window is not a dialog
>  SetIcon(m_hIcon, TRUE);   // Set big icon
>  SetIcon(m_hIcon, FALSE);  // Set small icon

>  CenterWindow(GetDesktopWindow()); // center to the hpc screen

>  // TODO: Add extra initialization here

>  return TRUE;  // return TRUE  unless you set the focus to a control
> }

> void CFffDlg::OnButton1()
> {
>  // TODO: Add your control notification handler code here
>  HANDLE check=::CreateThread(NULL,0,Test,NULL,0,NULL);
> }

> unsigned long _cdecl Test(void*)
> {
>  MessageBox(NULL,_T("ff"),0,0);
>  return(10);
> }

> --------------------------------------------------------------------------
--
> ---------------------------------------------------

> Any comments?

> Best Regards,
> Derek



Sat, 12 Jun 2004 20:13:37 GMT  
 CreateThread Problem
You could also try the following:

Uninstall the Common Components of eVT (*only* the common components -- it
will tell you that things won't work any more; don't worry about that for
now).

Reboot

Reinstall the Common Components

Paul T.


Quote:
> Derek,

> may be you have incorrect Platform Manager settings?

> Best regards,
> Alex.



> > I am writing codes for the CreateThread API. However, when I run the
> debug.
> > It always inform me with the following:

> > "Platform Manager cannot create the communication streams needed by the
> > de{*filter*}."

> > What's wrong with this?  My code is as follows:

> --------------------------------------------------------------------------
> --
> > ---------------------------------------------------

> > // fffDlg.cpp : implementation file
> > //

> > #include "stdafx.h"
> > #include "fff.h"
> > #include "fffDlg.h"
> > #include "Winbase.h"

> > #ifdef _DEBUG
> > #define new DEBUG_NEW
> > #undef THIS_FILE
> > static char THIS_FILE[] = __FILE__;
> > #endif

> > unsigned long _cdecl Test(void*);

////////////////////////////////////////////////////////////////////////////

- Show quoted text -

Quote:
> > /
> > // CFffDlg dialog

> > CFffDlg::CFffDlg(CWnd* pParent /*=NULL*/)
> >  : CDialog(CFffDlg::IDD, pParent)
> > {
> >  //{{AFX_DATA_INIT(CFffDlg)
> >   // NOTE: the ClassWizard will add member initialization here
> >  //}}AFX_DATA_INIT
> >  // Note that LoadIcon does not require a subsequent DestroyIcon in
Win32
> >  m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
> > }

> > void CFffDlg::DoDataExchange(CDataExchange* pDX)
> > {
> >  CDialog::DoDataExchange(pDX);
> >  //{{AFX_DATA_MAP(CFffDlg)
> >   // NOTE: the ClassWizard will add DDX and DDV calls here
> >  //}}AFX_DATA_MAP
> > }

> > BEGIN_MESSAGE_MAP(CFffDlg, CDialog)
> >  //{{AFX_MSG_MAP(CFffDlg)
> >  ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
> >  //}}AFX_MSG_MAP
> > END_MESSAGE_MAP()

////////////////////////////////////////////////////////////////////////////

- Show quoted text -

Quote:
> > /
> > // CFffDlg message handlers

> > BOOL CFffDlg::OnInitDialog()
> > {
> >  CDialog::OnInitDialog();

> >  // Set the icon for this dialog.  The framework does this automatically
> >  //  when the application's main window is not a dialog
> >  SetIcon(m_hIcon, TRUE);   // Set big icon
> >  SetIcon(m_hIcon, FALSE);  // Set small icon

> >  CenterWindow(GetDesktopWindow()); // center to the hpc screen

> >  // TODO: Add extra initialization here

> >  return TRUE;  // return TRUE  unless you set the focus to a control
> > }

> > void CFffDlg::OnButton1()
> > {
> >  // TODO: Add your control notification handler code here
> >  HANDLE check=::CreateThread(NULL,0,Test,NULL,0,NULL);
> > }

> > unsigned long _cdecl Test(void*)
> > {
> >  MessageBox(NULL,_T("ff"),0,0);
> >  return(10);
> > }

> --------------------------------------------------------------------------
> --
> > ---------------------------------------------------

> > Any comments?

> > Best Regards,
> > Derek



Wed, 16 Jun 2004 00:21:24 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. CreateThread Problems ...

2. CreateThread Problem

3. Createthread problems ...

4. CreateThread problems

5. CreateThread problem

6. problem with CreateThread in the InProc server.

7. Problem with CreateThread ?

8. Problem with createThread in VC5++ and VC6++ and stdcall

9. Problem with call to CreateThread

10. CreateThread/AfxBeginThread problem

11. Problem to CreateThread

12. Problem in using Structure as thread argument in CreateThread()

 

 
Powered by phpBB® Forum Software