issue resolved by switching build type to Mach-O and removing the "Lib"
suffix from each of the declares:
#if TargetMachO
dim devices as integer
Declare Function DRCopyDeviceArray Lib "DiscRecording" () as integer
Declare Function CFArrayGetCount Lib "CoreFoundation" (devarray as
integer) as integer
Declare Function CFArrayGetValueAtIndex Lib "CoreFoundation"
(devarray as integer, i as integer) as integer
Declare Function DRDeviceAcquireExclusiveAccess Lib "DiscRecording"
(thedev as integer) as integer
devices = DRCopyDeviceArray()
if CFArrayGetCount(devices) > 0 then
if DRDeviceAcquireExclusiveAccess(CFArrayGetValueAtIndex(devices,
0)) = 0 then
MsgBox "EXCLUSIVE ACCESS TO CD/DVD BURNER ACQUIRED"
else
MsgBox "PROBLEM ACQUIRING EXCLUSIVE ACCESS TO CD/DVD BURNER"
end
else
MsgBox "NO CD/DVD BURNER FOUND"
end
#endif
by the way, does this look leaky? how do i clean up after i'm done
with all the stuff allocated on the heap (1 CFArray and 1 or more
DRDevices)? ...or does rb take care of this for me?
- philip
On May 29, 2005, at 11:31 PM, Philip George wrote:
On May 29, 2005, at 10:17 PM, Philip George wrote:
how can i get similar behavior to roxio toast or itunes where
clicking a 'burn' button allows the next inserted blank cdr to bypass
the finder and be accepted by the app?
actually, i got a carbon test app to so this just now using
DiscRecordingFramework:
OSStatus err;
CFArrayRef devices = DRCopyDeviceArray();
if (CFArrayGetCount(devices) > 0) {
err =
DRDeviceAcquireExclusiveAccess(CFArrayGetValueAtIndex(devices, 0));
if (err == 0) {
// continue with disc burning operations...
} else {
// problem acquiring exclusive access to cd/dvd burner
}
} else {
// no cd/dvd burner found
}
once DRDeviceAcquireExclusiveAccess() is called, inserting a blank
disc is **not** grabbed by the finder as it usually is.
next problem:
how do i translate that little code snippet into rb declares?
this first little piece of it isn't working:
#if TargetMacOS
dim devices as integer
Declare Function DRCopyDeviceArray Lib "DiscRecordingLib" () as
integer
devices = DRCopyDeviceArray()
#endif
i get a runtime exception dialog that there was a shared lib problem.
i tried with Lib "CarbonLib" too. no dice.
any ideas?
- philip
_______________________________________________
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>
_______________________________________________
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>
|