Delphi 2 & 3 - INT64

Started by DanaPaul,

fredvs

Hi DanaPaul

QuoteIf you want a copy of this quick fix please let me know and I'll e-mail it to you.

With pleasure. fiens@hotmail.com

fredvs

#41
Hi DP

With your new header i get a succesion of "Invalid handle" for each bass function loaded, then the app crash  :-[

NB For EACH function, even with those that im shure are ok.

DanaPaul


QuoteWith your new header i get a succesion of "Invalid handle" for each bass function loaded, then the app crash  :-[

Huh?  Where is this error originating from?  Practically every 4 byte integer is a handle in Windows API.

Do you have "Show Exceptions" enabled in Delphi?

fredvs

#43
Hi DP

QuoteDo you have "Show Exceptions" enabled in Delphi?

I dont see that in Delphi D3 Tools-Environement Options.

The error occur with
Quoteround((loword(BASS_ChannelGetLevel(str))
.

And if i remove that function, the error occur at the first "BASS_ChannelSetPosition" ,if i remove that function, the error occur at the first "BASS_ChannelGetPosition" , if i... :'(


DanaPaul


QuoteI dont see that in Delphi D3 Tools-Environement Options.

Are you seeing any Exceptions with the new header file? There should be plenty.  It would seem odd that your Delphi doesn't show exceptions.

QuoteAnd if i remove that function, the error occur at the first "BASS_ChannelSetPosition" ,if i remove that function, the error occur at the first "BASS_ChannelGetPosition" , if i... :'(

Either Bass.dll didn't load and the handle for the Bass module is (zero) invalid, this should have raised an exception...

Or the Bass channel handle is (zero) invalid and this should have raised an exception as well.

DanaPaul

Fred,

Set a breakpoint at the first line in the Bass.pas header file to be sure that the unit is initializing...

Initialization

  RefCount := 0;
  doLoad_BASS := True;
  BASS_Handle := 0;
  InitProcPointers; { Initialize proc pointers }

fredvs

#46
Hi DP

No, always "handle is not valid".  :-/

(No such problem with your version 03/05/19 23:05 108k and before, perhaps your change in loaddllbass in bassloaddll (or reverse, i dont remember ?))

DanaPaul


QuoteNo, always "handle is not valid".  :-/

No = in reference to what?
Quote(No such problem with your version 03/05/19 23:05 108k and before)

Exceptions are extremely useful when building code, and very mysterious if you are hiding them. Example...

BassLoad
BASS_Init()   <- (except raised, execution stopped)
hChannel = BASS_CreateStream() (this won't execute)

I suspect that your Delphi options are set to hide exceptions, or your code is trapping ALL exceptions (bad practice) or you have installed a component that is doing a poor job of inserting itself as an Exception handler.

fredvs

#48
Hi DP

QuoteNo = in reference to what?

= reference to breakpoint, it dont change nothing.

Sorry, i will seem a beginner with Delphi, but i dont know what you say about
QuoteI suspect that your Delphi options are set to hide exceptions
, i dont see the option, : Tools- Exception... in my Delphi 3 Client-server version even not in my Delphi 2 version...

Quoteor you have installed a component that is doing a poor job of inserting itself as an Exception handler

You make me afraid, MixK have now more than 60.000 lines... :-/

DanaPaul


Quote= reference to breakpoint, it dont change nothing.

Ummm, your app can't use this header file, nor any unit that utilizes Initialization sections, if execution ignores this basic functionality during EXE launch.  These Initialization and Finalization sections equate to API call AddExitProc, or the inverse of :)

I've seen some Delphi components that insert themselves as Application handlers, some do a better job than others...

Application.OnException
Application.OnExecute
Application.OnHint
Application.OnMessage
etc...

Improper use of these functions can adversely affect your application(s).

fredvs

Hi DP.

What is this option "tools-exception...".

I have noted that with my d3, i cant run and debug big apps.
I have to compiled it, close delphi, run the exe, see the debug then, cose the app, reload delphi, change the wrong code, etc...

DanaPaul


QuoteWhat is this option "tools-exception...".

When running apps in the Delphi IDE this option controls whether all Exceptions stop and display a dialog box, or only untrapped exceptions.  The latter being normal behavour when the app is compiled and run outside of the IDE.

QuoteI have noted that with my d3, i cant run and debug big apps.
I have to compiled it, close delphi, run the exe, see the debug then, cose the app, reload delphi, change the wrong code, etc...

This is a seriuos issue.  I'd solve this, or make smaller apps.

fredvs

Hi dp

QuoteWhen running apps in the Delphi IDE this option controls whether all Exceptions stop and display a dialog box, or only untrapped exceptions.  The latter being normal behavour when the app is compiled and run outside of the IDE.


OK perfect, i agree, but please say me where i can change that option with delphi, where is that checkbox...

QuoteI'd solve this,


Hummm, yes, congratulation, and how... :-/

DanaPaul


Quotei dont see the option, : Tools- Exception... in my Delphi 3 Client-server version even not in my Delphi 2 version...

Ummm, how 'bout "Break On Exception" in D2 :)

DanaPaul


QuoteHummm, yes, congratulation, and how... :-/

Rebuild the app, unit by unit, component by component, and test[/u] it every step of the way.  This will isolate the probelm area.

fredvs

#55
Thanks DP

I agree totaly with you.

I dont know if you have test the last release of MixK.
http://members.lycos.co.uk/mixk/

It is compiled with one of your bass.pas, basswma.pas, basscd.pas headers (20/05/03).

On my pc, i dont have find any more exceptions, it is only if i recompile it with your new release that i get this "Handle is not valid" messages...

But perhaps on your pc, you get also those "invalid handle" messages with your old header...

DanaPaul


QuoteOn my pc, i dont have find any more exceptions, it is only with your new release that i get this "Handle is not valid" messages...

Then I think that we agree to disagree :)

QuoteBut perhaps on your pc, you get also those "invalid handle" messages with your old header...

Nope, sorry.  Negative answer for both headers, new and old. :)

DanaPaul

However, I can probably tell you where your ap is having a problem (you can't debug so, in that vein...)

fChannel := BASS_StreamCreateFile()
if fChannel = 0 then
  fChannel := BASS_WMA_StreamCreateFile()
if fChannel = 0 then
  fChannel := BASS_MusicLoad()

Neither BASS_WMA_StreamCreateFile nor BASS_MusicLoad will execute if Bass returns a nil result for BASS_StreamCreateFile.  IE: The media format wasn't supported.

Make sense? :)

fredvs

Hi DP
QuoteNope, sorry.  Negative answer for both headers, new and old.  

Humm, are you token about MixK or your header on your pc ( the relase on the net is with your old release just before you have changed bassdllload into loadbassdll)?

fredvs

#59
Hi DP

QuotefChannel := BASS_StreamCreateFile()
if fChannel = 0 then
 fChannel := BASS_WMA_StreamCreateFile()
if fChannel = 0 then
 fChannel := BASS_MusicLoad()

It is exactly what i use in my app ("fChannel" is "Str").
What have i to change and how can you see the source ?