I have a class VPEDocument which inherits from VPEControl ( public class VPEDocument : IDEALSoftware.VpeProfessional.VpeControl )
I have made a VPEDocument.Clone() function which does the following:
- Code: Select all
public VPEDocument Clone()
{
IDEALSoftware.VpeProfessional.TVPEStream stream = this.CreateMemoryStream(0);
if (!this.WriteDocStream(stream))
{
stream.Close();
throw new Exception("Clone: Error writing to stream. VPEError = " + this.LastError);
}
VPEDocument newDoc = new VPEDocument();
newDoc.OpenDoc();
if (!newDoc.ReadDocStream(stream))
{
stream.Close();
throw new Exception("Clone:Error reading from stream. VPEError = " + newDoc.LastError);
}
stream.Close();
return newDoc;
}
When I call the newDoc.ReadDocStream(stream) I get an FileDocVersion error.
How can i avoid this? I'm currently using the VPE professional version (trial).
(I have lots of free RAM)
Cheers,
Marius