GetProcAddress_() only ASCII

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
RSBasic
Moderator
Moderator
Posts: 1228
Joined: Thu Dec 31, 2009 11:05 pm
Location: Gernsbach (Germany)
Contact:

GetProcAddress_() only ASCII

Post by RSBasic »

Hello

GetProcAddress_() does not work with current PB version because Unicode is always used.
This WinAPI function only works in ASCII mode.

Workarround:

Code: Select all

Import "kernel32.lib"
  GetProcAddress(hModule, lpProcName.p-ascii)
EndImport
@Fred & @freak
Can you always run GetProcAddress_() in ASCI mode, so you don't have to use the workaround code? Thank you
Image
Image
fryquez
Enthusiast
Enthusiast
Posts: 391
Joined: Mon Dec 21, 2015 8:12 pm

Re: GetProcAddress_() only ASCII

Post by fryquez »

Your current workaround would make it impossible to use ordinals instead of strings.

But +1 for a wrapper function that first checks if lpProcName is bigger than a word
and convert the string if needed.
Post Reply