Hey Asher,
Your probably right about the string... Here is what I am trying to
do.
This is the Declare I have made:
====
FMODEX.FMOD_System_CreateSound:
Protected Function FMOD_System_CreateSound(ByVal SystemFMOD As Integer,
ByVal name_or_data As String, ByVal mode As Integer, exinfo As integer,
ByRef Sound As Integer) As Integer
#if targetWin32
#elseif targetLinux
#elseif targetMachO
Dim result as Integer
Dim stringPtr as MemoryBlock
stringPtr = FMODEX.stringToMemoryBlock(name_or_data)
Declare Function FMOD_System_CreateSound Lib FMODdylibLocation (ByVal
System As Integer, name_or_data As Ptr, ByVal mode As Integer, ByRef exinfo
As Integer, ByRef Sound As Integer) As Integer
result = FMOD_System_CreateSound( SystemFMOD, stringPtr.CString(0),
mode, exinfo, Sound )
return result
#endif
End Function
====
And this is the "FMODEX.stringToMemoryBlock" helper function,
====
FMODEX.stringToMemoryBlock:
Protected Function stringToMemoryBlock(stringToConvert as String) As
MemoryBlock
Dim memBlock as MemoryBlock
memBlock = NewMemoryBlock( len(stringToConvert) + 1 )
memBlock.CString(0) = stringToConvert
return memBlock
End Function
====
I am totally, clueless at this point. [I am blaming it on my evil cats].
Any ideas, let me know
Peace
Stan
For reference...
Here is the method from the FMODEX Docs.
====
System::createSound
Loads a sound into memory, or opens it for streaming.?
Syntax
FMOD_RESULT System::createSound( char * name_or_data, FMOD_MODE mode,
FMOD_CREATESOUNDEXINFO * exinfo, FMOD::Sound ** sound );
====
This is the VB version of the same Function.
====
Public Declare Function FMOD_System_CreateSound Lib "fmodex.dll" (ByVal
System As Long, ByVal name_or_data As String, ByVal mode As FMOD_MODE, ByRef
exinfo As FMOD_CREATESOUNDEXINFO, ByRef Sound As Long) As FMOD_RESULT
====
NOTES: Although "EXINFO" is a structure, you can also pass it a null [0]
since it is optional.
On 5/20/05 1:00 PM, "realbasic-games-request at lists dot realsoftware dot com"
<realbasic-games-request at lists dot realsoftware dot com> wrote:
> ==================================================
>
> Message: 4
> Subject: Re: Debug App quits without giving a reason.
> From: Asher Dunn <asher at fireyesoftware dot com>
> Date: Thu, 19 May 2005 22:18:45 -0400
>
>
> On May 19, 2005, at 8:11 PM, Stan Rosenbaum wrote:
>
>> 6 ...ple.CoreServices.CarbonCore 0x902c02c0 FontScript + 0x14
>> 7 rbframework.dylib
>> 0x004be8b4 CheckDBCSEncoding(unsigned long) + 0x44
>> 8 rbframework.dylib 0x004bf604 StringDBCSLen + 0xc4
>> 9 ???
>> 0x0000637c FMODEX.stringToMemoryBlock27777767200<MemoryBlock> +
>> 0x8c
>> 10 ???
>> 0x0000613c FMODEX.FMOD_System_CreateSound79077376-1877138908sii&i
+
>> 0xac
>
> What is FMODEX.FMOD_System_CreateSound? Is it a method you defined in
> RB (of a class or module)?
> It appears that RB is crashing trying to convert a string to a
> memoryBlock.
> Seeing the declare would help a lot. Are you passing a CString or a Ptr
> to it? If so, what is the encoding of the string you're passing in?
> What about StringDBCSLen and CheckDBCSEncoding? Are those your's? RB's?
> FMOD's?
>
> Asher Dunn
> --------------------------------------------------------
--
"Well, that is sort like using a 500lb bomb to end a hostage situation.."
My friend Jason from Filmburn Inc. [Best computer animation company in the
world!] describing me 'Going Stan'.
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
|