I am in the process of trying to get Dplot to work in VB.Net. Running into some pesky issues here and there. Has anyone done this? If so, some sample code would be great. Specifically interested in getting the bitmap and displaying it in a picture box.
If I get there first I'll post my results for others to share.
- Andy
Dplot and VB.Net
- DPlotAdmin
- Posts: 2312
- Joined: Tue Jun 24, 2003 9:34 pm
- Location: Vicksburg, Mississippi
- Contact:
I don't have VB.net and so will be of limited help, but what problems specifically are you running into?
I've exchanged e-mails with someone else today who's also working with VB.net, and one problem he had was that VB objected to the "As Any" declarations in global.bas. If you change all of those in the DPLOTLIB declarations to "As Single" it should work - at least that part should.
I've exchanged e-mails with someone else today who's also working with VB.net, and one problem he had was that VB objected to the "As Any" declarations in global.bas. If you change all of those in the DPLOTLIB declarations to "As Single" it should work - at least that part should.
Visualize Your Data
support@dplot.com
support@dplot.com
I've been able to translate the header file without much problem, i.e. changing types to struc and creating enums, Anys to Objects/or Singles. Everything compiles fine but when I go to run the app it gives me an error saying it can't load the dplotlib.dll. I know the dll is registered b/c all of the examples work. This is my first work with declaring functions for dll's directly as opposed to just including the dll in the project itself. Could you maybe put me in touch with the other person using VB.net and maybe between the two of us we can get some good working examples together?
Thanks,
Andy
Thanks,
Andy
- DPlotAdmin
- Posts: 2312
- Joined: Tue Jun 24, 2003 9:34 pm
- Location: Vicksburg, Mississippi
- Contact:
"Can't load" or "can't find"? If it's "can't find", or if the two are equivalent, maybe this will help... and maybe it won't:Everything compiles fine but when I go to run the app it gives me an error saying it can't load the dplotlib.dll.
In the VB environment you have to jump through one hoop to make VB find the DLL. This isn't necessary with the compiled VB demos, because the first place Windows looks is in the current folder, the current folder generally being the location of the application. In the case of running the uncompiled demo in VB, though, the current folder is the location of VB, not the demo project files. So in the demos when the main form is loaded we do this:
ChDrive App.Path
ChDir App.Path
ChDir ".."
This assumes that the DLL is located one folder above our VB project, which in the case of the demos is true. This isn't necessary (but doesn't hurt anything) for the compiled version, since Windows will always look in the .exe's folder for DLLs.
Nope, nothing is "registered". The DLL doesn't do any ActiveX or other VB-specific stuff that requires registration.I know the dll is registered b/c all of the examples work.
I've given him your e-mail address and received a "Thanks", so my guess is you'll hear from him soon. Please let me know what you 2 come up with.Could you maybe put me in touch with the other person using VB.net and maybe between the two of us we can get some good working examples together?
Visualize Your Data
support@dplot.com
support@dplot.com
For the benefit of others who might have the same question I just added the dplotlib.dll into the bin directory of my solution. This way it is in the same directory with the App.
Now I've got my hbitmap and trying to use .Image.FromHBitmap function of the picture box but it wants a System.IntPTR, not a long and I can't seem to resolve the difference between the two.
Pushing On.
- Andy
Now I've got my hbitmap and trying to use .Image.FromHBitmap function of the picture box but it wants a System.IntPTR, not a long and I can't seem to resolve the difference between the two.
Pushing On.
- Andy