|
-
Aug 22nd, 2023, 05:14 AM
#8
Thread Starter
Junior Member
Re: Using a dll made by c++ for VB
 Originally Posted by jmcilhinney
As for the issue, the error message pretty much confirms what I suspected. You can only reference .NET assemblies and COM components in .NET projects, so your C++ DLL is almost certainly neither. As I said previously, you will have to use pinvoke to call the unmanaged functions exported by your library.
Where did you get this DLL? Is there any documentation with it that provides .NET examples? If not, you'll just have to research pinvoke to learn the principles involved, then apply those principles to your specific scenario. Basically, you declare a .NET method with the appropriate attributes that matches the signature of the unmanaged function you want to call. You then call your method and .NET will invoke the external function. You'll then need to deploy your unmanaged library with your .NET app. You might start here.
Hello, I created the dll my self, it is a physics simulator. All it does is it simulats particle physics using discrete mathematics of the Runge Kutta. I used a dll template from chatbot. And then copy pasted my code into new header files one by one to ensure there are no complatibility issues from transporting code from an old version of c++ VS6.0.
How do I make my dll work with VB? Can you provide a template dll for VSC++ 2019 that already has working system and properties that is compatible with VB 2019? Then I can just do the same as before and copy paste my source code into it, object by object.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|