I have code that uses the Media Foundation Transform to apply effects to a video stream presented in XAML/C#. It is in fact the Media Capture sample supplied by Microsoft. I wanted to use the DirectX Toolkit so I added a reference to it in the C++ application. The build was successful however I faced the following error:
warning LNK4197: export 'DllGetActivationFactory' specified multiple times; using first specification
warning LNK4197: export 'DllCanUnloadNow' specified multiple times; using first specification
warning LNK4197: export 'DllGetActivationFactory' specified multiple times; using first specification
warning LNK4197: export 'DllCanUnloadNow' specified multiple times; using first specification
error LNK2005: _DllCanUnloadNow#0 already defined in dllmain.obj
error LNK1169: one or more multiply defined symbols found
It is described in more detail here:
Windows::Storage::ApplicationData::Current Not Found in C++
However after following the steps in that post I faced another error.
When the C# code tries to call the WinRT dll at
await m_mediaCaptureMgr.AddEffectAsync(Windows.Media.Capture.MediaStreamType.VideoPreview, "GrayscaleTransform.GrayscaleEffect", null);
it throws a new exception without any detail. The exception text is
System.Exception: Error in the DLL
at Windows.Media.Capture.MediaCapture.AddEffectAsync(MediaStreamType mediaStreamType, String effectActivationID, IPropertySet effectSettings)
All I've done is linked my DLL to the GreyscaleTransform via the compiler without any additional code being invoked yet.
Any thoughts on what could cause this or what is the best way to troubleshoot it?
Many thanks,
Stefan
Related
Attempting to write app that retrieves images from local storage (camera roll) on Android Mobile device. All research suggests using MediaStore.Images to accomplish this. Unable to get clean compile as keep getting error 'object cannot be found'
This is statement producing error : MediaStore.Images.Media.ExternalContentUri;
Also :
string path = cursor.GetString(cursor.GetColumnIndex(
MediaStore.Images.ImageColumns.Data));
Tried declaring separate Interface declaration to no avail
I believe these classes are defined in Android dll which I have reference to.
Very frustrating to a long time C# developer looking to write cross-platform Mobile apps.
looked for sample code on net that would illustrate solution showing exactly how to access/declare/use MediaShow.Images to no avail.
Surprised there does not appear to be a single example of a full solution illustrating its use
I'm retrieving the following error in a Windows Forms App (.NET Framework) by debugging execution:
And this different type of error (but in the same method) if I run the compiled exe:
Could the problem be linked to the inability to read the memory? (see the "Locals" panel on the bottom of the first picture) Why is impossible to read it?
I think the problem is memory because in the prevoius 32-bit version the application works fine, so the problem is not writing code. I'm now working at this new 64-bit version because of the 64-bit update of St7API.dll, which is called by the St7 class. I attach a few lines from this class for a better understanding.
Thank you in advance for any answers
Edit:
For other previous lines in the code there are no errors using St7API.dll. The app works fine and the error occur only when is run a specific process, maybe the the heaviest for the memory.
For the using of this API is provided a C# class (image 3) and a "closed" DLL. I add an image to the API guide for a function:
Here's what I've done so far:
I wrote a little C# class library to run GET requests to a REST API.
I compiled it, made sure that it worked within another c# application before trying to import this thing into my webpage. Pulled what I wanted to, worked like a charm whilst operating within another c# console app.
I followed this guide to make sure my dll was COM interoperable and reachable:
http://timheuer.com/blog/archive/2007/03/10/14009.aspx
Now, I was given this PHP webpage by someone else, and while I am not an expert in PHP, from what I've gathered it doesn't take much to be.
The only real important stuff is here:
function APIGet($url) {
$object = new COM("API_Call.ApiCaller");
$result = $object->cURLGET($token, $url);
return $result;
}
I wrote that into my function file, which has many other functions that work just fine on the page. The dll contains the namespace API_Call and a public static class, ApiCaller, as well as some other classes that aren't used here.
So then I go to call it on the actual page itself here:
$output = APIGet($apicall);
echo $output;
From which I get this error (edited for readability):
Fatal error: Uncaught com_exception: Failed to create COM object `API_Call.ApiCall':
Invalid syntax in C:\xampp\htdocs\canvasAPI.php:32
Stack trace: #0 C:\xampp\htdocs\canvasAPI.php(32):
com->com('API_Call.ApiCal...') #1 C:\xampp\htdocs\CAForm.php(169):
APIGet('api/v1/courses') #2 {main} thrown in C:\xampp\htdocs\canvasAPI.php on line 32
I have my file, canvasAPI.php with all my functions in it and then the CAForm.php file is the form itself. I've searched high and low for an answer here, but everything either says make the class library COM visible and interoperable, or to enable [COM] com.allow_dcom in php.ini, both of which I already did.
For anyone googling this, I just ended up using C# the whole way. I didn't see a point in continuing down the path of messing with custom COM objects in PHP.
I'm currently using C# and Win32 interop to register power setting notifications, enumerate power setting guids, etc. In the process of this, I came across a function in the MSDN documentation called "PowerIsSettingRangeDefined" that looked useful. When I imported the function and tried to test it, the compiler threw "System.EntryPointNotFound" exception. Obviously I double checked my spelling, etc, to no avail. So I looked for the header file on my computer and I did find the function listed in the 'powrprof.h' header for the 8.0 SDK, however, I don't have a copy of the 7.0 or 7.0A SDK on this computer. But according to the documentation, this was supposed to have been implemented starting with Windows 7. So this should have worked...
Then I used ProcessHacker to inspect the export table of the 'powrprof.dll' module in my process. The function was NOT there! To take it one step further, I used PE Explorer on the actual 'powrprof.dll' file located in "C:\Windows\SysWOW64\" and the entry point in question, again, was NOT in the name list. So the official header files include this function with "#if (NTDDI_VERSION >= NTDDI_WIN7)" above, and the documentation shows the function exists starting with Win7, however, it seems the MS team did not include it when compiling 'powrprof.dll' for Windows 7.
Maybe someone can check their copy in Windows 8.1/10 to see if this issue is only on Windows 7? I don't have another version of Windows in this building or I'd test it myself. And I wanted to bring it to attention here first, before trying to report this to Microsoft, just in case I'm missing something.
i found an article on this site http://www.codeproject.com/Articles/9676/Extracting-still-pictures-from-movie-files-with-C
about video frames extraction.
i am trying to run the source code given here..
i created a new project added the given C# code in it.
then i added the given reference " interop.dexterlib.dll" in it.
it gives an error about MediaDetClass.
Error 1
Interop type 'DexterLib.MediaDetClass' cannot be embedded. Use the applicable interface instead.
i am not getting it how to solve this. please help.