Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 10 Replies) LoadFromString Error (Read 7128 times)
weng.d.leong
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 6
Joined: Oct 13th, 2005
LoadFromString Error
Oct 13th, 2005 at 2:41pm
Print Post  
Hi. Have anyone encountered an error using the LoadFromString() function?

I am getting the following error on VB6 :
Run-Time error '-2147467259 (80004005)':
Method 'LoadFromString' of object 'IFlowChart' failed.

Here's a snipet of my code:

[code]
Set objFileSystem = New FileSystemObject
Set objTextStream = objFileSystem.CreateTextFile(sfilename, True, False)
For lindex = 0 To (FLOWCHART_ARRAY_SIZE - 1)
'generate text stream of each flowchart page
   sflowchart_datastream = FlowChart_Array(lindex).SaveToString(True)
   objTextStream.WriteLine sflowchart_datastream
   Call FlowChart_Array(lindex).LoadFromString(sflowchart_datastream)            
Next lindex
objTextStream.Close
Set objTextStream = Nothing
Set objFileSystem = Nothing
[/code]

Any help is much appreciated.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: LoadFromString Error
Reply #1 - Oct 13th, 2005 at 3:06pm
Print Post  
Hi,

Could you use SaveToFile on your diagram and upload the file here :

http://mindfusion.org/cgi/HelpDesk/index.php

so we can examine it.

Stoyan
  
Back to top
 
IP Logged
 
weng.d.leong
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 6
Joined: Oct 13th, 2005
Re: LoadFromString Error
Reply #2 - Oct 13th, 2005 at 3:18pm
Print Post  
Hi. I have uploaded the binary file and created a ticket on your helpdesk. The ticket number is 3A4FF0.

I also discovered that even with the error, LoadFromString() will still load correctly if I enabled VB's "On Error Resume Next", but this will not be good programming practise.

Your help is much appreciated.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: LoadFromString Error
Reply #3 - Oct 13th, 2005 at 3:49pm
Print Post  
Hi ,

There aren't any items in that diagram and I couldn't find any problems using SaveToString/LoadFromString with it. Probably you get the error only on one of your flowchart pages - could you determine which page it is and upload it as a file again.

Thanks
  
Back to top
 
IP Logged
 
weng.d.leong
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 6
Joined: Oct 13th, 2005
Re: LoadFromString Error
Reply #4 - Oct 13th, 2005 at 5:01pm
Print Post  

Thanks for looking into it for me. One other important piece of information I may have left out.

I am running the Demo version of FlowChartX Pro. I am still waiting for our company's Purchasing Department to complete the order for a licensed copy of FlowChartX Pro. Does running the Demo version be any different?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: LoadFromString Error
Reply #5 - Oct 13th, 2005 at 5:09pm
Print Post  
There shouldn't be any difference between saving/loading in trial and registered versions.

A situation in which saving/loading might break is if you use COM objects as variant tags or OCX controls hosted in boxes. Then if one of these write more data than it reads or vice versa, an error would be returned. Do you use any of these features?

Is the diagram you uploaded really empty or the file is broken too ? Could you send a second non-empty diagram, and probably the text file where you write the SaveToString results.

Thanks.
  
Back to top
 
IP Logged
 
weng.d.leong
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 6
Joined: Oct 13th, 2005
Re: LoadFromString Error
Reply #6 - Oct 13th, 2005 at 5:21pm
Print Post  

Yes. I am assigning objBox.VariantTag with a instance of a class (object). Is there a work-around for this besides not assigning objects to the VariantTag?


On a side note, I am impressed with the tech support responses I am getting from you.  Smiley
  
Back to top
 
IP Logged
 
weng.d.leong
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 6
Joined: Oct 13th, 2005
Re: LoadFromString Error
Reply #7 - Oct 13th, 2005 at 5:27pm
Print Post  

I just realized that if I have objects assigned to VariantTags when I save my diagram; when I reload the diagram, the VariantTags still points to the same object address. Being a new document, the objects do not exist and therefore creates an error. Is this what's happening?

If this is true,  when saving my diagrams, I'll need to save the objects somehow and disconnect the objects from the VariantTags. And before loading the diagram, I'll need to recreate the objects, load the diagram and then re-assign them back to the diagram.

Will this work, or is there a simpler solution?

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: LoadFromString Error
Reply #8 - Oct 13th, 2005 at 5:32pm
Print Post  
Ok, is that object created by you or a third party ? Can you paste here the serialization code for it ?

>>  On a side note, I am impressed with the tech support responses I am getting from you.

Thanks, it's my fourth year doing tech. support for this control so I know all its secrets   Roll Eyes
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: LoadFromString Error
Reply #9 - Oct 13th, 2005 at 5:36pm
Print Post  
Do you have the source code for these class ? If it is in C++, try implementing the IPersistStreamInit interface. If it's in VB, mark the class as Persistable and implement its ReadProperties and WritePropeties method.

Stoyan
  
Back to top
 
IP Logged
 
weng.d.leong
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 6
Joined: Oct 13th, 2005
Re: LoadFromString Error
Reply #10 - Oct 13th, 2005 at 5:40pm
Print Post  
The object is created by me under the same project defined as a Class module (not a ActiveX reference).

Here is my COM serialization code. It is done when a Box is created. I allow the users to create 2 type of boxes: Comment Boxes or TestBoxes. TestBoxes will use COM serialization.

The class ClassTestBoxContainer is a local Class module with Instancing set to Private. The entire project is to be compiled as an ActiveX Executable.


Code
Select All
Public Sub Page_BoxCreated(ByVal box As FLOWCHARTLibCtl.IBoxItem)
 If (False = FormTestFlow.cmdbtnModeTestBox.Enabled) Then
  'TestBox Mode
   box.UserData = USERDATA_ID_TESTBOX
   'create object and assign handle to TestBox
   ReDim Preserve objTestBoxInfo(lTestBoxInfo_Count)
   Set objTestBoxInfo(lTestBoxInfo_Count) = New ClassTestBoxContainer
   objTestBoxInfo(lTestBoxInfo_Count).TestBoxIndex = lTestBoxInfo_Count
   box.VariantTag = objTestBoxInfo(lTestBoxInfo_Count) 'assign object handle
   lTestBoxInfo_Count = lTestBoxInfo_Count + 1 'increment counter
 ElseIf (False = FormTestFlow.cmdbtnModeComment.Enabled) Then
   'Comment Mode
   box.UserData = USERDATA_ID_COMMENT
 End If
End Sub

 

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: LoadFromString Error
Reply #11 - Oct 13th, 2005 at 5:52pm
Print Post  
Ok, and this class ClassTestBoxContainer, have you implemented its ReadProperties and WriteProperties methods ?

I believe there was a topic earlier in this forum discussing these, let me find the link.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: LoadFromString Error
Reply #12 - Oct 13th, 2005 at 5:53pm
Print Post  
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint