BlitzmaxNG Win32/64 compile error Byte Ptr to Int

Started by fielder, June 29, 2017, 07:50:25

Previous topic - Next topic

fielder

Compile error

Unable to convert from Byte Ptr to Int.

i have this line of code:
Global k32:Int= LoadLibraryA ("kernel32.dll")
how i can make thi sline works for Blitzmax and BlitzmaxNG ? (on standard Bmax i've no issues)
something like:

?NG
Global k32:Byte Ptr= LoadLibraryA ("kernel32.dll")
?Bmax
Global k32:Int= LoadLibraryA ("kernel32.dll")
?

or is a NG bug?

same issue with a lot of "Windows registry access" lines...
Compile Warning: In call to Function RegEnumKey:Int(hKey:Int,idx:Int,Key:Byte Ptr,size:Int). Argument #4 is "Long" but declaration is "Int".


and more:
Unable to convert from Byte Ptr to Int

Global dir:Int
dir=ReadDir(scandir[1])

and in this case if i replace the Int to Byte Ptr.. the application can't be compiled on standard Blitzmax.

GW

NG treats void pointers as pointers, vanilla bmax treated them as ints. it's a difference between the 2 versions

Henri

Hi,

byte ptr works for both, the question is where loadlibrary is defined in blitzmax. If loadlibrary is defined with return type int then byte ptr error occurs. You would need to change the definition to return byte ptr or create seperate .x-file in your app folder where loadlibrary is defined the way you want (your app then uses this version).

-Henri
- Got 01100011 problems, but the bit ain't 00000001

markcwm

Compile Warning: In call to Function RegEnumKey:Int(hKey:Int,idx:Int,Key:Byte Ptr,size:Int). Argument #4 is "Long" but declaration is "Int".
This means you need to use -w option in cmd (overload warnings in NG IDE) then they are ignored and compile continues.

fielder

Quote from: markcwm on June 29, 2017, 20:57:07
Compile Warning: In call to Function RegEnumKey:Int(hKey:Int,idx:Int,Key:Byte Ptr,size:Int). Argument #4 is "Long" but declaration is "Int".
This means you need to use -w option in cmd (overload warnings in NG IDE) then they are ignored and compile continues.
this mean that i will wait to "migrate" to NG version :)

col

QuoteThis means you need to use -w option in cmd (overload warnings in NG IDE) then they are ignored and compile continues.
Or use the tick box in the NG friendly version of the IDE to turn on/off compiler warnings  ;)
https://github.com/davecamp

"When you observe the world through social media, you lose your faith in it."