|
-
Aug 1st, 2001, 08:26 PM
#1
Thread Starter
New Member
SendDlgItemMessage abends on NT
I have a small piece of code written and compiled in VB6 which works just as designed when used on a Win 95 OS. However when it is placed on an nT OR Win 2000 OS, it fails with a Run Time Error 6 - Overflow. I am posting the code that is having the problem here, and I hope someone will be able to tell me what I'm missing. Thanks in advance!
Function CheckForNameBox(fName As String) As Boolean
Dim iii As Long
Dim hMsgWnd As Long
Dim lBtnhWnd As Long
Dim msgText As String
hMsgWnd = FindWindow(vbNullString, "Print to File")
CheckForNameBox = False
'If/When window found, send filename to dialog
If hMsgWnd <> 0 Then
'It gets here on NT/2000, but chokes on SendDlgItemMEssage
iii = SendDlgItemMessage(hMsgWnd, 1152, WM_SETTEXT, 0, fName)
iii = SendMessage(hMsgWnd, WM_SHOWWINDOW, 0, 0)
lBtnhWnd = FindWindowEx(hMsgWnd, 0, "Button", "OK")
iii = SendMessage(lBtnhWnd, BM_CLICK, 0, 0)
CheckForNameBox = True
End If
End Function
-
Aug 2nd, 2001, 09:36 AM
#2
Fanatic Member
can you post the API call definition as it's declared in your code for me please.....
Crispin
VB6 ENT SP5
VB.NET
W2K ADV SVR SP3
WWW.BLOCKSOFT.CO.UK
[Microsoft Basic: 1976-2001, RIP]
-
Aug 2nd, 2001, 09:42 AM
#3
Thread Starter
New Member
Private Declare Function SendDlgItemMessage Lib "user32" _
Alias "SendDlgItemMessageA" (ByVal hDlg As Integer, ByVal _
nIDDlgItem As Long, ByVal Msg As Long, ByVal wParam_
As Long, ByVal lParam As Any) As Long
-
Aug 2nd, 2001, 09:51 AM
#4
Thread Starter
New Member
Here are the Constants:
Const Max_Path = 260
Const WM_SETTEXT = &HC
Const WM_SHOWWINDOW = &H18
Const WM_LBUTTONUP = &H202
Const WM_LBUTTONDOWN = &H201
Const BM_CLICK = &HF5
I was wondering if these might have different values on NT/2000 or is there a problem with user rights in NT/2000 in regards to executables.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|