Can I make a DLL in VB.NET which I can use in VB.NET with the tag DllImport just like we import functions from “user32.dll”?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
No you can’t.
The
DllImportattribute is used to invoke native / un-managed functions from managed code – VB.Net is managed not native, and so you can’t run VB.Net functions throughDllImport/ P/Invoke.To use VB.Net functions in other VB.Net projects you should either add a reference to that assembly, use a common referenced interface or base class, or use Reflection.