I am trying to create my first userlib program and am having problems.
My "kernel32.decls" file (stripped to show only relevant entry) looks like this (the declaration is on one line - I have inserted the "_" here for readability on the screen):
and my bb code looks like this:
When I run the above, APICall%=1, which I assume means the call has been successful, but SerialNum%=0. I have adapted this from an identical function I created successfully in VB. The only thing I can think that could be causing problems is the difference between Long and Integer variables. Dumb question, but what is the upper limit of the Blitz Integer? If this is a red herring, does anyone have any ideas why SerialNum% is not populated during the call?
My "kernel32.decls" file (stripped to show only relevant entry) looks like this (the declaration is on one line - I have inserted the "_" here for readability on the screen):
.lib "kernel32.dll" GetVolumeInformation%(lpRootPathName$,lpVolumeNameBuffer$,nVolumeNameSize%,lpVolumeSerialNumber%,lpMaximumComponentLength%,lpFileSystemFlags%, _ lpFileSystemNameBuffer$,nFileSystemNameSize%):"GetVolumeInformationA"
and my bb code looks like this:
Temp1$=String$(Chr$(0),255) Temp2$=String$(Chr$(0),255) SerialNum%=0 APICall%=GetVolumeInformation%("C:",Temp1$,Len(Temp1$),SerialNum%,0,0,Temp2$,Len(Temp2$)) Print APICall% Print SerialNum% WaitKey End
When I run the above, APICall%=1, which I assume means the call has been successful, but SerialNum%=0. I have adapted this from an identical function I created successfully in VB. The only thing I can think that could be causing problems is the difference between Long and Integer variables. Dumb question, but what is the upper limit of the Blitz Integer? If this is a red herring, does anyone have any ideas why SerialNum% is not populated during the call?