[Done] Polink error

Everything else that doesn't fall into one of the other PB categories.
va!n
Addict
Addict
Posts: 1104
Joined: Wed Apr 20, 2005 12:48 pm

[Done] Polink error

Post by va!n »

The command "SetConsoleDisplayMode_" gives here a polink error

Code: Select all

dwOldMode=0 
Result=GetConsoleDisplayMode_(@dwOldMode) 
hOut=GetStdHandle_(#STD_OUTPUT_HANDLE) 
switch=1 
SetConsoleDisplayMode_(hOut, switch, @dwOldMode) 
Last edited by va!n on Wed May 10, 2006 2:42 am, edited 1 time in total.
va!n aka Thorsten

Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
va!n
Addict
Addict
Posts: 1104
Joined: Wed Apr 20, 2005 12:48 pm

Post by va!n »

polink error with following API call from User32.dll too...

Code: Select all

GetInputDesktop_()
va!n aka Thorsten

Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
Fred
Administrator
Administrator
Posts: 18557
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

GetInputDesktop_() is fixed. But for SetConsoleDisplay() it's not supported in the MS kernel32.lib file, while GetConsoleDisplay() is... Weird, so i removed from the build in PB declaration, you will have to use OpenLibrary()/GetFunction() to fix it.
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

Surely it should be in kernel32.lib. http://msdn.microsoft.com/library/defau ... aymode.asp
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8453
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Post by netmaestro »

Code: Select all

If OpenLibrary(0,"kernel32.dll")
  Debug GetFunction(0,"GetConsoleDisplayMode")
  Debug GetFunction(0,"SetConsoleDisplayMode")
  CloseLibrary(0)
EndIf
The functions are in the dll anyways, but I guess the set version's not available in the lib?

Code: Select all

Import "kernel32.lib"
   GetConsoleDisplayMode(a.l)
   SetConsoleDisplayMode(a.l)
EndImport

 Getconsoledisplaymode(1)
 Setconsoledisplaymode(1)
If you run this snippet you get an unresolved external on SetConsoleDisplayMode, but Get is ok. Comment the Set out and no errors. So it can't be in there.
BERESHEIT
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

But did you test it with Microsoft's lib?
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8453
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Post by netmaestro »

Code: Select all

Import "d:\platform sdk\lib\kernel32.lib"
   GetConsoleDisplayMode(a.l)
   SetConsoleDisplayMode(a.l)
EndImport

Getconsoledisplaymode(1)
Setconsoledisplaymode(1)
Yup. Same deal.
BERESHEIT
traumatic
PureBasic Expert
PureBasic Expert
Posts: 1661
Joined: Sun Apr 27, 2003 4:41 pm
Location: Germany
Contact:

Post by traumatic »

MSDN wrote: Requires Windows Vista or Windows XP.
I guess that's the reason why the lib shipped with PB doesn't support it.
Good programmers don't comment their code. It was hard to write, should be hard to read.
Fred
Administrator
Administrator
Posts: 18557
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

I tested with the kernel32.lib from the VC Express 2005 package which should be uptodate, and it's not supported.
traumatic
PureBasic Expert
PureBasic Expert
Posts: 1661
Joined: Sun Apr 27, 2003 4:41 pm
Location: Germany
Contact:

Post by traumatic »

long live microsoft
Good programmers don't comment their code. It was hard to write, should be hard to read.
va!n
Addict
Addict
Posts: 1104
Joined: Wed Apr 20, 2005 12:48 pm

Post by va!n »

fred wrote:But for SetConsoleDisplay() it's not supported in the MS kernel32.lib file, while GetConsoleDisplay() is... Weird, so i removed from the build in PB declaration, you will have to use OpenLibrary()/GetFunction() to fix it.
PB v4 final:
using "SetConsoleDisplayMode_ " with v4 final, gives a polink error. i think you forgot to delete this command from the list (as it should only work with using import lib)!? I think using the direct API call, should allert something like "unknown command" instead a polink error ^^
va!n aka Thorsten

Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
Fred
Administrator
Administrator
Posts: 18557
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

Fixed.
Post Reply