It is currently Thu Dec 13, 2018 6:53 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Importing windows libs
PostPosted: Tue Nov 20, 2018 7:15 pm 
Offline
Enthusiast
Enthusiast

Joined: Sat Apr 26, 2003 2:49 pm
Posts: 572
I'm trying to import some functions in comctl32.dll like SetWindowSubclass() to avoid using Openlibary() etc.
I used polib.exe:
polib /out:c:\comctl32.lib /machine:X86 C:\Windows\System32\comctl32.dll

and then import
Code:
Import "comctl32.lib"
   SetWindowSubclass_(hwnd.i, pfnSubclass.i, uIdSubclass.i, dwRefData.i) As "_SetWindowSubclass"
EndImport

Debug SetWindowSubclass_(0, 0, 0, 0)


; OpenWindow(0, 0, 0, 300, 30, "", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
;
; Repeat
; Event = WaitWindowEvent()
;
; Until Event = #PB_Event_CloseWindow


the function works until you uncomment the Openwindow() code, then crashes at the first line.
This is on W732 on W764 works perfect and the function does its job(undecorating and using machine:X64)
PB5.62 - 5.70
Any hints? is this the correct way to do this?


Top
 Profile  
Reply with quote  
 Post subject: Re: Importing windows libs
PostPosted: Wed Nov 21, 2018 5:18 pm 
Offline
Enthusiast
Enthusiast

Joined: Sat Apr 26, 2003 2:49 pm
Posts: 572
If anyone is intetested using the libs in the win sdk with the full decorated name works. It seems there is something wrong with the lib produced by polib.


Top
 Profile  
Reply with quote  
 Post subject: Re: Importing windows libs
PostPosted: Wed Nov 21, 2018 8:19 pm 
Offline
Enthusiast
Enthusiast

Joined: Mon Dec 21, 2015 8:12 pm
Posts: 133
Same, here. But no problem when using polib.exe from current Pelles C package.

BTW: the C:\Windows\System32\comctl32.dll is a legacy one v 5.82, you want the new version 6.0.


Top
 Profile  
Reply with quote  
 Post subject: Re: Importing windows libs
PostPosted: Wed Nov 21, 2018 9:57 pm 
Offline
Enthusiast
Enthusiast

Joined: Sat Apr 26, 2003 2:49 pm
Posts: 572
thanks i'll give it a try


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 14 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye