• 0

VS Reference with exclamation mark


Question

Hello gang,

 

I found this code ( http://www.getcodesamples.com/src/5D67423E ) that returns some of the audio data so I can create visualizations with c#.  The DLL works find when included with a Windows 8 Store app, but with a desktop app (Frameworks 4.0 or 4.5) I get the yellow exclamation mark next to the Reference in the parent project.

 

Any ideas what I am doing wrong?  The MMAudioPlayer is C++, which I do no know.

Link to comment
https://www.neowin.net/forum/topic/1191993-vs-reference-with-exclamation-mark/
Share on other sites

18 answers to this question

Recommended Posts

  • 0
  On 09/12/2013 at 16:55, Eric said:

That usually means it's not a valid CLR reference. You may need to change the platform the audio player is set to build for.

 

Eric,

 

I found this article that I believe is what you are speaking about: http://msdn.microsoft.com/en-us/library/ms185328.aspx

 

Here is my current config for this new project.  MMAudioPlayer is the component that is okay if included in a Win8 Store app, which is also defined as "x86"  Since both of these are the same I feel that I am still wrong, or not getting what you are telling me.

 

Build Configuration:  http://imgur.com/VKeQk50

  • 0
  On 09/12/2013 at 17:35, Eric said:

Hmm... the config looks ok from here. I will try downloading the MMAudioPlayer later and see what I can coerce it into doing. Is it set to output CLR in the C++ config? (/clr command line option)

 

Is this the command line option you are speaking about?  (again, I appologize for my lack of C++ knowledge)

 

Settings: http://imgur.com/THuICrX

  • 0

There's a setting under the General tab for "Common Language Runtime Support" that controls it but I think you can just add the /clr to that dialog too. It should add an external reference for mscorlib.dll. It's likely already set that way if you have it working on the Windows Store side. It looks like Windows Store DLLs have different references.

  • 0
  On 09/12/2013 at 21:59, Eric said:

There's a setting under the General tab for "Common Language Runtime Support" that controls it but I think you can just add the /clr to that dialog too. It should add an external reference for mscorlib.dll. It's likely already set that way if you have it working on the Windows Store side. It looks like Windows Store DLLs have different references.

 

 

Eric,

 

Thank you very much for your time and help.  I will look for the setting, but I would also like to know if there is anywhere specific in the command line where the: /clr switch should be placed?

 

Have a great evening.

  • 0

You probably don't have matching targets for the DLL and your desktop project. You can get yellow bangs if there is a mismatch between referenced assemblies and your project. Normally it is something like .net 3.5 vs .net 4.5. In your case, I'm not exactly sure _what_ the windows Windows 8 store app target would be (but probably something different from .net 4.5). I did find this though and perhaps it will work for you:

 

http://msdn.microsoft.com/en-us/library/windows/apps/jj856306.aspx

  • 0

It can go anywhere under Command Line I believe but you can also turn it on in the General tab by changing that setting.

post-175510-0-62737000-1386683456.png

Is there any way to download the zip of that project? It tells me it hasn't been published.

EDIT: I downloaded the source files individually and dumped them into a CLR class library project and it fails to compile miserably for me.

I don't know very much at all about C++ CLR or DirectX myself. :(

  • 0
  On 10/12/2013 at 13:51, Eric said:

It can go anywhere under Command Line I believe but you can also turn it on in the General tab by changing that setting.

attachicon.gifScreenshot (8).png

Is there any way to download the zip of that project? It tells me it hasn't been published.

EDIT: I downloaded the source files individually and dumped them into a CLR class library project and it fails to compile miserably for me.

I don't know very much at all about C++ CLR or DirectX myself. :(

 

No worries Eric, neither do I.   I am unable to add anything to the command line,,, don't know why.  Nor does the "Common Language Runtime Support" option exist for me.  I am using VS 2013, and I see you have 2013.  So that could be the issue.

  • 0
  On 10/12/2013 at 15:47, Eric said:

Have you looked at NAudio? I don't think it supports Windows Store projects but you could always abstract your audio into interfaces and use different engines for desktop/Metro.

 

I did take a brief look at NAudio, but had to use the MMAudio because it worked for Win Store.... ah, the joy of various components based on platform.  I may have to look back at NAudio, thanks for the reminder

  • 0

So, I tried the MMAudioPlayer library out myself to see what exactly was going on (including installing VS2013; creating a Windows Runtime Component Library; incorporating in the MMAudioPlayer sources). It turns out that the library code for MMAudioPlayer is Windows Runtime (WINRT) platform code (http://en.wikipedia.org/wiki/C%2B%2B/CX ; http://en.wikipedia.org/wiki/Windows_Runtime). This means that it is compiled as an unmanaged DLL; whereas, your desktop c# app is .net or common language runtime (CLR) code. The two can't inter-operate under normal circumstances. At the very least you'd have to jump through hoops to do it.

 

I played around with the options try to make MMaudioPlayer compiled as an CLR dll, however, it doesn't work because some of the used components used by MMAudioPlayer are only available via the native C++:

Error 2 error C1189: #error :  ERROR: Concurrency Runtime is not supported when compiling /clr. C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\concrt.h 26 1 MMAudioPlayer
Moreover, it looks like when you developing Windows Store apps, it uses something called XAML (http://en.wikipedia.org/wiki/Windows_Runtime_XAML_Framework). I'm not sure how it work internally, but that layer let's you use c# code in non-desktop apps.

 

 

See the last post here (don't bother with the tlbimp.exe, it doesn't work):

http://stackoverflow.com/questions/14028713/could-not-add-reference-to-winrt-c-dll-project

  • 0

The MMAudioPlayer source isn't unmanaged, it's essentially an interop library that lets you access DirectX's XAudio2 in managed code. Windows Store projects have an option to create something similar to a library called a runtime component. The project appears to be unmanaged but it's not. It has a manifest file that specifies how other projects can consume it.

XAML is an XML subset that you use to create user interface elements. It doesn't have anything to do with C++ or DLLs. It's common to WPF, Silverlight and Metro.

  • 0
  On 11/12/2013 at 02:53, Eric said:

The MMAudioPlayer source isn't unmanaged, it's essentially an interop library that lets you access DirectX's XAudio2 in managed code. Windows Store projects have an option to create something similar to a library called a runtime component. The project appears to be unmanaged but it's not. It has a manifest file that specifies how other projects can consume it.

XAML is an XML subset that you use to create user interface elements. It doesn't have anything to do with C++ or DLLs. It's common to WPF, Silverlight and Metro.

 

All C++/Cx code by definition is unmanaged. It's literally native C++ code with extensions (did you read the links I sent?). If it weren't, it would be compiled into CLR byte code and it is not. You can verify this by running it through an x86 disassembler* as well as attempting to run it through CLR bytecode disassembler**. The former will work, the latter will fail. With Windows Runtime Component projects you use the /Zx switch in VS so that that you can generate metadata files that operate essentially as a managed interfaces/ABIs for WINRT projects to use (e.g. store apps). These interfaces actually are managed code, or rather, in almost the same format as what you would see in CLR bytecode (e.g. so they a readable by a CLR disassembler).

 

Here's the problem, a Windows Runtime Component project's generated metadata interface file is not readable by a regular winforms or CLI C# project even though the interfaces are almost the same. Moreover, you can't reference the DLL directly because it is all native code. So you are SOL from what I can see. I don't believe there is a way around this. And I'm sure MS has some sound technical reasons for this (or just deprecation or simply no good reason at all).

 

Finally, let me clarify exactly what I was talking about w.r.t. XAML. Windows 8 has an newer XAML layer called Jupiter which allows WPF applications to interface with WINRT code. Ergo, you can create an XAML WPF C# project and then _use_ or _reference_ Runtime Component Library Project DLLs. This is how XAML is related to the DLL issue...

 

Don't believe me about the managed/unmanaged code? Here's a VS2013 C++ Windows Runtime Component project to build MMAudioPlayer (it also has pre-built DLLs) so you can fire up a disassembler and check for yourself:

https://www.dropbox.com/sh/amjbnnnkmhz1u3i/l3syTkacc3

 

* objdump, ollydbg, idapro

** ILSpy, .net reflector

  • 0
  On 11/12/2013 at 04:01, snaphat (Myles Landwehr) said:

 And I'm sure MS has some sound technical reasons for this (or just deprecation or simply no good reason at all).

DEPRECATE ALL THE THINGS seems to be the motto at Microsoft these days. Especially with everything .NET. Heck I heard Windows 8.1 deprecated a lot of Windows 8 APIs already!

  • Like 1
  • 0
  On 11/12/2013 at 21:37, Andre S. said:

DEPRECATE ALL THE THINGS seems to be the motto at Microsoft these days. Especially with everything .NET. Heck I heard Windows 8.1 deprecated a lot of Windows 8 APIs already!

 

When will they deprecate 32-bit executables ;-)

This topic is now closed to further replies.
  • Posts

    • I think that the last game I bought on day-one was something like Ghost of Tsushima. I've come to realise that I don't have enough time (or sometimes inclination) to game as much as I used to, and I've got plenty of games to keep me occupied if I do decide to play. So I don't see the need to buy a game when it first releases - I wait until it goes on sale. If I'm really excited about a game and the price is under £50 then I would consider it, but anything over that price point gets ignored until the price comes down.
    • For the foreseeable that is your choice. I'm interested tom try one, my wife was very pleased because one she is anti-social and driver chat annoys her and two more seriously there is a long history of drivers abusing women, it's rare, but it happens and more than it should. Sometimes she needs to get a late taxi and she says it may make her feel safer.
    • 5800x3d was chopped because it was too good, why bother releasing a new mid range.
    • Was it bad, sure, but I got it on PC so it was nowhere near as bad as the PS4/XBO versions. Besides, I spent around 200hrs in there and have yet to play the expansion for it. All in all I think I got my monies worth. Maybe I was lucky and didn't run into anything game breaking like others. Either way, $60 is my limit for a game, the point is I'm not going over that no matter what the title is or how much I want to play it. Thank god I don't suffer from FOMO.
    • spwave 0.9.0-1 by Razvan Serea spwave is a cross-platform audio editor designed for research and advanced analysis. It supports a wide range of audio formats, including WAV, AIFF, MP3, Ogg Vorbis, FLAC, ALAC, raw PCM, and more via plug-ins. spwave offers precise editing tools such as zoom, crop, fade in/out, gain adjustment, and region extraction. It enables detailed spectral and phase analysis and supports unlimited undo/redo. Users can drag and drop files, edit metadata, save labeled regions, and view multiple synchronized waveforms. Internally, spwave processes audio in 64-bit precision, ensuring high accuracy. It runs on Windows, macOS, and Linux, making it a reliable and flexible tool for audio research and editing. spwave has following features: Support for multiple platforms: Windows, macOS, Linux (Motif, gtk), etc. Support for WAV, AIFF, MP3, Ogg Vorbis, FLAC, ALAC, raw, and text files by using plug-ins. Support for many bits/samples: 8bits, 16bits, 24bits, 32bits, 32bits float, 64bits double. Converting the sampling frequency and the bits/sample of a file. Playing, zooming, cropping, deleting, extracting, etc. of a selected region. Fade-in, fade-out, gain adjustment, channel swapping, etc of a selected region. Editing file information that supports comments of WAV and AIFF, and ID3 tag of MP3. Analysis of a selected region using several analysis types, e.g. spectrum, smoothed spectrum, phase, unwrapped phase and group delay. Undoing and redoing without limitation of the number of times. Waveform extraction by drag & drop. Opening files by drag & drop. Autosaving of selected regions (you can do this by drag & drop also). Saving positions and regions as labels. Viewing some waveforms and setting regions synchronously. Almost all processing is 64 bits processing internally. Supported Formats: Read/Write: WAV, AIFF, AIFC, CAF, MP3, Ogg Vorbis, FLAC, ALAC (.caf, .mp4), WMA (Windows), APE, AU/SND, PARIS, NIST, IRCAM, raw PCM, text. Read-only: MPEG-2 Layer 3 MP3, RMP files with VBR support. With 64-bit internal processing, autosave capabilities, and synchronized multi-view waveform editing, spwave is a solid tool for anyone handling complex audio editing or acoustic research. spwave 0.9.0-1 changelog: Implemented CQT spectrum and CQT spectrogram (beta version). Implemented piano-key display for spectrum/spectrogram view. Implemented indication of musical note name in cursor information for spectrum/spectrogram view. Fixed a bug that spectrogram view after zoom-in with large factor sometimes freezes. Fixed a bug that scroll and zoom-out in spectrogram view after zoom-in with large factor do not work correctly. Fixed a bug that spectrogram view provides sometimes wrong time information. Fixed a bug that plugin errors sometimes cause a crash. Fixed a bug that the color of grid lines is wrong in printing. Optimized layout of spectrogram view for printing. Enhanced the function of waveform cropping from label information. Fixed a bug that some items in the preference dialog related to labels do not work. Added some items related to the region label in the preference dialog. Fixed a bug that drawing selected region in the log-frequency axis does not work correctly. Added partial support for the dark mode of Windows (the menu bar and the menus). Fixed a bug that the cursor to indicate current calculation position of spectrogram is sometimes not shown. Changed drawing of cursor information into that with white background so as to make the information legible. Fixed a bug that moving to the head by scrolling the overview display sometimes fails. Added feature of alignment of the view region between spectrum view and spectrogram view. Download: spwave 64-bit | spwave 32-bit | ~3.0 MB (Freeware) Download: spwave ARM64 | 2.9 MB Links: spwave Home page | Other OSes | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
  • Recent Achievements

    • Apprentice
      Wireless wookie went up a rank
      Apprentice
    • Week One Done
      bukro earned a badge
      Week One Done
    • One Year In
      Wulle earned a badge
      One Year In
    • One Month Later
      Wulle earned a badge
      One Month Later
    • One Month Later
      Simmo3D earned a badge
      One Month Later
  • Popular Contributors

    1. 1
      +primortal
      602
    2. 2
      ATLien_0
      283
    3. 3
      +FloatingFatMan
      181
    4. 4
      Michael Scrip
      152
    5. 5
      Steven P.
      111
  • Tell a friend

    Love Neowin? Tell a friend!