OberonPlace.com Forums  

Go Back   OberonPlace.com Forums > Developer Forums > VBA > CorelDRAW/Corel DESIGNER VBA

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 24-03-2014, 07:01
VyperOne VyperOne is offline
Member
 
Join Date: Feb 2003
Posts: 37
Default Memory Leaks

I currently develop an application in VB.NET and in one part of the app it repeats a find and replace. The method used is CorelDRAW.Page.TextReplace

After each iteration I can see via Task Manager memory being consumed by this method.

Unfortunately closing the document after the process has completed does not release the memory thereby requiring the user to close CorelDRAW completely to reacquire the spent memory.

Since I can clearly see the issue is with the method itself and not in my code I am posting this here in the hopes someone from Corel could address it.

You can replicate this by simply putting the method in a loop, like below:
(Make sure you have one line of text on your page with the number zero as the text)

Code:
    Sub ProveMemoryLoss()
        Dim iFindString As String = ""
        Dim iCounter As Integer = 0
        Dim CorelPage As CorelDRAW.Page
        Dim cApplication As CorelDRAW.Application
        cApplication = New CorelDRAW.Application
        CorelPage = cApplication.ActiveDocument.ActivePage

        For iCounter = 1 To 10000
            CorelPage.TextReplace((iCounter - 1).ToString, iCounter.ToString, False)
        Next

    End Sub
This problem isn't a big deal when you are only using it a few times but when you have a customer using it to produce 500 to 1000 lines of text it make Corel unstable on low memory hardware.

Any comments or suggestions welcomed. What I need is a way to get this fixed by Corel...
Reply With Quote
  #2  
Old 25-03-2014, 07:22
ddonnahoe's Avatar
ddonnahoe ddonnahoe is offline
Senior Member
 
Join Date: Jan 2004
Location: Louisville, KY
Posts: 552
Send a message via ICQ to ddonnahoe Send a message via AIM to ddonnahoe Send a message via MSN to ddonnahoe Send a message via Yahoo to ddonnahoe
Default

I'd be interested to hear what is going on here as well.
__________________
Sean
Waiting for a ride in the T.A.R.D.I.S.
Reply With Quote
  #3  
Old 26-03-2014, 09:59
SteveDude SteveDude is offline
Senior Member
 
Join Date: Dec 2005
Location: Salina, Kansas USA
Posts: 149
Default ...

I think this may be part of the problem...

Code:
    
        cApplication = New CorelDRAW.Application
You shouldn't use New and that should go in the constructor. You might also try setting...

Code:
    
        cApplication = Nothing
... on exit.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Memory and CorelDRAW X4 VBA mwhouser CorelDRAW/Corel DESIGNER VBA 1 29-07-2010 17:17
Memory leak in PP11 Horst Corel Photo-Paint VBA 0 16-04-2004 09:13
CorelDraw eating up memory dcsquare CorelDRAW/Corel DESIGNER VBA 1 06-06-2003 09:47
Condition #1002 -Listman- 0737 (Wierd memory leaks issues) wbochar CorelDRAW/Corel DESIGNER VBA 6 15-05-2003 16:48
Memory leak in PP11 Horst CorelDRAW/Corel DESIGNER VBA 0 31-12-1969 18:29


All times are GMT -5. The time now is 04:37.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.
Copyright © 2011, Oberonplace.com