DPlot Forum Index DPlot
http://www.dplot.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Dplot and VB.Net

 
Post new topic   Reply to topic    DPlot Forum Index -> Suggestions/Questions
View previous topic :: View next topic  
Author Message
aprobi



Joined: 15 Jan 2004
Posts: 4

PostPosted: Thu Jan 15, 2004 6:37 pm    Post subject: Dplot and VB.Net Reply with quote

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
Back to top
View user's profile Send private message
DPlotAdmin
Site Admin


Joined: 24 Jun 2003
Posts: 2310
Location: Vicksburg, Mississippi

PostPosted: Thu Jan 15, 2004 7:59 pm    Post subject: Reply with quote

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.
_________________
Visualize Your Data
support@dplot.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
aprobi



Joined: 15 Jan 2004
Posts: 4

PostPosted: Fri Jan 16, 2004 9:44 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
DPlotAdmin
Site Admin


Joined: 24 Jun 2003
Posts: 2310
Location: Vicksburg, Mississippi

PostPosted: Fri Jan 16, 2004 10:05 am    Post subject: Reply with quote

Quote:
Everything compiles fine but when I go to run the app it gives me an error saying it can't load the dplotlib.dll.


"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:

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.

Quote:
I know the dll is registered b/c all of the examples work.


Nope, nothing is "registered". The DLL doesn't do any ActiveX or other VB-specific stuff that requires registration.

Quote:
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?


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.
_________________
Visualize Your Data
support@dplot.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
aprobi



Joined: 15 Jan 2004
Posts: 4

PostPosted: Fri Jan 16, 2004 2:25 pm    Post subject: Reply with quote

Thanks. I'll try the change app path trick and see how that works.

- Andy
Back to top
View user's profile Send private message
aprobi



Joined: 15 Jan 2004
Posts: 4

PostPosted: Fri Jan 16, 2004 3:21 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    DPlot Forum Index -> Suggestions/Questions All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group