Home > Net >  C # WinForm procedure call VLC anomalies
C # WinForm procedure call VLC anomalies

Time:03-06

description
Use WinForm procedure, called VLC initialized instance times exception, is to run to the libvlc_new times (the arguments. Length, argvPtr) method of abnormal

The exception message: System. BadImageFormatException: "trying to load the format is not correct procedure, (exception from HRESULT: 0 x8007000b)
Images:

problem of environmental background and own tried what method
Environment:
1.. .net version: 4.5
2. VLC version: VLC - 3.0.4 - win64
3. The IDE: VS2017
4. The OS: Win10 64
The method of try:
1. The program in the form of X86 regenerated (cannot solve)
2. Libvlc. DLL and libvlccore. DLL and the plugins in the Debug directory (cannot solve)

Related code

 libvlc_new (the arguments. Length, argvPtr); 

//create a libvlc instance, it is the reference count
[DllImport (" libvlc, "CallingConvention=CallingConvention Cdecl, ExactSpelling=true)]
[SuppressUnmanagedCodeSecurity]
Private static extern IntPtr libvlc_new (int arg c, IntPtr argv);


What's the result of the are you looking forward to? What is actually see the error message?
Expected result is able to create an instance, but now the exception, because is c # call c + + DLL, is also used for the first time, looking at a big solutions

CodePudding user response:

Image format not to change the format

CodePudding user response:

The.net framework to 4.0 a try,
My question to you about, the environment, but mine is 4.0, no error, but! If the compiled program on a 32-bit Windows XP SP3. Net 4.0 runtime, is directly. Net system level error, several couldn't find the DLL entry, but! Does not affect the use, threads, commissioned, the callback is tried again, no matter use!

CodePudding user response:

You can also try VLC version 2.1.0, under XP I no problem,

CodePudding user response:

The project properties is modified to generate, preferred 32 bits
  •  Tags:  
  • C#
  • Related