Currently I don't know how to use Emit namespace, but I'm reading
documentation about it @ MSDN. Hope your idea will do the trick :)
Thank you.
But, let me explain my scenario, hope this will help you understand
better the problem and help me, of course :D
My app is plugins-based, when user want to use unavailable features, it
will request the server and the server will send the plugins to it.
After that it will save the DLL file somewhere (so that user can keep
all the plugins in the safe place).
The app will search for plugins when it need to use it, once found it'll
load the DLL and call the function, unfortunately most of them are
unmanaged, but fortunately the plugins are all have the same functions
list, so it won't be a problem of calling unavailable function.
The problem is, the plugins file are saved to unpredictable place, user
will specify it. So the DllImport seem to be useless :(
TIA, if you have better approach, please tell me, too :)
Sunil wrote:
You can use Reflection.Emit namespace functions to create the code at runtime, which specifies the DllImport attribute
taken from that string variable... Its just my idea, I don't know how complex it is...
HTH
Sunil