My Google-Fu has obediently told me that the following error
Not able to perform the operation because object is not given storage yet (Exception from HRESULT: 0x80040012 (OLE_E_NOSTORAGE))
which is being thrown from a C++ function called in a C# project is, in fact, an error which is related to OLE. But I can't find much more beyond that - what might cause such an error, or what functions would return it.
More baffling is the fact that although I know the code I'm using has spat out this error before, I personally haven't been able to reproduce it. It's coming from a pair of unit tests, so I doubt that I'm missing some vital step to reproduce the error, unless it's due to some arcane machine configuration. Can anyone help me understand where it might be coming from?
Related
I've been on a quest for a while now to pass the PCM of an MP3 from W8.1/WP8.1 to Unity3D and I believe I'm getting close. I was referred to this project which works absolutely fine but, of course, it's in VB.NET so it can't be used with Unity. VB and C# are fairly similar so I set out to translate it. You can see my translation at this pastebin.
The problem occurs on line 97. The app simply exits with absolutely no indication of what went wrong. Calling any non-inherited function on the interfaces IMFSample and IMFMediaType has the same effect.
A friend suggested getting the HRESULTs from these functions to see if anything shows up. Google shows getting HRESULTs from COM interops in C# is.. hard. I experimented by changing IMFSample.GetSampleFlags to
int GetSampleFlags(out int pRetVal);
And that returned "The requested attribute was not found. (Exception from HRESULT: 0xC00D36E6)" and I'm not really sure what to do with that information...
So, I humbly ask you all... just... just what? What do I do from here?
--- SOLUTION ---
So as it turns out the solution was a little dumber than I expected.
I did not know this, but apparently COM interfaces that inherit from other COM interfaces have to include ALL of the methods from the parent COMs. Otherwise windows, it seems, throws a hissy fit.
That was it... it was my own laziness in the first place that killed me.
The problem is that I often get a TypeLoadReflectionException and my ability to find the cause for them is very limited, essentially nil actually.
Today I again had a problem like this and couldn't solve it. For some reason my assembly required another assembly which never happened before and even reverting the code to a previously working state did not fix the issue. I'm stumped, there must be deeper issues here.
Is there any way to debug this properly? Ideally a tool like Reflector or IlSpy would be ably to tell me "dependent assemblies" and "type dependencies" per line.
Seeing as how the C# 4.5 Roslyn compiler is now open source, this should theoretically be doable, after all the compiler at some point during the compilation process decides "hey, i need this type for this stuff to compile". Correct? However these TypeLoadExceptions occur at runtime, so I'm not sure.
I created dll from c function and importing into c#
When I call the dll function I am getting error:
Unable to load DLL 'subFunction.dll': Not enough storage is available to process this command. (Exception from HRESULT: 0x80070008).
How to fix it.
I am inclined to say you look at it from the wrong side - this is not a C# issue, it is a simple as it is error in C++. I suggest you put up a native C++ command line test and check whether this happens there too, then you go on and fix your code.
Without debugging we are sort of guessing what you made wrong - and that will never work. BUt this seriously looks like C# is totally irrelevant for the question and it is a pure C level issue.
My code is trying to load from a database using LINQ to SQL. At the moment as soon as i seem to touch what a query returns i get a crash with the error ExecutionExceptionError occured:
Currently my code is very simple, i have a standard dbml class that is meant to load a single table MC:
private void RibbonButton_Click(object sender, RoutedEventArgs e)
{
MultipleChoiceDataContext t = new MultipleChoiceDataContext();
var test =
from a in t.GetTable<MC>()
select a;
testbox.Content = test.First().question;
}
The error takes place on the line of
test.First().question;
I cannot find any help in the area or someone who has experienced this problem before, so i'm hoping someone may have an idea of how to fix this
ExecutionEngineException indicates an internal problem to the CLR. It means one of the following:
You used unsafe code or PInvoke to cause memory corruption. The CLR's data structures are now corrupt.
Some other library did this (a bug).
A bug in the CLR itself.
In all cases the solution is to work around the issue, maybe by changing things randomly until the application unbreaks. Try refactoring your code, comment out stuff until the error disappears. Factor things out into new methods. Think whether a library you are using might be doing unsafe stuff. Maybe the stack trace can tell you what functionality to avoid.
This is a deeply unmethodical approach but the best that I know of. Very hard to work around because you did nothing specific wrong. In particular, the line of code that you showed cannot normally cause memory corruption.
So turns out the problem was due to the installation of the preview of Visual Studio 2013, upon uninstalling that, the solution worked perfectly again on Visual Studio 2012
Thanks for all the help!
all,
I'm looking into OpenSSL.NET and have hit a bit of a wall with it. As I said, I'm only looking into it, but a project at work needs to use it, so I can't really use anything else. The problem I'm getting is that I'm using the Cipher attribute to select an encyption type, yet each one throws the following error:
The type initializer for 'OpenSSL.Crypto.Cipher' threw an exception.
Also, when I look at the debugger, each Cipher has "null" as it's value. I've got the ManagedOpenSsl.dll referenced, and libeay32.dll and ssleay32.dll are both in the working directory, so I'm a tad stuck.
Any help on this would be much appreciated. Also, has anyone found any good stuff to read on the OpenSSL library? I've spent two hours looking, but nothing useful shows up.
Cheers