January 19, 2020, 03:22:47 AM

Author Topic: BlitzmaxNG Win32/64 compile error Byte Ptr to Int  (Read 2286 times)

Offline fielder

  • Jr. Member
  • **
  • Posts: 84
BlitzmaxNG Win32/64 compile error Byte Ptr to Int
« on: June 29, 2017, 07:50:25 AM »
Compile error

Unable to convert from Byte Ptr to Int.

i have this line of code:
Code: [Select]
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...
Code: [Select]
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
Code: [Select]
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.

Offline GW

  • Full Member
  • ***
  • Posts: 173
Re: BlitzmaxNG Win32/64 compile error Byte Ptr to Int
« Reply #1 on: June 29, 2017, 09:33:39 AM »
NG treats void pointers as pointers, vanilla bmax treated them as ints. it's a difference between the 2 versions

Offline Henri

  • Full Member
  • ***
  • Posts: 217
Re: BlitzmaxNG Win32/64 compile error Byte Ptr to Int
« Reply #2 on: June 29, 2017, 11:35:17 AM »
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

Offline markcwm

  • Sr. Member
  • ****
  • Posts: 410
Re: BlitzmaxNG Win32/64 compile error Byte Ptr to Int
« Reply #3 on: June 29, 2017, 08:57:07 PM »
Code: [Select]
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.

Offline fielder

  • Jr. Member
  • **
  • Posts: 84
Re: BlitzmaxNG Win32/64 compile error Byte Ptr to Int
« Reply #4 on: July 03, 2017, 07:04:37 PM »
Code: [Select]
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 :)

Offline col

  • Sr. Member
  • ****
  • Posts: 441
Re: BlitzmaxNG Win32/64 compile error Byte Ptr to Int
« Reply #5 on: July 09, 2017, 06:08:54 PM »
Quote
This 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  ;)
To be is to be perceived.

https://github.com/davecamp