Results 1 to 12 of 12

Thread: Can't find DLL entry point.....user32

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2006
    Posts
    9

    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:
    1. Private Const MF_BYPOSITION = &H400
    2. Private Const MF_REMOVE = &H1000
    3.  
    4. Private Declare Function DrawMenuBar Lib "user32" _
    5.       (ByVal hwnd As Long) As Long
    6.      
    7. Private Declare Function GetMenuItemCount Lib "user32" _
    8.       (ByVal hMenu As Long) As Long
    9.      
    10. Private Declare Function GetSystemMenu Lib "user32" _
    11.       (ByVal hwnd As Long, _
    12.        ByVal bRevert As Long) As Long
    13.        
    14. Private Declare Function RemoveMenu Lib "user32" _
    15.       (ByVal hMenu As Long, _
    16.        ByVal nPosition As Long, _
    17.        ByVal wFlags As Long) As Long
    18.  
    19.  
    20.  
    21. Private Sub Form_Load()
    22.  
    23.    Dim hMenu As Long
    24.    Dim menuItemCount As Long
    25.  
    26.   'Obtain the handle to the form's system menu
    27.    hMenu = GetSystemMenu(Me.hwnd, 0)
    28.  
    29.    If hMenu Then
    30.      
    31.      'Obtain the number of items in the menu
    32.       menuItemCount = GetMenuItemCount(hMenu)
    33.    
    34.      'Remove the system menu Close menu item.
    35.      'The menu item is 0-based, so the last
    36.      'item on the menu is menuItemCount - 1
    37.       Call RemoveMenu(hMenu, menuItemCount - 1, _
    38.                       MF_REMOVE Or MF_BYPOSITION)
    39.    
    40.      'Remove the system menu separator line
    41.       Call RemoveMenu(hMenu, menuItemCount - 2, _
    42.                       MF_REMOVE Or MF_BYPOSITION)
    43.    
    44.      'Force a redraw of the menu. This
    45.      'refreshes the titlebar, dimming the X
    46.       Call DrawMenuBar(Me.hwnd)
    47.  
    48.    End If
    49.    
    50. End Sub
    Last edited by Hack; Apr 19th, 2007 at 07:29 AM. Reason: Added VB Highlight Tags

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Can't find DLL entry point.....user32

    Did you do a formal installation on the target machine or just copy the program over?

  3. #3

    Thread Starter
    New Member
    Join Date
    Jul 2006
    Posts
    9

    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

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    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.

  5. #5

    Thread Starter
    New Member
    Join Date
    Jul 2006
    Posts
    9

    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?

  6. #6
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Can't find DLL entry point.....user32

    Are the versions and service packs identical on both machines?

  7. #7

    Thread Starter
    New Member
    Join Date
    Jul 2006
    Posts
    9

    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?

  8. #8
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    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 PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI 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

  9. #9
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    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.

  10. #10
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    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 PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI 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

  11. #11
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Can't find DLL entry point.....user32

    It would matter if the file is corrupt.

  12. #12
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    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 PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI 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
  •  



Click Here to Expand Forum to Full Width