Click here to Skip to main content
15,947,958 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm trying to make a win32 api list for VB.NET. I started getting the parameters of the procedures, and by its prefixes (for example, ByVal dwThing As Long -> ByVal dwThing As UInteger) translated into VB.NET. At this point, all Ok (more or less). The problem comes when I have to get the return value of the functions (I'm basing my project in VB6 API declarations, and this language doesn't recognize unsigned types and I can't see a float or double in the file). Then I want to get the function name and return value of some dlls (if could be with the procedure parameters better, because I see the real value for those). For example,

BOOL Beep(DWORD dwFreq, DWORD dwDuration); (extracted from MSDN, this could be got with the kernel32.dll library)

This could be done?

Thanks in advance.

What I have tried:

I have tried with dumpbin.exe, but it doesn't get (or I don't know how to do it) the return values. I only want the functions (with parameters and return value) or subs (with parameters) to compare results and set them to the list.
Updated 4-May-19 11:23am

1 solution

VB6 was discontinued last century. Switch to VB.NET and you can then use How to: Call Native DLLs from Managed Code Using PInvoke | Microsoft Docs[^], which has done all the work for you.
Share this answer
EdwardCarnby 4-May-19 7:27am    
As I mention before, I'm working in VB.NET. The fact of doing so is because I believe that windows apis are still in the first level, before .net. So I think the ImportDLL instruction ends up calling the api. I think it runs faster than .NET. With this I do not mean that .net is not useful.

Returning to the question before...

Is it possible to extract the functions and subroutines of the dll with their parameters and return values?

Again, thanks in advance.
Richard MacCutchan 4-May-19 9:26am    
According to the text of your question you are working in VB6. If you want the full details of each function then go to the interop wiki![^].
EdwardCarnby 5-May-19 13:03pm    
No, I said I'm basing my work in the win32 api of vb6. But I am translating to VB.NET. The I'm working with VB.NET.
Richard MacCutchan 5-May-19 13:10pm    
VB6 does not have a win32 API, Windows does. And if you are using VB.NET then Pinvoke is the way to do it, as documented in the link i gave you originally.
EdwardCarnby 5-May-19 14:27pm    
Vb6 came with a windows api list to work for. The only thing I want is update that list to VB.NET.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900