access-violation

P/Invoke AccessViolationException that makes no sense

First of all, sorry to post a question like this when so many other have been asked on this topic, but I've been reading all the questions I could find (+google), and none has really given me any hints as to what is happening in my case. I have a 3rd party .dll (libFLAC) with two exported functions with similar name: FLAC__StreamEncode...

Working with registry values

This time i'm tring to work with registry values and so i'm using the following code Private Function RegKeyExists(ByVal hKey As Long, ByVal sKeyPath As String) As Boolean Dim lResult As Long Dim hSubkey As Long lResult = RegOpenKeyEx(hKey, sKeyPath, 0, KEY_EXECUTE, hSubkey) ' Determine if handle is valid ...

Pinning a Structure to avoid AccessViolationException

Hi, I am calling an function from a DLL which is loaded run-time (Using LoadLibrary()). This DLL is written in C++ and my code is in C#. API requires Structure Pointer. I am passing "ref" instead of Pointer. While doing this, I getting "AccessViolationException". After 3 days of Googling, I think the problem could be solved by Pinning ...

C++: Libcurl curl_easy_init() gives an access violation error and crashes the program

Hello, I'm trying to use libcurl with a program I'm making, but I'm having some problems with it. So far I've only tried the examples from libcurl's website, but they crash as soon as the program gets to the curl initialization. My current code: #include <iostream> #include <curl/curl.h> int main(int argc, char *argv[]) { CURL *c...