UWP App Crash at Class1 c1 = new Class1(); saying - The specified module could not be found. (Exception from HRESULT: 0x8007007E - c++

I am trying to create a library of fftool so that the uwp app doesn't have to launch a process to run FFmpeg exe out of the environment and yet able to run all command of fftool. so, for that
first, I created a static lib compiling fftool c code adding all the necessary linking and include
then I created a WinRT component in c++ to connect this library to my uwp app
so, again provided all the input, link, include and then added a reference to the static library to it.
since both of them are in the same solution.
so, I did not add a reference to the linker and include for the static library in the WinRT component
then for the test, I created a class calling a simple function that I added to c manually
but now whenever I try to create an object of that test class it throws an error saying
-The specified module could not be found. (Exception from HRESULT: 0x8007007E)
and this is all at runtime
while compiling and launching of the app in c# work fine.
but if I use the c++ app it crashes as it launches
and also I am new to c and c++ I didn't use the c/c++ before that so I am stuck at it and unable to understand what's wrong and I tried googling it but I am unable to find something
thanks

ok so it looks like my app is unable to find FFmpeg core dll as avcodec, avfilter, etc so now I added them to exe location and it worked ok

Related

Using JSZip in an angular 14 library

I am developing multiple websites in angular with similar content and have therefore decided to extract common components and functionality into a separate angular 14 library.
I have previously successfully used the JSZip library in one of these websites with Angular 12, but have then decided to move this implementation into the library.
Even though the code did not change, it stopped working.
If I try to call the method that uses JSZip from the library it now throws the following TypeError
ERROR TypeError: (jszip__WEBPACK_IMPORTED_MODULE_1___namespace_cache || jszip__WEBPACK_IMPORTED_MODULE_1___namespace_cache) is not a constructor
Import library like this
import * as JSZip from 'jszip';
create a new JSZip instance like this
const zip = new JSZip();
Both the library and the website projects build correctly but throw this error at runtime, so I don't think it is a problem with dependencies.
Has someone encountered a similar problem before? What should I try to solve this?
Both the library and the website projects build correctly but throw this error at runtime, so I don't think it is a problem with dependencies.
Has someone encountered a similar problem before? What should I try to solve this?
I saw similar post like this

Why does my DLL require my program to have a specific name?

I've created some classes in a C++ application that I've developed that allow for third party developers to create their own DLL that subclasses off one my objects and have their subclass get loaded by the application through that DLL at runtime. This part all works.
The problem comes in when the name of the application executable is changed. Say I pass this application, call it "App.exe", to tester and he renames it to App-02.exe to distinguish it from another version he's tested. When App-02.exe attempts to load the DLL it throws the error:
"The program can't start because App.exe is missing from your computer. Try reinstalling the program to fix this problem."
There's an obvious solution, just don't rename the executable. But why should the DLL even care what the program loading it is called?
It sounds like the base class is defined inside App.exe, so you've got a circular dependency in your binaries (app.exe -> plug-in.dll -> app.exe). You can break this cycle by using the dependency inversion principle. Basically, move your base class out of app.exe and into a new .dll. Then you have something like this: app.exe -> plug-in-api.dll, plug-in.dll -> plug-in-api.dll.
Of course, if you do this, your tester might just rename plug-in-api.dll and everything would break again.
https://en.wikipedia.org/wiki/Dependency_inversion_principle

Access violation trying to create an SFML window

I have followed (twice, now) the setup guide for getting SFML up and running in Visual Studio. I have made sure that the proper .lib files and directories are being pointed to in the project's settings and that the required .dll's are present in the application's working directory, as per the guide.
I am trying to run the following: (ambitious, I know...)
#include "stdio.h";
#include <iostream>;
#include <SFML/Graphics.hpp>;
int main ()
{
sf::RenderWindow window( sf::VideoMode( 640, 480 ), "Title" );
std::cin.get();
}
Compile is successful, but as soon as the application starts, I get:
Exception thrown at 0x56D5EEB6 (sfml-system-d-2.dll) in D20 RPG.exe: 0xC0000005: Access violation reading location 0xCCCCCCD8.
With the first line commented, the application starts and finishes without a problem.
Do I need to locate the SFML source and compile it myself? It is a fairly sprawling library with a lot of dependencies, so that's something I've been avoiding unless someone thinks it might help. My experience with C++ and VS is shallow enough that I think I'd be more likely to introduce more problems before solving this one.
I was able to get this code working by creating a new empty console application project and using the NuGet package manager interface to install the sfml-graphics, sfml-window, and sfml-system packages.

Assimp Sample starting error

I installed the Assimp library on windows, and liked the files then just copy-pasted the SimpleOpenGL sample and deleted the struct words(most of them) In order to clear the errors I was getting.
Now, I do not have any errors but the program tells me this whenever I try to run it:
The application was unable to start correctly (0xc0150002).Click OK to close the application.
Any ideeas for a fix for this ( I have all the dlls from assimp in the project folder. )
Just use renamed Assimp32.dll to Assimp32d.dll

Ogre SDK exception occured

I've setup Ogre and dependencies on my PC, and downloaded some Ogre applications. When I launch my new exe file of the project I just downloaded it generates the following error:
05:37:59: Loading library C:/OgreSDK_vc9_v1-7-1/bin/debug\RenderSystem_Direct3D9_d
05:37:59: OGRE EXCEPTION(7:InternalErrorException): Could not load dynamic library C :/OgreSDK_vc9_v1-7-1/bin/debug\RenderSystem_Direct3D9_d. System Error: The specified module could not be found.
in DynLib::load at ..\..\..\..\OgreMain\src\OgreDynLib.cpp (line 91)
Any help would be appreciated.
Thanks in advance.
Upon creation of the central Ogre3D class Ogre::Root, you need to pass the name of a *.CFG file that contains all to be loaded Ogre plugins, such as the above mentioned D3D9 Render System.
That file needs to be next to your *.EXE by default and should look like this (in a minimal form where only the D3D9 Render System is loaded and the matching DLL file resides next to this CFG file):
# Defines plugins to load
# Define plugin folder
PluginFolder=.
# Define plugins
Plugin=RenderSystem_Direct3D9
For more information, have a look at this section in the Ogre3D tutorial 1
This took me a while until I figured it out. The dll (RenderSystem_Direct3D9_d) is missed because you didn't build it - it's the project with the same name (RenderSystem_Direct3D9) in the OGRE.sln
I'm using OGRE 2.1, so the dll I missing is RenderSystem_Direct3D11_d.dll instead of RenderSystem_Direct3D9_d.dll like yours, but the fix is similar, just build that dll's project, like the image below.
Anyway, as a beginner, to avoid any trouble, just hit F6 to build whole solution.