Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question in case of using DllExport #165

Closed
ghost opened this issue Jun 26, 2020 · 3 comments
Closed

Question in case of using DllExport #165

ghost opened this issue Jun 26, 2020 · 3 comments

Comments

@ghost
Copy link

ghost commented Jun 26, 2020

Create a module for OBStudio , obs can load with OurILAsm+SysObjRebase setting dll
But when I create new thread or try catch , the obs will throw exception in call obs_module_load

obs

[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)]
public static extern int MessageBox(int hWnd, String text, String caption, uint type);

[DllExport(ExportName = "obs_module_load")]
public static bool Load()
{
   MessageBox(0, "Load", "obs_module_load", 0);
   //Task.Factory.StartNew(() =>{});
   //try { MessageBox(0, "Load", "obs_module_load", 0); } catch(Exception ex) { Debug.WriteLine(ex.Message); }
   return true;
}

Repo: obstest
Module_Doc
For testing: after build and installed obs , put the dll into obs-studio\obs-plugins\64bit\obstest.dll

@ghost ghost added the question label Jun 26, 2020
@ghost ghost changed the title OurILAsm+SysObjRebase not allowed try catch and create new thread? Question in case of using DllExport Jun 26, 2020
@3F
Copy link
Owner

3F commented Jun 26, 2020

Since your target is Preview .NET 5,
it could be a duplicate of #132. Please follow instructions there.

Let me know the result for .NET Standard 2.0 or .NET Core 2.2

@ghost
Copy link
Author

ghost commented Jun 30, 2020

Thanks, the test results shown below.

X64 + OurILAsm + SysObjRebase

Target Framework TFM
.NET Standard
✔️1.1
✔️1.2
✔️1.3
✔️1.4
✔️1.5
✔️1.6
✔️2.0
2.1
.NET Core
1.0
1.1
2.0
2.1
2.2
3.0
3.1

@3F
Copy link
Owner

3F commented Jun 30, 2020

Thanks for the information. I've checked the issue. This is duplicate of #132 but OBS case looks more problematic because, for example, "netcoreapp2.2 seems pretty fine"

Temporarily please use netstandard targeting in your case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant