| | |
Runtime error:453 cannot find dllentrypoint
![]() |
•
•
Join Date: May 2007
Posts: 7
Reputation:
Solved Threads: 0
Hi
I have an application in vb which encountes this two errors:
cannot find dlllentrypoint:setLayered.window attributes in user32.dll
and 2nd
runtime error 91: Object variable or block variable not set.
when i run it on windows 98 , but it works fine with windows XP..
Can any one please help me in this..so that i can run it on both OS..
And also make clear this doubts..
thanx.
I have an application in vb which encountes this two errors:
cannot find dlllentrypoint:setLayered.window attributes in user32.dll
and 2nd
runtime error 91: Object variable or block variable not set.
when i run it on windows 98 , but it works fine with windows XP..
Can any one please help me in this..so that i can run it on both OS..
And also make clear this doubts..
thanx.
•
•
Join Date: May 2007
Posts: 7
Reputation:
Solved Threads: 1
The error: cannot find dlllentrypoint:setLayered.window attributes in user32.dll is caused in Windows 98 because Windows 98 cannot make windows transparent (the SetLayeredWindowAttribute API call is used to make windows or forms transparent).
Windows XP supports transparent windows so it works there.
The only way to make it work in Windows 98 is to remove or comment out all references to the SetLayeredWindowAttributes API call or code it so that it only runs that code if the operating system is Windows 2000/XP/Vista (I'm not sure how to do that right at the moment, but I can find out if you want).
Windows XP supports transparent windows so it works there.
The only way to make it work in Windows 98 is to remove or comment out all references to the SetLayeredWindowAttributes API call or code it so that it only runs that code if the operating system is Windows 2000/XP/Vista (I'm not sure how to do that right at the moment, but I can find out if you want).
•
•
Join Date: May 2007
Posts: 7
Reputation:
Solved Threads: 1
Note: All this code should work in Microsoft Visual Basic 5 or 6. It won't work if you are using the .Net version.
To code it so that the SetLayeredWindowAttributes function is only called if you are running Windows NT and higher you would need to add the following code. This declares the SetLayeredWindowAttributes function, the OSVERSIONINFO type which is used to store the information and the constants used to determine the OS type. It also declares the variable we will use to store whether we can use the function.
In the declaration section of the form you would add (the declaration section is usually up the top of the code window):
In the Form_Load subroutine (which is usually what comes up when you double click the form in the editor) you would add:
The first three lines are used to retrieve the OS version.
The other lines work out if you are using Windows 2000 or higher. If you are it sets CanUseLayered to True otherwise it sets it to False.
You would now need to find all the SetLayeredWindowAttributes calls in your code. They could look something like this:
SetLayeredWindowAttributes has 4 different parts.
The first one, hwnd, is the handle to the form that is being made transparent, this could look like Form1.Hwnd or it could be any variable.
The second, 0, is the transparent colour of the window but is not used.
The third, 255, is the amount of transparency you want, 0 is completly transparent and 255 is completly opaque. This could also be a variable.
The fourth, LWA_ALPHA, is telling it that you want to make it transparent. This could also be the number 2. If it is LWA_COLORKEY or the number 1 then the second option, the transparent color, is used and not the level of tranparency.
You would need to add before each SetLayeredWindowAttributes call the following line:
After each SetLayeredWindowAttributes call you would add:
These just make it that if CanUseLayered is True then it will call the SetLayeredWindowAttributes function. If it is not True then it won't call the function.
It would look something like this:
If you only wanted to comment out the SetLayeredWindowAttributes calls you would just put an apostrophe (') before each line that calls the function.
I hope this helps you.
To code it so that the SetLayeredWindowAttributes function is only called if you are running Windows NT and higher you would need to add the following code. This declares the SetLayeredWindowAttributes function, the OSVERSIONINFO type which is used to store the information and the constants used to determine the OS type. It also declares the variable we will use to store whether we can use the function.
In the declaration section of the form you would add (the declaration section is usually up the top of the code window):
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Private Declare Function GetVersionEx Lib "kernel32.dll" Alias "GetVersionExA" (ByRef lpVersionInformation As OSVERSIONINFO) As Long Private Type OSVERSIONINFO dwOSVersionInfoSize As Long dwMajorVersion As Long dwMinorVersion As Long dwBuildNumber As Long dwPlatformId As Long szCSDVersion As String * 128 ' Maintenance string for PSS usage End Type Private Const VER_PLATFORM_WIN32_NT As Long = 2 Private Const VER_PLATFORM_WIN32_WINDOWS As Long = 1 Private Const VER_PLATFORM_WIN32s As Long = 0 Dim CanUseLayered as Boolean
In the Form_Load subroutine (which is usually what comes up when you double click the form in the editor) you would add:
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Dim OSVersion As OSVERSIONINFO OSVersion.dwOSVersionInfoSize = Len(OSVersion) Call GetVersionEx(OSVersion) If OSVersion.dwPlatformId >= VER_PLATFORM_WIN32_NT Then CanUseLayered = True Else CanUseLayered = False End If
The other lines work out if you are using Windows 2000 or higher. If you are it sets CanUseLayered to True otherwise it sets it to False.
You would now need to find all the SetLayeredWindowAttributes calls in your code. They could look something like this:
SetLayeredWindowAttributes hwnd, 0, 255, LWA_ALPHA or variable = SetLayeredWindowAttributes(hwnd, 0, 50, LWA_ALPHA)
The first one, hwnd, is the handle to the form that is being made transparent, this could look like Form1.Hwnd or it could be any variable.
The second, 0, is the transparent colour of the window but is not used.
The third, 255, is the amount of transparency you want, 0 is completly transparent and 255 is completly opaque. This could also be a variable.
The fourth, LWA_ALPHA, is telling it that you want to make it transparent. This could also be the number 2. If it is LWA_COLORKEY or the number 1 then the second option, the transparent color, is used and not the level of tranparency.
You would need to add before each SetLayeredWindowAttributes call the following line:
If CanUseLayered = True ThenAfter each SetLayeredWindowAttributes call you would add:
End IfThese just make it that if CanUseLayered is True then it will call the SetLayeredWindowAttributes function. If it is not True then it won't call the function.
It would look something like this:
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
If CanUseLayered = True Then SetLayeredWindowAttributes hwnd, 0, 50, LWA_ALPHA End If
If you only wanted to comment out the SetLayeredWindowAttributes calls you would just put an apostrophe (') before each line that calls the function.
I hope this helps you.
![]() |
Similar Threads
- String maniputlation runtime error (C++)
- Runtime Error (Windows NT / 2000 / XP)
- "The Sims" visual C++ runtime error, what shall i do? (Windows Software)
- Visual Runtime Error, Sound Problem, Disabled Norton and more! (Windows NT / 2000 / XP)
- Runtime error ??!! (Windows 95 / 98 / Me)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: Interfacing USB POrts from VB5
- Next Thread: Urgently need help in getting Autonumbering ID. Thanks Alot.
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age application basic beginner birth bmp calculator cd cells.find click client code college component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report save search sendbyte sites sort sql sql2008 sqlserver subroutine tags textbox time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows





