5,595,428 Members 47,593 Now Online
XDA Developers Android and Mobile Development Forum

Successfully got my app with restricted API published in store !!

Tip us?
 
ultrashot
Old
#41  
ultrashot's Avatar
Recognized Developer
Thanks Meter 2013
Posts: 1,468
Join Date: May 2009
Location: St.Petersburg
Quote:
Originally Posted by GoodDayToDie View Post
Wait, wouldn't using desktop/tablet libraries (instead of phone libraries) lead to the lookup failing at runtime?

Not that Windows Phone 8 has any such library as coredll.dll (at least, not in System32).
calling non-existing library has a bigger probability of failure
Nokia Lumia 920, Samsung Ativ S (T899 TMOUS, engineering), HTC 8X (partially broken)
Mozart and Titan: Dynamics v2.2 ROM
X1i and HD2: Dynamics v2.4 ROM
http://ultrashot.net
 
Sunius1
Old
#42  
Member
Thanks Meter 22
Posts: 46
Join Date: Aug 2013
If it's native code dynamically linked with a DLL, it will fail to launch. However, if it's managed code, it will throw File Not Found exception only when you try to use an API that comes from an unavaiable assembly/native DLL. As long as you stick to what is available to Windows Phone, it should work just fine.

And yes, coredll.dll won't work on phone .
 
FlashTek95
Old
#43  
Member
Thanks Meter 3
Posts: 59
Join Date: Oct 2011
Quote:
Originally Posted by Sunius1 View Post
If it's native code dynamically linked with a DLL, it will fail to launch. However, if it's managed code, it will throw File Not Found exception only when you try to use an API that comes from an unavaiable assembly/native DLL. As long as you stick to what is available to Windows Phone, it should work just fine.

And yes, coredll.dll won't work on phone .
And how can I find out which dlls are supported respectively which apis are supported?
 
-W_O_L_F-
Old
#44  
-W_O_L_F-'s Avatar
Senior Member
Thanks Meter 450
Posts: 569
Join Date: Jul 2010
Location: Moscow
Quote:
Originally Posted by FlashTek95 View Post
And how can I find out which dlls are supported respectively which apis are supported?
Unpack a ROM, choose a DLL and look into the Export Table.
 
FlashTek95
Old
#45  
Member
Thanks Meter 3
Posts: 59
Join Date: Oct 2011
Quote:
Originally Posted by -W_O_L_F- View Post
Unpack a ROM, choose a DLL and look into the Export Table.
That's what I did now, but either I am using the wrong calls, or `waveOutSetVolume` and `PhoneAudioSetMute` do not work properly.
 
snickler
Old
(Last edited by snickler; 14th February 2014 at 04:47 PM.)
#46  
snickler's Avatar
Recognized Developer
Thanks Meter 372
Posts: 740
Join Date: Aug 2010
Location: Wheeling, WV

 
DONATE TO ME
Quote:
Originally Posted by FlashTek95 View Post
Either I am currently a bit confused, or I don't use the right api signature, as I do always get a DllNotFoundException, using this
Code:
        [DllImport("coredll.dll", CharSet = CharSet.Ansi)]
        private static extern int waveOutSetVolume(IntPtr device, uint volume);
Is this the right signature, or do I have to change it?
Thanks.

That export is in WINMM.dll

EDIT: Err it's in both coredll.dll AND WINMM.dll

EDIT2: Coredll.dll doesn't exist in WP8 so use WinMM.dll

Code:
        [DllImport("winmm.dll", SetLastError = true, CallingConvention = CallingConvention.Winapi)]
        internal static extern int waveOutSetVolume(int uDeviceID, int dwVolume);

        [DllImport("winmm.dll", SetLastError = true, CallingConvention = CallingConvention.Winapi)]
        internal static extern int waveOutSetVolume(IntPtr uDeviceID, int dwVolume);
I can't get it to actually set the volume though :/. The function I created doesn't crash the app, but the volume doesn't get set.
My Apps:
R1ng3d | CloudMuzik V1.5 Now in the MarketPlace for both WP7 and WP8
My Projects and Contributions:
WP8 Registry Tools | Async Wrapper for WP7 Root Tools SDK
My Phones:
Lumia 920 - (Black Update) / Focus v1.3 (7.8 via Dynamics ROM)
Contact
twitter: @sinclairinator | fb for: CloudMuzik | Skype: jsinnie

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes