|
-
Apr 19th, 2007, 06:54 AM
#1
Thread Starter
New Member
Can't find DLL entry point.....user32
I am using Vb6 and trying to hide or disable the form close button.
The code I am using is below.
On my development machine (WinXP sp2.0) this works but on the target machine (WinXP sp2.0) I get the following error
Can't find DLL entrypoint GetSystemMenu in user32.
Can any body help!!
vb Code:
Private Const MF_BYPOSITION = &H400
Private Const MF_REMOVE = &H1000
Private Declare Function DrawMenuBar Lib "user32" _
(ByVal hwnd As Long) As Long
Private Declare Function GetMenuItemCount Lib "user32" _
(ByVal hMenu As Long) As Long
Private Declare Function GetSystemMenu Lib "user32" _
(ByVal hwnd As Long, _
ByVal bRevert As Long) As Long
Private Declare Function RemoveMenu Lib "user32" _
(ByVal hMenu As Long, _
ByVal nPosition As Long, _
ByVal wFlags As Long) As Long
Private Sub Form_Load()
Dim hMenu As Long
Dim menuItemCount As Long
'Obtain the handle to the form's system menu
hMenu = GetSystemMenu(Me.hwnd, 0)
If hMenu Then
'Obtain the number of items in the menu
menuItemCount = GetMenuItemCount(hMenu)
'Remove the system menu Close menu item.
'The menu item is 0-based, so the last
'item on the menu is menuItemCount - 1
Call RemoveMenu(hMenu, menuItemCount - 1, _
MF_REMOVE Or MF_BYPOSITION)
'Remove the system menu separator line
Call RemoveMenu(hMenu, menuItemCount - 2, _
MF_REMOVE Or MF_BYPOSITION)
'Force a redraw of the menu. This
'refreshes the titlebar, dimming the X
Call DrawMenuBar(Me.hwnd)
End If
End Sub
Last edited by Hack; Apr 19th, 2007 at 07:29 AM.
Reason: Added VB Highlight Tags
-
Apr 19th, 2007, 07:30 AM
#2
Re: Can't find DLL entry point.....user32
Did you do a formal installation on the target machine or just copy the program over?
-
Apr 19th, 2007, 07:50 AM
#3
Thread Starter
New Member
Re: Can't find DLL entry point.....user32
Just copied the program over. I created a new project with only this code in it -ran it ok on dev PC then copy and paste onto target.
Thanks
-
Apr 19th, 2007, 07:54 AM
#4
Re: Can't find DLL entry point.....user32
The only way copying will work is if VB itself is installed on the machine.
You must create a form installation and setup package, send the package to the desired machine, and have the user of the machine run the resulting Setup.exe to install your program.
-
Apr 19th, 2007, 10:39 AM
#5
Thread Starter
New Member
Re: Can't find DLL entry point.....user32
Thanks for the reply. I have VB installed on both machines. I can copy the project on to either machine hit F5 and it runs no problem on the first PC. On the second it falls over at the hmenu = getsystemmenu(me.hwnd,0).
User32.dll must be present on the machine and there is but a single version of it -right?
-
Apr 19th, 2007, 10:52 AM
#6
Re: Can't find DLL entry point.....user32
Are the versions and service packs identical on both machines?
-
Apr 19th, 2007, 11:13 AM
#7
Thread Starter
New Member
Re: Can't find DLL entry point.....user32
Yes -same VB6 install, both XP sp2.
What us user32? Does it install with VB or belong to windows?
-
Apr 19th, 2007, 11:34 AM
#8
Re: Can't find DLL entry point.....user32
User32.dll is a Windows core and basic dll. Its on all versions of Windows.
See here for the definition and specifics.
http://allapi.mentalis.org/apilist/GetSystemMenu.shtml
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Apr 19th, 2007, 12:09 PM
#9
Re: Can't find DLL entry point.....user32
Compare the date/time stamp and size of user32.dll on the machine without the problem and the user32.dll file on the machine with the problem.
-
Apr 19th, 2007, 12:16 PM
#10
Re: Can't find DLL entry point.....user32
Its shouldnt matter as the API call is available in versions of Windos back to NT 3.1 and 95
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Apr 19th, 2007, 12:25 PM
#11
Re: Can't find DLL entry point.....user32
It would matter if the file is corrupt.
-
Apr 19th, 2007, 12:27 PM
#12
Re: Can't find DLL entry point.....user32
Would a corrupt file show a modification/revision version change?
If it was corrupt then there would be more appearant "issues" thoughout all of his Windows, no?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
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
|