>And if I could later on modify the entrypoint at runtime, I could achieve it. So I want to know how I could modify EntryPoint to, for example func_struct2, at runtime.
No, you can't modify compiled code at runtime.
You can, however, generate new code. See
http://www.msjogren.net/dotnet/eng/samples/dotnet_dynpinvoke.asp
for an example.
However, if I were you I'd still go with static compile time checked
declarations. Why don't you want that?
Mattias

Signature
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.