Newbie problem: control creating problem

Newbie problem: control creating problem

Post by Rui Macie » Fri, 23 Aug 2002 02:18:01



I'm starting to learn how to add controls to a window but I'm having
problems with it.

the WM_CREATE part of my window procedure is:

case WM_CREATE:
   hButton = CreateWindowEx(0, "BUTTON","OK",
        WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON,
        100, 10, 100, 30,
        hWindow, (HMENU)ID_THE_BUTTON,
        GetModuleHandle(NULL), NULL);
  break;

So, can anyone point me out to what I'm doing wrong here?

Thanks in advance
Rui Maciel

 
 
 

Newbie problem: control creating problem

Post by Russ Freema » Fri, 23 Aug 2002 02:46:45



Quote:> I'm starting to learn how to add controls to a window but I'm having
> problems with it.

> the WM_CREATE part of my window procedure is:

> case WM_CREATE:
>    hButton = CreateWindowEx(0, "BUTTON","OK",
>         WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON,
>         100, 10, 100, 30,
>         hWindow, (HMENU)ID_THE_BUTTON,
>         GetModuleHandle(NULL), NULL);
>   break;

What is the problem? (this is always nice to know)

--
russ.
http://www.gipsysoft.com/ - Code, tips and cool stuff!
http://www.gipsysoft.com/qhtm/ - FREE HTML display in a small and light DLL
http://www.gipsysoft.com/ZoomPlus/ - Programmers Zoom Utility on Steroids

 
 
 

Newbie problem: control creating problem

Post by Robert S » Fri, 23 Aug 2002 09:11:11




Quote:>I'm starting to learn how to add controls to a window but I'm having
>problems with it.

>the WM_CREATE part of my window procedure is:

>case WM_CREATE:
>   hButton = CreateWindowEx(0, "BUTTON","OK",
>        WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON,
>        100, 10, 100, 30,
>        hWindow, (HMENU)ID_THE_BUTTON,
>        GetModuleHandle(NULL), NULL);
>  break;

>So, can anyone point me out to what I'm doing wrong here?

>Thanks in advance
>Rui Maciel

At a glance I think the GetModuleHandle(NULL) is to blame. Normally
you use is the hInstance member of the CREATESTRUCT given in the
lParam of the WM_CREATE message.

Robert S.

 
 
 

Newbie problem: control creating problem

Post by Rui Macie » Fri, 23 Aug 2002 10:44:48






> > I'm starting to learn how to add controls to a window but I'm having
> > problems with it.

> > the WM_CREATE part of my window procedure is:

> > case WM_CREATE:
> >    hButton = CreateWindowEx(0, "BUTTON","OK",
> >         WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON,
> >         100, 10, 100, 30,
> >         hWindow, (HMENU)ID_THE_BUTTON,
> >         GetModuleHandle(NULL), NULL);
> >   break;

> What is the problem? (this is always nice to know)

The problem is that the button doesn't show.
 
 
 

1. newbie - tabstrip problems - placing controls on tabs

Hi guys,

I use Visual studio 6 and create a app through the VB app wizard.
I select single document interface
I select the frmOptions.

The form comes with 4 standard tabs with sample frames set on each of them

I can place textfields etc. on the front layer of this - but how do place
them on lower layers.

According to the book VB 6 in 21 days - I just use the Property Pages dialog
box to set pages, tabs and ToolTips - but I don't get it.

- How do I place a textfield or anything else on the other tabs than the one
visible by default.

This code is automatically generated by the wizard and flips between the
various tabs information - but where does it get it's information from - the
picOptions hold some kind of information about the standard frame that is
set - but how does I access this?

---
Private Sub tbsOptions_Click()

    Dim i As Integer
    'show and enable the selected tab's controls
    'and hide and disable all others
    For i = 0 To tbsOptions.Tabs.Count - 1
        If i = tbsOptions.SelectedItem.Index - 1 Then
            picOptions(i).Left = 210
            picOptions(i).Enabled = True
        Else
            picOptions(i).Left = -20000
            picOptions(i).Enabled = False
        End If
    Next

End Sub
---

Thanks for whatever help you can provide me with.

Regards
Soren, Denmark

2. DSVD

3. Problem: Require to create null PWL files or other solution for password syncronization problem

4. How to

5. Problem with VBX control created in DLL

6. no mouse pointer - help!

7. Problem with creating a control panel application

8. Serv2003 gives err 800736b2 (?!)

9. Problems with creating a TEdit control in a Borland Dialog

10. How to fix the problem 429 ActiveX control can't create object

11. Rich Edit Control Printing Problem (like the print preview problem)

12. Problems collapsing Tree control RootItem and a Problem with tree painting

13. ActiveX Control in ActiveX Control, resource problem