none
Calling methods in staic lib

    Question

  • Hi,

    I have already go through all win32 and COM apis provided by Metro
    http://msdn.microsoft.com/en-us/library/windows/apps/br205757.aspx
    I am still having doubt on using a static lib from metro app.

    As you know DICOM tool kit is comes in the form of staticlib.
    I have used class's in static lib to parse a DICOM file.
    The class internally uses 'fopen()' to open the file.

    Is there any problem for using it??.

    The static lib also provide some network class's
    can I use that also?

    thanks,

    Bhash

    Wednesday, July 18, 2012 6:30 PM

Answers

  • If your lib links to a Metro style app compliant C runtime you will be able to call standard C functions such as fopen. You can test against the App Cert Kit to confirm. Runtimes older than VC 2012 's will not work.

    Your app will still be subject to the security sandbox and won't have access directories outside of its app data and package.

    Wednesday, July 18, 2012 8:14 PM

All replies

  • If your lib links to a Metro style app compliant C runtime you will be able to call standard C functions such as fopen. You can test against the App Cert Kit to confirm. Runtimes older than VC 2012 's will not work.

    Your app will still be subject to the security sandbox and won't have access directories outside of its app data and package.

    Wednesday, July 18, 2012 8:14 PM
  • Hi Rob,

    I have related question:

    I'm using Metro C# application that is using C++ WinRT component dll. This C++ dll is using static lib.

    In the lib I need to open files. Using ofstream.open or fopen_s I get "Permission Denied" error.

    How can I create "Metro style app compliant C runtime " so I "will be able to call standard C functions such as fopen"

    Thanks,

    Ronit.


    Ronit

    Monday, October 15, 2012 9:06 AM
  • You can only use such functions to open locations that your app has permissions for: the app's installed directory and its app data directories. The app cannot directly access other parts of the file system.

    You can get brokered access to other locations (via file pickers, KnownFolders, etc.). In these cases an external broker process with higher privileges than the app will open the file and provide the data in the file via a StorageFile object. The app can call StorageFile::OpenAsync to get a stream to access the data.

    --Rob

    Tuesday, October 16, 2012 9:01 PM