How to use VB.NET to call CUDA Dll?

Can I use VB.NET to call CUDA dll?
We want to use cuda to speed up some parts of our projects which have been written in VB.NET. I have traced the example – C#_call_CUDA_dll. However, __declspec(dllexport) does not work in VB.NET.
Can I use __stdcall to create cuda dll for VB.NET? Did anyone had experience to do this right?
I am using VS2005.If anybody has any other suggestions, it will be appreciated. :)

I got it with VB on Excel. not sure what VB.NET is.

Use declaration like this in your DLL:



WINAPI xllCalculateHVDaily(BSTR DSNName, BSTR DBName)




If that does not work , try prefixing an ’ extern “c” ’ in front of ‘int WINAPI’…

and use the “.DEF” file to export your symbols…

In .NET, you need to do a Platform Invoke (P/Invoke) on the CUDA dll (nvcuda). I don’t know what the exact syntax is to do that in VB.NET, since I’m primarily a C# developer…