Click to See Complete Forum and Search --> : SetParent Function causing Overflow (Error 6) in NT?


Colleen
July 23rd, 1999, 09:20 AM
I'm using this Function in my program

Declare Function SetParent Lib "user32" (byval hWndChild as Long, byval hWndNewParent as Long) as Long



This is how it is called.

r% = SetParent(MCOption1(Index).hwnd, MCPanel
(Index).hwnd)



But, when I run the program in NT, I get an Overflow!(error 6) on any screen that has an MCOption control.

Any ideas on why it would work fine in Win 95/98, but not NT?

Chris Eastwood
July 23rd, 1999, 09:40 AM
Just a thought, but could it be because :


r% = SetParent(MCOption1(Index).hwnd, MCPanel(Index).hwnd)




means that 'r%' is an integer and the SetParent call returns a long ?

You are using Option Explicit aren't you ?

Chris Eastwood

CodeGuru - the website for developers
http://www.codeguru.com/vb