I have an unmanaged function call that is throwing this exception when I try to pass it the path to a file name.

I've read that this is likely caused by the DLL itself but I don't think that is the case since the DLL is used in another application, so the problem is likely in my method calling the function.

The specification:

```
libvlc_media_new_path (libvlc_instance_t *p_instance, const char *path)

```

Description:

```
p_instance  the instance
path    local filesystem path

```

And my method:

```
[DllImport("libvlc", EntryPoint = "libvlc_media_new_path")]
public static extern IntPtr NewMedia(IntPtr instance,
                            [MarshalAs(UnmanagedType.LPStr)] string path);

```

I think I'm missing the convention call but what would that likely be? Or would it be something else causing this exception?

EDIT: Based on some comments I did some poking around and found... well, nothing. The struct for the instance is opaque, which means I have no idea in Laymans terms. My guess is that it means you don't need to reconstruct it in the application that is using it?

In a blind guess based on [this](https://www.powerbasic.com/support/pbforums/showthread.php?t=51978), I replaced the return value that I had been using with the function responsible for setting the \*p\_instance value to a `long` instead of an `IntPtr` since when it was an `IntPtr` it was returning 0, and with a long I was seeing a value. Again, what an `IntPtr` is I don't really know. I was pretty happy to see something not 0 in the instance variable but when I ran it past that, it errored out again.

EDIT: I've expanded the question to [here](https://stackoverflow.com/questions/18213863/writing-a-lite-weight-libvlc-wrapper-need-help-newish-to-p-invoke).