Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Clearing Clipboard && Memory


I have a large iterative mathematical model in excel thats driven by vb for apps code. In running the model a large number of results are copied and pasted. This seems to cause memory problems & it crashes. Does anybody know how the clipboard works? Even if you clear the clipboard does it cause an accumulation of memory that also needs to be cleared? The help I need is 1) how do you clear the clipboard? & 2) Does repeated use of the clipboard cause a build up of system resources & if so can it be cleared?
Many thanks!!




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Pls Help Clipboard.Clear Not Clearing The Clipboard
Hail to All,

Ok here is the problem I am having. Clipboard.Clear it not clearing the clipboard on all machines my program is run on. Most machines it works fine. Other still have what was previously copied. Here is a test I run.

one button has
Clipboard.Clear
Clipboard.SetText "This is a test"


the other button has
Clipboard.Clear
Clipboard.SetText "This is the second test"

Now they go to a blank document of some type notepad word or an e-mail program and hit ctrl-V and it pastes what was previously in the cipboard even though I cleared it. Now if they go to a program like word and manual clear the clipboard they can click button one and it pastes 'This is a test' they then click the second button and it pastes the same text that is in the first button because the clipboard for some reason is not cleared. So, they are having to manually clear the clipboard each time.

Anyone have any ideas?

Thanks for all your help.


Mythos

Clearing The Clipboard In VBA
How do you clear the clipboard using vba in Excel 2000?

Clearing Clipboard
Hi,
New here.
Does anyone know how to clear the clipboard with VBA code.

Thanks,
Cyn

Clearing Clipboard
Anyone know how to clear the clipboard.

I tried using the macro recorder and it gave me "application.cutcopymode = false". so i tried it and nothing.

Please help

Clearing Clipboard On NT
How do I clear the clipboard on NT4 & 2000. I have tried a few that work on 98 but not on NT4 or 2000. I have tried Clipboard.clear / Clipboard.settext,("") / clipboard.gettext / Clipbaord.settext, "" . Any ideas why this works on win 98 and not on WinNT or 2000 and possibley inform me How to accomplish this on NT4 and Windows 2000.

Clearing The Clipboard
Can anybody tell me how to clear the Clipboard from VB..

(or just put a single character into the clipboard to erase what was previously there).

Cheers

Graham.

Clearing Clipboard.
In my word vba macro i'm performing a copy/paste and when the macro closes the document, word asks if i'd like to keep the object in the clipboard when word closes. How do I empty the clipboard and/or prevent this message from popping up?

Thanks!

ddutke

Clearing Clipboard In Excel
In VBA I am copying large amounts of info from one workbook to another. When I go to close the workbook it prompts me if I want to retain the clipboard info. How do I get rid of this message or clear the clipboard. Im not sure what forum to put this in, Im sorry.

VB IDE Clearing Clipboard? * RESOLVED *
Why does opening the VB IDE clear the paste buffer?

I keep cutting slices of code from places (like VBforums), and opening VB only to find the clipboard empty, so I have to go back and cut again.

Is there any way to control this abberant behavior?

Thanks, DaveBo

Clearing Clipboard From VBScript
I am using VBScript to do a series of copies and pastes from Excel into Word. As it does this, the clipboard becomes full, Word complains and asks the user if he wants to keep what's there or not. I would like to eliminate this annoying message by simply clearing the clipboard after each time I paste.

Does anyone know the syntax for clearing the clipboard? I have been unable to find it. Thank you for your help.

Stopping VB From Clearing Clipboard On_load
When I open VB, It clears my clipboard, Anyway to turn this off?

Clearing Memory...
I have a program that builds a pretty big Excel workbook...when i was testing it using about 1/3rd the data, it was fine, but now that I am testing it with all the data, it runs out of memory half way through....is there something I can do to free up memory, like after each sheet is created and then after the data is entered in the cells?

Clearing Out Memory - FSO
If I am using File System Objects and have the above...

Dim objFSO As New FileSystemObject
Dim objFile As File
Dim objFolder As Folder

When I exit the app. do I want to just set

objFSO = nothing

or all of the above variables that user the objFSO?
Thanks,
- Gabe

Clearing Memory ?
Hi guys ,
is there any ways to erase memory of all variables with a single command other then erasing the variables 1 by 1 ?

Thanks In AdvanCE

Clearing Memory
Every time a form is unloaded it doesn't release all
the memory it once used.
Repeatedly loading and unloading forms seems to
hog memory, eventually slowing my application down (till
RTE 7 'Out of Memory').

Is there a way of unloading a form whilst retrieving
all the RAM memory it took (set frm = nothing has no effect and hide/unhide is not viable). Alternatively, if an appliaction is running for a long time, is it possible to
somehow clear the memory of garbage (without rebooting).

Clearing Memory From IE
When calling an activex object inside of internet explorer is there an easy way to release the memory the object uses? Only way I can seem to release the memory is to close the broweser and open it back up. I have a activex control that utilizes a scanner attached to the pc, once I have finished scanning I would like to realease the memory back that the activex control used. Any ideas will be a great help.



Edited by - LoRdRePeNt on 12/12/2003 11:13:30 AM

Clearing Cache Or Memory??
How do you clear out cache or memory using VB 6.0? My program halts after 10-15 mins of execution.

Thanks for helping.

<P ID="edit"><FONT SIZE=-1><EM>Edited by nnguyen on 02/22/01 04:39 PM (server time).</EM></FONT></P>

Clearing Memory Problem
hey all, i'v searched the form to see if there is any way to clear what ever is currently in the form, but i didnt find any so here goes.

this is what you do in my program in steps

1.Enter customer IF number with the letter C first followed by three numbers
2.Press OK
3.Select a product from the list
4.Enter a quantity amount between 1 and 20
5.Click the Add button
6.Repeat steps 10 to 12 as desired
7.Are they a special customer? If yes then check the checkbox
8.Click on the Validate button to make sure everything is ok
9.Click on the Calculate Button
10.Click on the Discount button
11.Enter the date of purchase
12.Click on the Print Button
13.Click Print to print a receipt or close to close this form
14.If anything goes wrong, click on the clear button and fill in all the data again
15.If the customer decides not to buy the item(s) then click Next customer
16.If you wish to exit the program, click on exit and enter the password


if you select step 13 it goes back to the first form after printing or closing. all the text boxes and stuff are "" i use the control code for this. the thing is when i go to add another product, it adds the new product amount to the last customer invoice. ie if the last customer's recipt came to 320, it keep the 320 in the memory. i used the form unload and form load on the print button. when they click print or close, form 2 unloads, so does form1 and thgen it loads form1. i though this would clear everything but it does not.

Clearing Memory Dumps
I have develop an app that is communicating with a modem and is parsing large strings coming from modem the problem is that as the app continue to parse strings the memory that the program is 'eating' grows enormously with result 'memory overflow' .So i though clearing those strings. Easy to do cuase the modem is sending strings only when is ringing so i though by clearing the string just b4 modem ring should clear the memory too but it doesn't . Any ideas?

thnks

ps: i have already used a concat class for appending parsed strings to vars

Clearing Memory Variables
hi

i am set newobj = new obj

and then set mewobj = nothing

but i am still getting memory leakage

did i need to do anything else
or it there another way to free memory

Clearing Memory How Can I Do It Faster?
Hi,

I've got a problem with releasing memory in VB.

what I've got is a class that holds classes that hold classes etc.
the data is about 40 meg of ram.

to perform a nice clean release I made clear functions for all classes.
after that I release the reference to the object.

this methode takes a lot of time (5 min.)

I want to speed it up... but how?

With kind regards,

Jewe

A vb programmer trying to stay a live in a REAL C world

Clearing Memory How Can I Do It Faster?
Hi,

I've got a problem with releasing memory in VB.

what I've got is a class that holds classes that hold classes etc.
the data is about 40 meg of ram.

to perform a nice clean release I made clear functions for all classes.
after that I release the reference to the object.

this methode takes a lot of time (5 min.)

I want to speed it up... but how?

With kind regards,

Jewe

A vb programmer trying to stay a live in a REAL C world

Array Of Class Instances, Clearing Memory
My program has two classes, clsTable and clsTableManager.

clsTableManager is the class which controls all of the clsTable instances, using an array like this.


VB Code:
Private mTables() As clsTable


each clsTable instance has a property called Active which determines if this class still needs to be used.

Every so often I need to be able to loop through the array of clsTable instances and unload all those instances which are no long active (.Active = false) and reorder the array so that only Active clsTable instances remain.

So if I have the following instances

mTables(0) -> Active = True
mTables(1) -> Active = False
mTables(2) -> Active = True
mTables(3) -> Active = True
mTables(4) -> Active = False
mTables(5) -> Active = True

I need the function to destroy mtables(1) and mtables(4) and the new array should have only 4 entries like so...

mTables(0) -> Active = True
mTables(1) -> Active = True
mTables(2) -> Active = True
mTables(3) -> Active = True

I understand the concept behind this all, but I'm not sure how to do it so that the deleted class instances are removed completely from memory.

Picture Box, Clipboard, Memory Issues
I have a program that goes to a web site, copies an image to the clipboard, the sets the image to a picture box in a control array. The issue is that after about 20 images the system runs out of memory. The original file is a PNG file, that is 63 K, but when the image is copied to the Clipboard(and then I tested the image by pasting into pbrush and saving) the file is 6 megs. Any help would be appreciated.

Rules with license agreement with the company providing the information.
1. Images cannot be cached or save in any form to disk. They must be held in memory at all times.
2. In order to print the images, all images of a set must exist.(If this set only includes 2 images, and 2 images are found, print them. If less than 1 are found do not print)


Resolution:
I was using Clipboard.GetData(vbCFBitmap) to get the data from the clip board. I changed it to Clipboard.GetData(vbCFMetafile) which allowed me to keep the image size in memory lower. The Bitmap get was using a lot of memeory. This is not an Ideal solution, however, it is working.

Thanks to anyone who might have given this a thought.

Clearing Memory Usage Of My Application | Getting Memory Usage Of My Application
Hmmm,,

I just looking at applications mem usage, on my Task Manager,

And noticed, all of the programs memory usage rises, as their are in use longer,

So, i was wondering,

Since unloading the app, clears the usage, etc (When done properly)

Is there a way to clear the usage (of old data) whilst its in use,
Its mainly browsers that keep the MEGA usage (IE does too, but thats another point),

So jst wondering

<edit>
Or, How do i Get the memory usage of my application?

If my app reaches something like 50, 000 KB (Leave it on for like 4/5 hours at a time, and that)
I will make a "subRoutine" to re-load the application (since it normally fix's memory loss etc)

TNX

Clipboard.GetData Gets "Out Of Memory" Error
To All:

I have a program which captures a graphic image currently in the clipboard and saves it to a file. Most of the time it works perfectly. Occasionally, the image which has been copied to the clipboard is quite large. When the image is large, I sometimes get an "Out Of Memory" error. The statement having the problem is:

imgSave.Picture = Clipboard.GetData(vbCFBitmap)

I've isolated the problem further to just:

Clipboard.GetData(vbCFBitmap)

What is causing the problem? I can manually paste the image into word, etc., so I know that it is sitting in the clipboard (in fact, my program checks to make sure the clipboard is containing an image)

On a couple instances where it failed, I rebooted the system and it worked, but I have one example where no matter what I do, it still has the "Out Of Memory" problem ...

FWIW: I have 1.5GB of swap, 1GB of memory and not a lot going on with the machine and I still sometimes get the error.

Any help would be greatly appreciated.

Thanks in advance,

Jim

Multidimensional Array Not Clearing Or Other Factors Not Clearing
Hello I have made myself a little tab writing program and I have a little bug in it. Whenever I clear the multidimensional array it will start at the stop I left off. I know your confused right now so I'll show you some pics of what I mean:

The first pic is what the tabs are:

And the second pic is when I clear the -'s and numbers then put some numbers in. The numbers should start at the beginning again when I hit "clear tab":

Clearing Text In Memory (text Keeps Reappearing On Text Box)
Hello, I've written a basic text editor that is specific to certain filetypes.

When I load a file and it appears in the text area, then click on the clear menu item, it clears the text area properly.

But, if I go to open a new document using common dialog's "ShowOpen", then click the cancel button (or press the ESC key) then all the text from the file I cleared reappears in the text area again.

Is there a way to clear the contents of memory for this situation?

I thank you in advance.

Clipboard To DIB Or Clipboard To Picturebox.Picture
Hi there,

I need to paste the content of the clipboard to a DIB or at least be able to paste the clipboard to a picturebox and then from the picturebox to the DIB.

I can paste the clipboard to the picturebox with no problems using something like this:

pic.PaintPicture Clipboard.GetData(vbCFBitmap), 0, 0, 2985, 2985

and can copy a picturebox to the DIB using this class:

http://www.vbaccelerator.com/codelib/gfx/vbjpeg.htm

and then do something like this:

m_dib.PaintPicture pic.Picture, 0, 0, 2985, 2985

The problem is that this works with the picture property of the picturebox, so if I put an image on the picture box thru vb IDE I can copy it to the DIB with that function, but if I paste the clipboard to the picturebox (using the code above) it don't copy it.....

So basicly what I need is either a way to paste the clipboard to a DIB or a way to paste the clipboard into the picturebox so that I can get it with the pic.picture property and not pic.image.

I tried pic.picture = pic.image but that causes a type mismatch...

Thanks in advance,
Fernan

Clipboard To Clipboard Transfer? (image)
Hello,

I am currently writing a screen capture application to monitor my home PC while at work.
I would like it to be able to grab the screenshot and send it to my work PC with the fastest intervals possible.

So far I have managed to grab a screenshot and save it to a file and am now looking to transfer the file using winsock, but this may not be the best / fastest way.

Another idea I had was to save the screenshot to my home machines clipboard using the VB app and then the same app transfers the cliboard contents to my work PCs cliboard (via winsock again) and then my work PCs app moves the image from the clipboard to a picture box on it's page.

anyone got any suggestions or experience at this as it's not as easy as I first thought...

Thanks

How Do I Tell If The Clipboard Is Clear? (No Data In Clipboard)
Hello there everyone!

How do I tell if the Clipboard has any data stored in it?

Thank you and have a great day!
Stilekid007

Clipboard To DIB Or Clipboard To Picturebox.Picture
Hi there,

I need to paste the content of the clipboard to a DIB or at least be able to paste the clipboard to a picturebox and then from the picturebox to the DIB.

I can paste the clipboard to the picturebox with no problems using something like this:

pic.PaintPicture Clipboard.GetData(vbCFBitmap), 0, 0, 2985, 2985

and can copy a picturebox to the DIB using this class:

http://www.vbaccelerator.com/codelib/gfx/vbjpeg.htm

and then do something like this:

m_dib.PaintPicture pic.Picture, 0, 0, 2985, 2985

The problem is that this works with the picture property of the picturebox, so if I put an image on the picture box thru vb IDE I can copy it to the DIB with that function, but if I paste the clipboard to the picturebox (using the code above) it don't copy it.....

So basicly what I need is either a way to paste the clipboard to a DIB or a way to paste the clipboard into the picturebox so that I can get it with the pic.picture property and not pic.image.

I tried pic.picture = pic.image but that causes a type mismatch...

Thanks in advance,
Fernan



Edited by - Fernan82 on 11/24/2003 7:09:38 PM

Shared Memory File - Memory Leak (URGENT)
I use a Shared Memory File, for caching data. With an ActiveX dll my applications read certain data out of the memory file.

When creating the ActiveX Object, the dll accesses the memory file in the Class_Initialize function, unmaps and closes the handle in the Class_Terminate function. After work, the Object is destroyed (Set Object = Nothing).

Whenever calling the CopyMemory API...

VB Code:
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (dest As Any, Source As Any, ByVal bytes As Long)

...from the ActiveX dll to read data from the shared memory, the used memory of the application that created the object, rises for exactly the lentgh of bytes read by the CopyMemory function, and is never released. Not even if the object is destroyed.

thanks for a fast answer.

Memory Unable To Be Read - Can VBA Perform A Memory Drop
Forum readers,

While running some of my more memory-intensive VBA macros, the program sometimes crashes because "memory unable to be read." Is there a VBA command to dump memory in between sections of my macro so it does not use up too much memory at once? I've used "Application.Wait Now + TimeValue("00:00:05")" as a way to pause the macro in between sections but I'm hoping there is a way to clear the computer's memory.

Thank you,
Brian

BitBlt: Desktop To Memory, Memory To Picbox
I'm very new to this BitBlt thing, and to graphics in general - Excel gal venturing outside VBA - so please keep your explanations on a newbie level.

I wanted to learn BitBlt, so I thought I'd write a screenshot maker and try some different approaches to see how it all works. Three out of the four things I tried work as they should. The fourth one doesn't work at all, and I cannot see why. (All four are in the attachment.)BitBlt from desktop DC to picturebox DC. That works, except it doesn't update when I resize the form and the picbox, but I understand why it doesn't, so that's fine.BitBlt from desktop DC to a memory DC and from there to picbox DC. Re-BitBlt from memory DC to picbox DC whenever the picbox is resized. This is the one that fails completely.Resize the picbox to screen size, then BitBlt from desktop DC to picbox DC. Works fine.BitBlt from desktop DC to memory BMP, copy from BMP to clipboard and from clipboard to picbox. Works fine.Since I have 2 fully workable approaches (thanks to Deadalus who helped me get this far!) I'm kind of OK, but it bothers me that I can't see why the last remaining one doesn't work. I'm probably overlooking something simple, but would appreciate help figuring out what it is.

Memory Store && Memory Recall In Calculator.
Hey guys, for a project i am required to create a relatively basic Calculator. I have got the calculator with basic features, including Squared and Square root. To finish it off sufficiently i need to use Memory Store and Memory Recall functions. Now this is totally over my head, can anyone give me a pointer as to what i need to be looking at?

Many thanks,

Andy

Memory Leak Problem, How To Clear Memory?
Does anyone have code to clear memory?

My program dies after a while of usage, i need to clear the memory after each process.... hrm...

Strange Memory Leak With Memory DC
Hi, all

I'm using a memory DC to paint an image before i update the image to the screen. I use a timer to keep the image updating like this...

Code:
Private Sub tmr_Timer()
With cIP.Draw(cDC.hdc)
.Rectangle 0, 0, cDC.Width, cDC.Height, 0, vbWhite, vbWhite
If UBound(cTXT) > 0 Then
Dim A As Integer
For A = 1 To UBound(cTXT)
.Blt cTXT(A).x, cTXT(A).y, cTXT(A).Width, cTXT(A).Height, cTXT(A).hdc, 0, 0, BLT_AND
Next
End If
End With

cIP.Draw(P.hdc).Blt 0, 0, cDC.Width, cDC.Height, cDC.hdc, 0, 0, BLT_STD
End Sub

It runs fine for a while but then the graphics that im storing in my memorydc are bleeding on to either the VB IDE when im working in there or on to the desktop when i'm running my binaries.

Any ideas?

Clearing A Rs
How do i clear the recordset after invoking it so that the rs is a clean slate

Thanks

Clearing A Pic Box
How do u clear a picture box in VB6. Please help me

GDI Clearing
As Evil Cowgod posted last night we have got a problem with this program, the fact it crashes a computer after a while. We have been told it stacks up a lot of GDI resources and because of this it slows down the computer and after a few hours it freezes the computer. This is not useful for the program because it is intended to rune for hoursdays.

Please can someone help us out, i have attached all the files and hopefully you can help sort it out, if you do please post the code here.

Many thanks Frostie

Clearing UDT
Any quick way to set a user defined type back to it's default settings? Thanks.

Clearing Dc Mem
i created a dc mem like this:

Public Function CreateDC(iW as long, iH as long) as long
Dim temp As Long
CreateDC = CreateCompatibleDC(frmMain.hdc)
temp = CreateCompatibleBitmap(frmMain.hdc, iW, iH)
SelectObject CreateDC, temp
DeleteObject temp
End Function

and then bitblt something to it. But now i want to clear the mem so it is blank again(like when it was first created) with out having to release it, then recreate it. Is there something like me.cls?

Clearing An SS Tab
IS there a way to clear a tab on an SS Tab. I have dynamically created Labels and Textboxes on the form. I can't seem to find an easy way to cleat the tab. Any help would be greatly appreciated.

Clearing Txt Box
does anyone know how to clear a txt box in a vb form once it is selected or clicked

example:

the text within the text box is "Serch For..."

how once i click in this text box can i make "Search For..." clear!!!!

Clearing IE's Value
Hi! I have give up searching on the internet for this solution, so I am hoping I could get some top brains here to help me out -

What I would really like is a VB6 sample to clear/delete the Internet Explorer6's Auto Complete, Saved Form and Saved Password value for my XP Pro. I have try finding APIs or some special folder that store them, but just can't find anything useful. Please advice

cheers,

Clearing
Hi, I have a form with a number of TextBoxes on it and these are linked to a simple database. I am trying to add a new input to the database but can only seam to do so by deleting of replacing my old data. This is what I have:

Private Sub cmdAdd_Click(Index As Integer)
txtName.Locked = False
txtName.Text = ""
End Sub
---------------------------------------------
Private Sub cmdUpdate_Click(Index As Integer)
dtaDataBase.Recordset.AddNew
End Sub

How can I do this so it creates a new Name instead of replacing the old one?

Clearing IE Form
Hi! I would like to ask how could we clear/delete the Internet Explorer's Form value(Internet Option - Content - Autocomplete - Clear Form)

I have tried the whole day to solve this issue but to no avail, the only option I know is using the DOS KEY(sending keys to Internet Option), but I would really like something more direct using VB. Anyone got any idea?

P/s - I am using XP Pro and VB6

Thank you,

Clearing Txt Files
i have a program that inputs information from a txt file into labels, but i now need to once the information has been put into the labels i need it to remove the contents of the txt file, so it is blank. can anyone help?

Copyright 2005-08 www.BigResource.com, All rights reserved