OberonPlace.com Forums  

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

Thread Tools Search this Thread Display Modes
Old 24-03-2014, 08:01
VyperOne VyperOne is offline
Join Date: Feb 2003
Posts: 38
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)

    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)

    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
Old 25-03-2014, 08: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

I'd be interested to hear what is going on here as well.
Waiting for a ride in the T.A.R.D.I.S.
Reply With Quote
Old 26-03-2014, 10: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...

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

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

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 18:17
Memory leak in PP11 Horst Corel Photo-Paint VBA 0 16-04-2004 10:13
CorelDraw eating up memory dcsquare CorelDRAW/Corel DESIGNER VBA 1 06-06-2003 10:47
Condition #1002 -Listman- 0737 (Wierd memory leaks issues) wbochar CorelDRAW/Corel DESIGNER VBA 6 15-05-2003 17:48
Memory leak in PP11 Horst CorelDRAW/Corel DESIGNER VBA 0 31-12-1969 19:29

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

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