-
-
Notifications
You must be signed in to change notification settings - Fork 133
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
Confused. What to use? (exported structure variable) #27
Comments
` >_< it hard to understand what you do, and what you want at all, but I think I understand what you need amm.., firstly about exported-variables: that is, DllExport works via ILAsm that currently contains logic (part of mscorpe) for prepare exported-functions only. I will look this task later. (Here I also noticed about individual PE32/PE32+ tool at all, instead of IL Assembler, or something else. But it's hard for my time today, may be later...) However, even this should not be a problem for most cases ... Secondly, and most important :) you can simplify this chain via Conari if you need complex work with unmanaged libraries or even with data directly. +This also helps to prepare managed data for unmanaged environment, but if I understand correctly you need primary features of Coanri See UnmanagedStructure and also native C/C++ structures without declaration here if you need. |
Ok I will try to explain again ;) I will need the oposite of https://plus.google.com/101239554716569212042/posts/gR94gCu9k89
Works all fine if plugin.dll is c++. At the current point I am working on creating a c++-warpper dll which will export PANELS symbol, so FSX can set it, and my C#-dll exports some functions that will be called by the c++-dll to talk to each other. (maybe conari will help me there, i'll look into that) |
well, as I said above if 3rd party FSX can set this pointer only via variables, you should use another ways because ILAsm does not contain this logic today. Issue #24 The easy way, yes, to encapsulate this pointer for work through exported-functions as simple translator. Then you can call |
I am exporting some functions using DLLExport which is working great.
But I also need to export a Variable (Pointer to a FunctionPointer-Structure), which will be set from the native application loading my assembly and I then want to call a function in that struct from within my managed code.
So what i want to do basically (simpilfied):
[DLLExport]
FuncPtrStruct EXPORTVAR;
public double GetExternalValue(Int32 index)
{
if (EXPORTVAR == null)
return -1;
return EXPORTVAR->get_nativedata(index);
}
where get_indexdata would be defined as
"double (__stdcall *get_indexdata) (int index)" in the struct
So what else apart from DLLExport will I need, or would it maybe easier to write a native dll that provides the exported variable, handles the calls to it and loads my managed assembly, communicating with it through exported functions?
Hints welcome.
The text was updated successfully, but these errors were encountered: