Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Crash inside LoadFromString (Read 3699 times)
jvaldehita
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 5
Joined: Mar 15th, 2006
Crash inside LoadFromString
Apr 6th, 2006 at 9:38am
Print Post  
Hi.

I´m having problems when loading a diagram that´s been saved to a string.

It´s a big graph (around 130 boxes, 1000 arrows).

I´m using flowchartx from Visual Studio 2003, using unmanaged C++.

I´ve been able to create a graph (m_GraphView) and I get a crash inside LoadFromString using the following code:

CString flowChartSavedString = m_GraphView.SaveToString(FALSE);
m_GraphView.LoadFromString(flowChartSavedString);

I´ve been able to save the contents of the returned string to disk, and will email it if needed to fix the bug.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Crash inside LoadFromString
Reply #1 - Apr 6th, 2006 at 3:36pm
Print Post  
We have seen this problem before. There is a bug in the  MFC CString to BSTR conversion, it crashes with very large strings. We worked around that by using the raw IFlowChart interface and passing the BSTR data directly to the LoadFromString method, without converting to/from CString. Include the flowchart.h file installed with FlowChartX (but not the MFC wrapper one). That will give you the definition of the IFlowChart interface and IID_IFlowChart interface ID. Query for that interface and use its SaveToString/LoadFromString methods directly.

Stoyan
  
Back to top
 
IP Logged
 
jvaldehita
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 5
Joined: Mar 15th, 2006
!
Reply #2 - Apr 7th, 2006 at 8:02am
Print Post  
Stoyan,

thanks for your quick reply.

Done as you said, works OK.

I´ve sought any indication of this issue in the documentation. I´ve found none. If it is not mentioned there, it should be (and prominently). It would be a real time saver.

Thanks again for your quick response.

Jorge.


  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Crash inside LoadFromString
Reply #3 - Apr 7th, 2006 at 9:30am
Print Post  
Yes, I guess we should document that. It will be done in the next version of the help file.

Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint