Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Bug Reports
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Bug Reports Post about errors or bugs encountered.


FMOD and Optimized Compilation


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-27-2007, 06:22 AM
Newbie
 
Join Date: Apr 2007
Location: Manitowoc, WI
Posts: 8
Exclamation FMOD and Optimized Compilation

Hi Erel,

Long time since I've been here! I just got/installed V6 this afternoon and noticed a deficiency in my device that I figured I would create a program for - using the latest version. The app is basically a digital alarm clock that plays a song file when the alarm is triggered. That works fine. The error is when I try to compile the app for the device using the optimized compiler. Attached is a screen shot of the error I received. I have fmod.dll in the Basic4PPC Desktop directory, both FMODDesktop.dll (1.0.2860.24351) and FMODDevice.dll(1.0.2860.24334) in the apps directory.

The Desktop version compiled fine with optimized compiling, but the device version failed. I was able to compile the device version WITHOUT the optimization option checked and it works fine on the device. Did I mess something up here? Or is it maybe a conflict with the V6? Any way, I thought I would post this so you could check it out...

Happy New Year to you and yours!
Attached Images
File Type: jpg Error-sm.jpg (63.2 KB, 27 views)
Reply With Quote
  #2 (permalink)  
Old 12-27-2007, 12:02 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,143
Default

You are right.
The right FMODDesktop can be downloaded here: FMOD library update

Happy New Year
Reply With Quote
  #3 (permalink)  
Old 12-27-2007, 12:15 PM
Newbie
 
Join Date: Apr 2007
Location: Manitowoc, WI
Posts: 8
Default

Thanks Erel!
Reply With Quote
  #4 (permalink)  
Old 12-27-2007, 05:40 PM
Newbie
 
Join Date: Apr 2007
Location: Manitowoc, WI
Posts: 8
Exclamation Well that fixed one problem, But...

Erel, the fix worked - to the extent that I can create an optimized .exe file. The unoptimized file is 176KB and the optimized file is 48K. Unfortunately, it seems that optimization removed some functionality!? The first problem. The app is frmClock with pnlFace and txtTime imposed on pnlFace. Here's the the start-up code:
Code:
Sub App_Start
    fmod.New1
    frmClock.Show
    TimeFormat("HH:mm")
    txttime.Text=Time(Now)
    pnlface.Focus
    tmrupdatetime.Enabled=true
End Sub
As you can see, after it loads up, the focus is set to the panel to remove the blinking cursor from txttime.text On the unoptimized version it works perfectly. The optimized version, the focus stays in txttime. The timer only updates txttime.text once per minute - (i.e. Interval=60000) so I wouldn't think that that would be the culprit?

The second problem is that when the alarm time is reached, the unoptimized version plays the selected sound, the optimized version does not. From the Main Help file>Backword Issues:
Quote:
External libraries (Optimized compiler only) - Objects must have a referenced desktop library.
So I tried adding the FMod.dll as an object to the desktop and I get an error saying 'could not load fmod.dll or one of its dependencies. The Module was expected to contain an assembly manifest.'

Lastly, when the alarm time is reached, a button pops up to shut off the alarm. Again, after the button is pressed, it disappears and the focus is supposed to go back to the panel to keep the blinking cursor out of txttime.

The only thing I changed was the FMODDesktop.dll. Both versions were compiled using the same code, but the optimized one doesn't work properly. So, either I'm not coding this properly, for optimization - or Murphy done got ahold of your optimizing routine! What do you reckon?

Attached is a zip file with everything in the application directory. Includes the source code, OAlarmClock.exe - optimized version and AlarmClock.exe - unoptimized version. Never mind that it can be done cleaner, I just threw this together quick and once I get it working right I'll clean it up!
Reply With Quote
  #5 (permalink)  
Old 12-27-2007, 07:05 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,143
Default

There was a problem with FMODDevice too.
You can download it here: http://www.basic4ppc.com/forum/showthread.php?p=7926

On .Net CF 2.0 (optimized compile) you can't move the focus to a Panel.
You could hide a button behind the panel and set the focus to this button.
Reply With Quote
  #6 (permalink)  
Old 12-27-2007, 10:22 PM
Newbie
 
Join Date: Apr 2007
Location: Manitowoc, WI
Posts: 8
Exclamation Ummm.... Still not right?

I hate to be the bearer of bad news - but...

The hint about putting a button behind the panel solved that problem, but still no joy with sound playback with the optimized version!

I replaced the FMOD*.dll's with the contents of the file linked above, recompiled the app and still no joy! So I tried running the app from the designer on the device and it worked fine. Attached is the current changes if you want to test.

Thanks Erel!
Reply With Quote
  #7 (permalink)  
Old 12-28-2007, 07:36 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,143
Default

What device are you using?
It works fine here.
I've attached FMODDevice.dll with a debugging message.
It should show a msgbox (when playing a song) with False for the optimized compilation and True otherwise.
Please test it on your device.
Attached Files
File Type: zip FMODDevice.zip (3.0 KB, 14 views)
Reply With Quote
  #8 (permalink)  
Old 12-28-2007, 03:24 PM
Newbie
 
Join Date: Apr 2007
Location: Manitowoc, WI
Posts: 8
Red face

OH STUPID ME!!!

Here, I've been faithfully updating all the dll's - ON THE DESKTOP,
and completely forgot to update them on the DEVICE!

I will now crawl back into my hole - after 30 lashes with 4GB SD card...

Thanks Erel!
Reply With Quote
  #9 (permalink)  
Old 12-28-2007, 08:51 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,143
Default

No problem.
It was a pretty interesting bug.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Choose Folder - Optimized Compilation orhan Questions & Help Needed 10 11-05-2008 10:52 AM
optimized compilation manu Questions & Help Needed 4 08-06-2008 07:17 PM
Optimized compilation susu Questions & Help Needed 3 05-13-2008 07:23 AM
Optimized Compilation problem on the device bob Questions & Help Needed 4 03-12-2008 02:05 PM
6.01 Optimized compilation error dpriem Bug Reports 2 01-06-2008 04:42 PM


All times are GMT. The time now is 02:22 PM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0