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 

Using with Borland C++ Builder 5

 
Post new topic   Reply to topic    DPlot Forum Index -> C, C++, C#
View previous topic :: View next topic  
Author Message
hare



Joined: 30 Oct 2008
Posts: 2

PostPosted: Fri Oct 31, 2008 10:17 am    Post subject: Using with Borland C++ Builder 5 Reply with quote

Hi,

I am trying to use the dplotlib.dll in BorlandC++.
I set the preferences as:

memset(&dplot,0,sizeof(DPlot));
dplot.Version = DPLOT_DDE_VERSION;
dplot.DataFormat = DATA_XYYY;
dplot.MaxCurves = 1;
dplot.MaxPoints = NP;
dplot.NumCurves = 2;
dplot.Scale = SCALE_LINEARX_LINEARY;
dplot.LegendX = 0.05F;
dplot.LegendY = 0.05F;
dplot.NP[0] = NP;

And commands as
sprintf(cmds,"[ManualScale(0,0,1,30)][TickInterval(1,0.5,0.25)]"
"[Caption(\"DPLOTLIB XY Test\")]"
"[GeneralOptions(0x00000020,1)]"
"[Color(1,255,0,0)][Color(2,0,0,255)]"
"[TextFont(1, 8, 0,0,0,0,0,\"Arial\")]"
"[TextFont(2,12,700,0,0,0,0,\"Arial\")]"
"[TextFont(4,10, 0,0,0,0,0,\"Arial\")]"
"[TextFont(5,10, 0,0,0,0,0,\"Arial\")]"
"[TextFont(6,10, 0,0,0,0,0,\"Arial\")]"
"[ClearEditFlag()]");

When I call dPlot_Plot8 the return value is "0" and a blank Plot gets opened and it raises exception?

Did I miss out something?

cheers, hare
Back to top
View user's profile Send private message
DPlotAdmin
Site Admin


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

PostPosted: Fri Oct 31, 2008 3:27 pm    Post subject: Reply with quote

This:
Quote:
dplot.MaxCurves = 1;
dplot.MaxPoints = NP;
dplot.NumCurves = 2;

can't be right. MaxCurves must be greater than or equal to NumCurves. Also you're setting the number of points in the first curve (dplot.NP[0]=NP), but not the second (assuming there is a second curve; if there isn't then set NumCurves=1).

But... the DLL should catch all of those problems and shouldn't cause a crash. If you fix the above and still have problems then most likely the problem is in the interface, something like using _cdecl instead of _stdcall.

Either way, please let me know how this works out.
_________________
David Hyde
support@dplot.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
hare



Joined: 30 Oct 2008
Posts: 2

PostPosted: Mon Nov 03, 2008 3:26 am    Post subject: Reply with quote

thanks a lot..
it works after I set NumCurves = 1. Looks like the dll is not handling this kind of exception..
Back to top
View user's profile Send private message
DPlotAdmin
Site Admin


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

PostPosted: Mon Nov 03, 2008 11:44 am    Post subject: Reply with quote

Whoops, you're right: that isn't trapped like I thought it was. It will be in the next release.
_________________
David Hyde
support@dplot.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    DPlot Forum Index -> C, C++, C# 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