dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: error 1406

  1. #1
    Join Date
    Aug 2005
    Location
    Netherlands, The
    Posts
    2,184

    error 1406

    trieing to create a static control i get this following error; 1406.

    Code:
    	if(!PScreen.Load())
    	{
    		FMain.MsgBox(CJText("Main() -> PScreen -> Load = ") & GetLastError());
    		CJApp.Quit();
    		return;
    	}
    
    class PScreen: public CJPictureBox
    {
    public:
    	PScreen(void): CJPictureBox(&FMain)
    	{
    		Move(FMain.Client());
    	}
    } PScreen;
    
    class CJPictureBox : public CJWnd
    {
    public:
    	CJPictureBox(CJWnd* cParent)
    	{
    		GetClassInfoEx(CJApp.hInstance, "STATIC", &p_Class);
    		p_ExStyle = WS_EX_CLIENTEDGE;
    		p_hPWnd = cParent->Handle();
    		p_Style = WS_VISIBLE | WS_CHILD;
    	}
    
    	~CJPictureBox(void)
    	{
    		Unload();
    	}
    
    	bool Load(void)
    	{
    		return(Create() != NULL);
    	}
    
    	void Unload(void) const
    	{
    		Destroy();
    	}
    } *CJPPictureBox;
    
    class CJWnd
    {
    public:
    	CJWnd(void)
    	{
    		sprintf(p_ClassName, "%x", this);
    		memset(&p_Class, 0, sizeof(p_Class));
    		p_Class.cbSize = sizeof(p_Class);
    		p_Class.cbWndExtra = sizeof(CJWnd*);
    		p_Class.hInstance = CJApp.hInstance;
    		p_Class.lpfnWndProc = p_WndProc;
    		p_Class.lpszClassName = p_ClassName;
    		p_Param = this;
    	}
    
    	HWND Create(void)
    	{
    		return(p_hWnd = CreateWindowEx(p_ExStyle, p_Class.lpszClassName, p_Caption.Str(), p_Style, p_Size.left, p_Size.top, p_Size.right, p_Size.bottom, p_hPWnd, p_hMenu, CJApp.hInstance, p_Param));
    	}
    } *CJPWnd;

  2. #2
    Join Date
    Sep 2004
    Posts
    561

    Re: error 1406

    Could you be a little more specific about the error? I have no idea what you mean when you say you have an error 1406. What are the details surrounding this problem?

  3. #3
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,602

    Re: error 1406

    Quote Originally Posted by Mitsukai
    trieing to create a static control i get this following error; 1406.
    1406 means "Cannot create a top-level child window. " Evidently you're trying to create window with WS_CHILD style, but window parent is NULL.

    BTW, VS gives you nifty tool for system error description lookup - it's a Visual C++ Error Lookup. Use it and be happy. And the same result you get running in console:
    D:\>net helpmsg 1406

    Cannot create a top-level child window.
    Last edited by Igor Vartanov; November 23rd, 2005 at 01:24 PM.
    Best regards,
    Igor

  4. #4
    Join Date
    Sep 2004
    Posts
    561

    Re: error 1406

    Quote Originally Posted by Igor Vartanov
    BTW, VS gives you nifty tool for system error description lookup - it's a Visual C++ Error Lookup. Use it and be happy. And the same result you get running in console:
    Oh... I was searching the help file topics.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)