How to make a dll file in freeBasic to work with VB.NET

New to FreeBASIC? Post your questions here.
kcvinu
Posts: 178
Joined: Oct 07, 2015 16:44
Location: Keralam, India

How to make a dll file in freeBasic to work with VB.NET

Postby kcvinu » Aug 10, 2016 6:47

Hi all,
I tried and failed to make a dll in freeBasic to work with VB.NET. First i have made the dll successfully but i can't include it in my vb.net project. When i tried to include it via Add reference, it shows me that the dll is not valid.
Then i tried to make this dll valid by using TlbImport.exe in VS command propmt. But that is not supporting this dll. So somebody please tell me how can make a valid dll in freeeBasic. I have some hits about the datatype mismatching in these two languages. I am seeking information on that area too.
vdecampo
Posts: 2982
Joined: Aug 07, 2007 23:20
Location: Maryland, USA
Contact:

Re: How to make a dll file in freeBasic to work with VB.NET

Postby vdecampo » Aug 10, 2016 12:56

I don't use VB.NET but I do use C#. I successfully created a FB DLL and used it through a C# application. Have a look at the C# portion of this post where I declare the DLLs. Perhaps it is similar to the way VB.NET imports functions.

FBGfx for C#

-Vince
kcvinu
Posts: 178
Joined: Oct 07, 2015 16:44
Location: Keralam, India

Re: How to make a dll file in freeBasic to work with VB.NET

Postby kcvinu » Aug 10, 2016 18:56

@ vdecampo ,
Thanks a lot. Let me check. :)
St_W
Posts: 1479
Joined: Feb 11, 2009 14:24
Location: Austria
Contact:

Re: How to make a dll file in freeBasic to work with VB.NET

Postby St_W » Aug 10, 2016 20:47

VB.NET works on the .NET platform, the CLR. To use native (or "unmanaged") .dll files (which are different to .NET ("managed") assemblies, which also use the .dll file extension) see "Platform Invoke" (or P/Invoke in short).
Here's an older, but still valid tutorial: https://msdn.microsoft.com/en-us/library/aa288468.aspx
Note that there are only some syntactic differences between VB.NET and C# - otherwise it's the same.
More information on Platform Invocation Services can be found on Wikipedia: https://en.wikipedia.org/wiki/Platform_ ... n_Services

Return to “Beginners”

Who is online

Users browsing this forum: No registered users and 1 guest