locked
Integrate Win32 DLL with Windows Store Apps (XAML C#)

    Question

  • I want to createdirectory in Package.Current.Installlocation in windows store App. The following steps i followed.

    1. Created the windows store App (Vs2013)
    2. Created the Win32 DLL (Visual C++) application (Windows store Support = No).
    3. In win32 application created the function which include "Createdirectory" method with the path of "Exe(Installlocation".
    4. When i access the DLL in windows store app using DLLimport its give "Access denied error"


    Friday, November 21, 2014 5:40 AM

Answers

  • You cannot modify the install location (this is generally true of desktop apps as well: normal users can't write to Program Files).

    Instead you should save application data in your Application Data folders. For small data which the user will want to be consistent on different systems save it in the Roaming folder. For large data or system-specific data save it in the Local folder.

    See Accessing app data with the Windows Runtime for an overview.

    Friday, November 21, 2014 8:32 PM
    Owner

All replies

  • refer to : Creating Windows Runtime components

    在現實生活中,你和誰在一起的確很重要,甚至能改變你的成長軌跡,決定你的人生成敗。 和什麼樣的人在一起,就會有什麼樣的人生。 和勤奮的人在一起,你不會懶惰; 和積極的人在一起,你不會消沈; 與智者同行,你會不同凡響; 與高人為伍,你能登上巔峰。

    Friday, November 21, 2014 5:48 AM
  • So win32 dll cannot be used in windows store Apps?. 
    Friday, November 21, 2014 6:02 AM
  • Hello Ram,

    Win 32 dll is not supported for windows store apps.

    Please refer to ApplicationData Api for storing files and creating folders.

    Friday, November 21, 2014 6:04 AM
  • You can use Win32 dlls in a Windows store app so long as the DLL only uses API which are permitted for Windows store apps. CreateDirectory is allowed, but only to locations the app has access.

    The access denied is because the app is installed to a read only directory. You will need to create your folder elsewhere. A tropical choice is in ApplicationData.Current.RoamingFolder


    Friday, November 21, 2014 7:06 AM
    Owner
  • Hi Rob,

    we can create directory in install location using c++ or win32 application. With reference to following link we can create directory. Can u please help.

    http://msdn.microsoft.com/en-in/library/windows/apps/hh967755.aspx

    Friday, November 21, 2014 8:08 AM
  • You can read the install directory.

    You cannot write to it.

    (You may be able to do so when running from aVS build, but not when fully deployed for production)

    Friday, November 21, 2014 8:48 AM
    Owner
  • Ok. Then we cannot create directory in install location of the application, which we can use to store application images ?

    Friday, November 21, 2014 9:44 AM
  • ApplicationData.Current.LocalFolder can be used to save your application data

    Microsoft Certified Solutions Developer - Windows Store Apps Using C#

    Friday, November 21, 2014 10:03 AM
  • You cannot modify the install location (this is generally true of desktop apps as well: normal users can't write to Program Files).

    Instead you should save application data in your Application Data folders. For small data which the user will want to be consistent on different systems save it in the Roaming folder. For large data or system-specific data save it in the Local folder.

    See Accessing app data with the Windows Runtime for an overview.

    Friday, November 21, 2014 8:32 PM
    Owner