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




Memory Concerns


Ok, so I'm working on a game and I'm creating a series of MemDCs to store the graphics. I thought I was cleaning up after myself well, but when I ran the program it eats through memory until the computer freezes. I'm creating my DCs like nyeah:

hdcWork = CreateCompatibleDC(0)
bmpWork = CreateCompatibleBitmap(GetDC(0), PicWidth(i%), PicHeight(i%))
oldWork = SelectObject(hdcWork, bmpWork)

and I'm cleaning up like nyeah:

retval = DeleteObject(bmpWork)
retval = DeleteObject(oldWork)

retval = DeleteDC(hdcWork)

When I comment out the "oldWork = SelectObject..." line, the memory drain stops, but I don't understand why the DeleteObject(oldWork) line isn't working. The retval is nonzero, so it's reporting success. I've tried to leave no room for error by changing the code nyeah:

DeleteObject SelectObject(hdcWork, bmpWork)

But to no avail. Help?




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
SQL Concerns...
I am attempting to check my EmDpsst field in my access2003 database. I am attempting to check all the dates in the field, EmDpsst and see if they are less than 90 days. If so I plan to report them to a txtDpsst.

So far I have the following code:


Code:
Private Sub CallCheck2()
Dim strSQL As String
Dim cn As ADODB.Connection
Set cn = New ADODB.Connection
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
cn.ConnectionString = GetConnString

Dim days As Long
Dim Expired As String

strSQL = "SELECT EmLast, EmDpsst FROM tblEmployee Group BY EmDpsst"

cn.Open
rs.Open strSQL, cn, adOpenStatic, adLockOptimistic

days = DateDiff("d", Now, EmDpsst)

If rs.RecordCount > 0 Then
Do Until rs.EOF
If rs.Fields(EmDpsst) = days < 90 Then
txtDpsst.Text = "Name: " & rs.Fields(EmLast) & " Expiring: " & rs.Fields(EmDpsst) & vbCrLf & txtDpsst.Text
End If
rs.MoveNext
Loop
End If
rs.Close
End Sub


Only my problem is that it is not working lol. Any ideas how I am able to properly adjust my coding?


Much appreciated,
Azeccia

Concerns You!
some of you may think this is unrelated, but i really need this. it is urgent and i need it for a vb app. so please help. i somehow screwed up my 3dsmax exe so it isn't working anymore. does anybody have an original file? cracked or not? R3.1

Vista Concerns
Good day

Why, when a user is reainstalling an application in the same default folder, the database within the application won't replace itself. Actually, it will (if you look at the date modified), but it will still be the old data in it.

I have many concerns with Vista (if the application is creating files, they won't appear, but I solved the problem, it has something to do with file compatibility in Vista).

But the fact Vista is not able to overwrite a DB is a real bummer. Not only in VB, with many users, with simple copy paste, won't be able to access to the new data

Any hints ?
(I am tired to say to the users 'This is because Vista sucks' )

Concerns Over FlexGrid And Licensing
Hello,

I've been reading in this forum about licensing of the MSFlexGrid control.

My Excel/VBA will execute online from a web server and it contains a FlexGrid. Will people have problems running my application if they do not have a license for msFlexGrid?
Or is this just a design time issue?

Thank you,
LadyA

General App Distribution Concerns
Hi all !
I have been working on some VB engines for a few years now and some of them are actually ready ( or about to be ready ) to be distributed or sold. However, I still have some concerns regarding many aspects of the "after coding". I have many questions and observations, I will put them in there in no particular order. Seems like it is the perfect place to do so.

1. If I want to commercialize an engine built in VB, how much does this distribution license costs. Do I have to pay a supplement for any other OCX references used by the program ?

2. Same thing with SQL. Sure, it is quite friendly to use DAO and Access or SQL Server and ADO, but is there any way to use SQL language in our programs without having to pay and distribute expensive prices for those commercial database languages ? Some body told me about MySQL...any other alternatives ?

3. It is no secret that the package and deployment wizard provided with Visual Studio somehow lacks in many ways...When working for my last employer, we had Install Shield 2000, which worked perfectly. But now that I am on my own, I just can't find the expensive Install Shield. Somebody knows any unexpensive setup tools that work great ?

4. Because Microsoft invested a lot in VB language development, I always had this feeling that they MUST have a key to decompile VB EXE's to then get "inspired"...is that just paranoia ?

5. Right now, most of my apps files are just lying in there, unprotected. What is the best way to protect files ( DB, pictures etc... ), so that the user can't access them other than with the program ?

That's a lot of questions I know, but I am sure that those questions may concern a lot of us, depending on if we want to work for somebody else all our lives or building our own projects with no other obligations than delivering OUR own goodies

Common Dialog Concerns
i am trying to analyze any potential issues with commondialog use.

currently i have an image box when clicked does a SHOWOPEN, i am concerned with some long filenames or "weird" characters.

if i have a path on my xp computer c:-=STUFF=- this is would be a problem correct?

how do i work arround differing naming conventions?


TIA

Concerns About MSFlexGrid And Licensing
Hello,

I've been reading about licensing of the MSFlexGrid control.

My Excel/VBA will execute online from a web server and it contains a FlexGrid. Will people have problems running my application if they do not have a license for msFlexGrid?
Or is this just a design time issue?

Thank you,
CyberJar

Is This Possible? (Concerns Arrays And Objects)
Ok, so I've got loads of textboxes on a form, (not all of them are shown at the same time). They're all named P1 to P35.

How can I use a counter to go through each of them in turn and put a number in them?

Here's a mockup of what I tried to do:


Code:
Private Sub Command1_Click()
Dim Count As Integer
Dim Stuff As String

For Count = 1 To 5
Stuff = "Me.Text" & Count & ".Text"
Stuff = Count
Next Count
End Sub


In my mind, this should work :/ 'Stuff' ends up being Me.Text1.Text in the first loop, so if you put the number 1 into it, shouldn't a 1 appear in the text box?

ImageList Questions/concerns
I am using a special command button which allows an image to be assigned to the buttonFace by assigning an image to it's Picture property. I have a lot of buttons on my project and each is a member of the same control array (ie: each having a unique index). I would like to be able to display an image on the button face when the button is normal (UP position) and another image when the button is clicked (DOWN position).

I have looked into the ImageList control and would imagine I would define two ImageList arrays (UP and DOWN image arrays) and have the following questions:

1) Can an ImageList be populated with JPG, GIF and BMP type images?

2) I understand that the size of the images I store in the ImageList can vary in size since I am not linking the ImageList to another control such as a treeview, listView, etc... Do you agree with this statement about varying sized images being allowed?

3) Since each of my command buttons have their own unique index (since they are a member of a control array), I would like to use this same index to access the ImageList array when determining which image to use. Is it possible to change a certain ImageList(X) indexed value during runtime? I allow the user to decide which image they want to associate with a button (UP and DOWN) press during runtime so I will need to change the values of certain ImageList indexed entries during runtime directly

For example: Lets say ImageList.ListImages(8).Picture is populated with an image. Now, the user decides to change the image associated with button #8, so can I simply assign a new value to "ImageList.ListImages(8).Picture" directly? Basically, I do not want to use the "Remove" function of the ImageList (since this would mess up my image associations). Can updating an indexed position of an ImageList being changed directly?

4) I understand the ImageList control is part of the MSCOMCTL.OCX file. Is this the ImageList which most people use or is there a better choice? Will including the MSCOMCTL.OCX into my project increase the size of my application greatly?

5) Is there maxinum number of entries allowed in an ImageList?

6) Will there be a noticible decrease in processing speed when dealing with a large ImageList (200+ entries)?





Edited by - uncletr on 3/5/2007 8:35:06 AM

Making An Exe ! ADODC Concerns
Hello all

I have made a small application in VB6 and am using Access as database. This app basically has ADODC which I did connect initially at design time. However I am now building the string at runtime. When I make an .exe out of it...things go wild....I cannot view the details of the records...also I can view only the First and Last record. The controls are set at design time. Do I need to reset the Datafields at runtime also?

Where do I start????

I have to install the .exe on computers which don't have VB. I have copied the necessary ocx's on those computers however the problem mentioned above is of concern to me

Can someone help me?

Natalie

Concerns That VBA Code Is Visible To Others After Excel Has Been Protected??!!
How do I hide all my code when my Excel spreadsheet is protected from others. I do not want others to able to view my work and possible passwords?

Need Help!

Access 97 Application To Access 2003 - What Concerns?
We have a large Access 97 application that we're planning to eventually replace. Until then, we want to keep it going with minimal changes. People with newer PCs and newer Office versions are having problems with this application, so we'd like to move to Access 2003.

This will be purely a "make it work" upgrade. We're not changing DAO to ADO, or enhancing functionality.

Some of the programs use third party OCXs.

Will this be a simple task, or should I expect problems? Any hints are greatly appreciated.

LB

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

Access TO Access Concerns...help?
I have been playing around with trying to make an automatic connection with the ODBC between two access databases. I have the connection code partially working: my problem: how to append the data I have transferred into the desired mdb. Here is the code I have worked up, I have put together several variations of this, but this is my best so far:

Private Sub Command55_Click()

Dim wrk As DAO.Workspace
Dim objConnection As DAO.Connection
Dim strSQL As String
Dim rst As DAO.Recordset
Dim dbs As Database

'Create an ODBC Workspace.

Set wrk = DBEngine.CreateWorkspace("ODBCWorkSpace", "", "", dbUseODBC)

'Create a Connection.

Set objConnection = wrk.OpenConnection("ODBC;DSN=Switch")

'Prepare the SQL.

strSQL = "Select * from CallData where Office = 'OOTS'"

'Open the Recordset.

Set rst = objConnection.OpenRecordset(strSQL, , dbSQLPassThrough)

Set dbs = OpenDatabase("M:Ootsswitch")

END SUB FOR NOW

OK, this code takes the main Switch.mdb and selects all records that are in the division 'OOTS'. I have set the connection and SQL pass-through Query here. Now, my problem is, how do I get this info into the M:OOTSSwitch mdb. I started writing createTable Def code, but then I realized I wasn't sure how to link the TableDef to this connection. Basically, I am trying to take this connection and paste its data into the OOTSSwitch.mdb..any advice from this point?

This entire application links to VB 6.0, but this Switch.mdb is the backend database and want to keep this sorting code in Access. The "OOTSSwitch.mdb" and two other division mdbs are linked to VB 6.0 exes. Any ideas of how I can finish this code. Thanks

Martin K

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?

Lack Of Memory...my Memory!!
How can you include child command in data report!!

I can't remember how!!

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

Memory DC's
Yet another question from me!! This time about Memory DC's. I've managed to get them working perfectly fine, but now I'm trying to optimize my code as much as possible, the code I currently use is as follows....


Code:
'Load in image
Set tempPic = LoadPicture(sPath)
'Create the backbuffer
backDC = CreateCompatibleDC(Form1.hdc)
'Select the bitmap onto the temp DC
DeleteObject SelectObject(backDC, tempPic.Handle)
'Paint
BitBlt Form1.hdc, 0, 75, 800, 450, backDC, 0, 0, vbSrcCopy
'Clean up
DeleteDC backDC

Firstly I understand what most of this code does however the one line i'm not certain about is this one..
DeleteObject SelectObject(backDC, tempPic.Handle)
what I think it does is Selects the tempPic onto the backDC, then deletes the tempPic, is this correct, or have i got that wrong?

Secondly, when working with a single image in a loop (i.e. Blt a background for a game etc.), I pressumably only need to do half of the above lines once before entering the loop. Assumably the only line that is required to loop is the BitBlt line, is this the case and how much quicker would it be than performing all the steps within the loop.

And Thirdly, when working with a loop using multiple images, I.E. stepping through each image, which of the lines need to be inside the loop, assumably the CreateCompatibleDC and DeleteDC only need to be done once, but what about DeleteObject.

Well any advice is welcome, an answer to the first part will probably answer most of the Second, and Third, but I thought if I wrote the details of what I was trying to achieve then I might recieve a more informed answer.

Out Of Memory ???
hello,

I have a problem to work with the method paintpicture on picturebox.
when i paint a lot of things on the picturebox, i am getting this error.
I can change the autoredraw to FALSE but then i cant see my painting.
there is another solution for that ? there is something to release the batch memory that give me this error (like when i close the runtime, the batch memory released!) ?

thx for helping...

Out Of Memory???
Hi,

I'm developing an application with VB6 SP3 with MSSQL 7 and it runs on Win 2K Prof.

I make a package with the PDW and the installation process works just. The PC is running Win 2K SP3. However, error comes out when I run the application. VB's err.description returns 'Out of memory', err.number is 7.

I don't think it is the case since the application can runs on another machine with much less RAM. I check that the paging is also normal, that the PC is newly installed. Other setup such as ODBC is done.

I see that the error comes out when a form is load:

Public Function startform() as boolean
on error goto geterror
me.show vbModal
msgbox 'Start OK'
.
.

geterror:
msgbox err.description
End function

Message after "Me.show vbModal" is not printed so I guess that problem is right there. Can anyone help me to solve it??

Thanks.

Memory
I have just about finished a submarine game, 2d non dx arcade type
cheap but my first.. as soon as I save my score and close the score window it tells me I am out of memory.. even if my ram booster shows over 50 % ....

to start a new game I call up the application new and close the old game... it says Out of Memory or cant load image #@%!%^ before It closes the old game....
how do I dump my memory that is loaded?
or clear all stored game memory? or Erase buffer?


Billy

Memory
I am in the development, process of writing a graphical engine in VB. I want to load a picture into memory redraw it, leaving out one color. I assume that if the pictures are loaded into memory I can draw them faster. However I wanted to start small and just redraw the image from a bit array.


Code:
Private Declare Function GetObject Lib "gdi32" Alias "GetObjectA" (ByVal hObject As Long, ByVal nCount As Long, lpObject As Any) As Long
Private Declare Function GetBitmapBits Lib "gdi32" (ByVal hBitmap As Long, ByVal dwCount As Long, lpBits As Any) As Long
Private Declare Function SetBitmapBits Lib "gdi32" (ByVal hBitmap As Long, ByVal dwCount As Long, lpBits As Any) As Long

Private Type typBITMAP
bmType As Long
bmWidth As Long
bmHeight As Long
bmWidthBytes As Long
bmPlanes As Integer
bmBitsPixel As Integer
bmBits As Long
End Type

Private PicBit() As Long, BITMAP As PcgBitmap
Private tmpPic As StdPicture

Private Sub Form_Load()
Set tmpPic = LoadPicture("E:Test.bmp")
GetObject tmpPic.Handle, Len(BITMAP), BITMAP
ReDim PicBit(1 To BITMAP.bmWidthBytes * BITMAP.bmHeight)
GetBitmapBits tmpPic, UBound(PicBit), PicBit(1)
SetBitmapBits Picture1.Image, UBound(PicBit), PicBit(1)
End Sub

When this code is executed it draws these odd little rainbow lines across the top and not the image. I have spent an entire day messing with this small portion of code and have only gotten as far as failure, which is very frustrating. If any one can help me in any, I would be very great full.Thanks in advance.

Memory DCs
I went over the web sites and im still unclear on how to implement memory DCs into my game. Basically I want to get rid of the picture boxes int the game. Is there a specfic example of how to make a memory dc instead of using picture boxes for my masks and pics?

Memory
Ive created a map editor for my game, and there i use a sector command to stor all data about each sector, tiles and such. When i set max X value and max Y value to 4500 it says nothing, but if i set it to 5000 it says "not enough memory". i can understand it runs out of memory after a certain amount of sectors, but if u have a very big map, what is a good idea to escape this map size limiting problem? u cant obviu not load a entire 10000x10000 map into memory

Memory?
after i run my dx program about 5 times i run out of memory.
i done the cleanup rotinue and i still get it

Out Of Memory
I just upgraded to Windows XP Home, but now my program won't run. When I first tried to run it, it said I was out of virtual memory. I pressed Help, and it sounded to me like I needed to free up some space on my C: drive. So, I move some files to my D: drive and uninstalled some programs that were on my C: drive. However, it still says out of memory when I try to run my program. I have about 500 MB of space available on my C: drive. How much do I need? Please help! I don't know a whole lot about these things, so please keep it simple. Thank you very much.

Out Of Memory
hello,

i created a vb project, with a splash form & a main form.

i set the splash form as the start up screen and i used "Load frmMain" command in the splash form.

but once the exe program reach the "Load frmMain" command line, it will show an error msg "Out of Memory".(i run my exe program in Win98 and i DO NOT use FM20.DLL file)

anyone encounter this problem before, please advice

thanks in advance

Memory Use
My app works on large amounts of records, eating away at memory. This isn't so much a problem in and of itself, but when the arrays they're kept in a redimmed to 0, the footprint remains.

How can I release memory properly back to the system?

Memory Vb6
I produced this programme whereby it will produced a few circles of colours and have the option to change the colours of the circles. I want to save these colours as maybe for e.g. page 1, change the colours and save it as page2 and so on.

So that if i want to show the colours at page 1, i can just type page 1, press enter and it will show the colours of the circles save as page 1. It will be better if i save the first page in one file so that it will be easy recalling them, page 2 in another file and so on...

How do i save these information and how i recall them back from file according to my programme?

Out Of Memory
hi
i have a mp3 player im working on im having one problem evertime i hit play a msgbox will popup saying Out Of Memory any idea why? thanks...

Out Of Memory
I have an ActiveX exe that I am planning on using for multithreading, but as of right now I'm running into problems.
When my application starts, it first runs the sub Main, which runs an invisible form that does a few startup procedures, and then it chains to another form.

However, when it attempts to load this second form, I get an "Out of memory" error. I put a msgbox in right before the form.show call on the loader form, and a msgbox in on the Form_Load of the new form. The loader form msgbox shows, but the Form_Load doesn't. So, it's not anything I'm doing once the form is actually loaded. It has to be some sort of function or variable or something else that initializes before Form_Load is called. Unfortunately, that means I can't track it down easily.

I tried chaining it to a different form, and it worked fine. The new form has very few controls, and no code. I may try messing around with adding stuff until it crashes, but I can't guarantee I'll be able to provide any more information.

So, any ideas?

Thanks in advance.

Out Of Memory In W98
Hello,

I have a program that loads data from a file when it first runs. Now, it runs fine on W2000 and XP machines. However, on W98 machines I get an Out of Memory error message. The program traps the error and the user has the chance to try loading the data again which then works OK on the second attempt.

Any suggestions as to what may be going wrong? Is it an issue with the way W98 allocates the memory to VB? The machine has 256MB and the amount of data the program tries to load amounts to a less than 10MB.

Thanks.

Out Of Memory
Hi All,

Currently I am having a problem where when I use

Image = System.Drawing.Image.FromFile()

in a loop continously in a function, it will cause the Out of Memory problem,
I have try to Image.dispose and set it to nothing, but seems like still occurs,

Any Ideas on this?

Thanks.

Out Of Memory
Code:
Private Sub cmbFonts_Click()
On Error GoTo Erred
txtSend.SelLength = 0
txtSend.SelText = """" & cmbFonts.Text & """"
txtSend.SetFocus
txtSend.SelStart = Len(txtSend.Text)
txtSend.SelLength = 0
Exit Sub
Erred:
frmMain.ErrorHandler "Chat", "cmbFonts Click"
End Sub
Why does this get out of memory on win 9x/me, but not 2k/xp? and how do I make it not get the error and still do the same thing? (meaning not put the text at the beginning or end, but wherever the cursor is). Thanks!

EDIT: the offending code is the SelText part, apparently.

Out Of Memory!!!! But Why?!
hi guys i have a pc with amd cpu,256mb ram and windowsxp os and another pc p2 cpu and 256mb ram and windows 98 os problem is when i compile program on xp pc and run program on win98 pc it doesnt work properly.. i cant even open or compile project on win98 pc i get out of memory error msg.. i dont think im having hardware problem bcos all other programs run without any problem.. anyway i format pc and try to open project but still cant open it.. i have install only vb6 and antivirus installed.. any idea what causes that problem?

Out Of Memory
I have a richeditbox and i'm inserting pictures into it. After i have inserted more than one (the error sometimes happens on inserting the second or third picture) picture i get:

run-time error '7':

Out of memory

here is the code:

Code:
Private Sub Command1_Click()
ReDim Preserve picLocation(picamount)
picLocation(picamount).pos = RichTextBox1.SelStart
picLocation(picamount).name = Mid$(RichTextBox1.Text, RichTextBox1.SelStart, 1)
MsgBox picLocation(picamount).name
With CommonDialog1
.FileName = "c:lebul3a.gif"
End With
RichTextBox1.OLEObjects.Add , , CommonDialog1.FileName
picLocation(picamount).name = CommonDialog1.FileName
picamount = picamount + 1
End Sub
the picture is only:
c:lebul3a.gif is a tiny 292 bytes

i have no idea why i'm getting this error message

Out Of Memory?
Assh, it keeps saying im out of memory when I try to add or copy another object. WHY WONT IT LET ME FINISH THIS PROJECT?!

God hates me.

Memory...
Is it possible to use a .txt file to store a set of data, so that I can restore this at a later date. I want to be able to make a macro to do this, and assign it to a button, so you click the button and its saved the data, and press another button to restore it.

I cannot simply save the worksheet in .txt format, since I only want a portion of the page to be copied.

Any ideas..?

Out Of Memory In 97
With the following code I get a "Out of Memory" error in Excel 97. In Excel 2002 it works fine. What can I do about this?

Code:
Sub KAD()
Dim i As Integer
Dim j As Integer
Dim B As Integer
B = Sheets(2).Cells(20, 3).Value
For i = 12 To B
For j = 2 To 2
If Sheets(1).Cells(i, 2).Value = Sheets(5).Cells(2, 1).Value Or Sheets(1).Cells(i, 2).Value = Sheets(5).Cells(3, 1).Value Or _
Sheets(1).Cells(i, 2).Value = Sheets(5).Cells(4, 1).Value Or Sheets(1).Cells(i, 2).Value = Sheets(5).Cells(5, 1).Value Or _
Sheets(1).Cells(i, 2).Value = Sheets(5).Cells(6, 1).Value Or Sheets(1).Cells(i, 2).Value = Sheets(5).Cells(7, 1).Value Or _
Sheets(1).Cells(i, 2).Value = Sheets(5).Cells(8, 1).Value Or Sheets(1).Cells(i, 2).Value = Sheets(5).Cells(9, 1).Value Or _
Sheets(1).Cells(i, 2).Value = Sheets(5).Cells(10, 1).Value Or Sheets(1).Cells(i, 2).Value = Sheets(5).Cells(11, 1).Value Or _
Sheets(1).Cells(i, 2).Value = Sheets(5).Cells(12, 1).Value Or Sheets(1).Cells(i, 2).Value = Sheets(5).Cells(13, 1).Value Or _
Sheets(1).Cells(i, 2).Value = Sheets(5).Cells(14, 1).Value Or Sheets(1).Cells(i, 2).Value = Sheets(5).Cells(15, 1).Value Or _
Sheets(1).Cells(i, 2).Value = Sheets(5).Cells(16, 1).Value Or Sheets(1).Cells(i, 2).Value = Sheets(5).Cells(17, 1).Value Or _
Sheets(1).Cells(i, 2).Value = Sheets(5).Cells(18, 1).Value Or Sheets(1).Cells(i, 2).Value = Sheets(5).Cells(19, 1).Value Or _
Sheets(1).Cells(i, 2).Value = Sheets(5).Cells(20, 1).Value Or Sheets(1).Cells(i, 2).Value = Sheets(5).Cells(21, 1).Value Or _
Sheets(1).Cells(i, 2).Value = Sheets(5).Cells(22, 1).Value Or Sheets(1).Cells(i, 2).Value = Sheets(5).Cells(23, 1).Value Or _
Sheets(1).Cells(i, 2).Value = Sheets(5).Cells(24, 1).Value Or Sheets(1).Cells(i, 2).Value = Sheets(5).Cells(25, 1).Value Or _
Sheets(1).Cells(i, 2).Value = Sheets(5).Cells(26, 1).Value Or Sheets(1).Cells(i, 2).Value = Sheets(5).Cells(27, 1).Value Or _
Sheets(1).Cells(i, 2).Value = Sheets(5).Cells(28, 1).Value Or Sheets(1).Cells(i, 2).Value = Sheets(5).Cells(29, 1).Value Or _
Sheets(1).Cells(i, 2).Value = Sheets(5).Cells(30, 1).Value Or Sheets(1).Cells(i, 2).Value = Sheets(5).Cells(31, 1).Value Or _
Sheets(1).Cells(i, 2).Value = Sheets(5).Cells(32, 1).Value Or Sheets(1).Cells(i, 2).Value = Sheets(5).Cells(33, 1).Value Then
Sheets(1).Cells(i, 18).Value = Sheets(1).Cells(i, 18).Value
Sheets(1).Cells(i, 19).Value = Sheets(1).Cells(i, 19).Value
Else:
Sheets(1).Cells(i, 18).Value = Sheets(1).Cells(i, 100).Value
Sheets(1).Cells(i, 19).Value = Sheets(1).Cells(i, 100).Value
End If
Next
Next
End Sub

Using Less Memory
Hey everyone,

I got quite a big application that uses many forms, controls like richtextbox,webbrowser control, media player and more. my project is very big in size(memory wise).. it could take up about 60,000 k. Is there away to reduce that memory usage without remove parts of the program?

What should I watch out for or avoid doing?

Thanks!

Out Of Memory
I have this application which over a period of time I have been producing new builds due to modifications in the source code. The app performs some intialisation and initialises some classes, it then invoke the main form with the .Show method. Up until recently each successive build has worked and previous version that have been installed have continued to work. My latest build installs ok and runs but earlier builds crash out with rte 7 , Out of memory. I have tracked this to the .Show method in the sub main. I have built the earlier version from its source code and this runs ok. If I uninstall the newer version, reinstall the previous then the previous crashes out with rte 7. The exe created from the source code of the previous version if copied into the install folder works. I have not updated any of the dll's used to form the build. Has anyone had similar experiences or where one should look.

Many thanks

VB6 Help - Memory
hi, im using visual basic 6 and creating a program but i cant go any further as its saying to me "error - out of memory" runtime-7

Please Can Some1 Help Me
Many Thanks

PCUser

Out Of Memory?!
I have been writing a code which is mainly a compilation of pictures used for reference. Yesterday when I attempted to add a new form, it said "Out of Memory." What is this about? Is there a limit to VB in terms of MB space? Please help and thx for looking.

Memory
How do I unload a string from memory before using it again?
I have a program that works with extremly large amounts of data(gigabyte range) and it displays an "Out of memory" error after it gets run a couple of times without quiting.

Out Of Memory
I just done my project, there are 13 forms in this project.

i want make it to exe file... but .. each time i create exe file

visual basic shows a msgbox, "Out of menory"

(my PC got 192RAM menory)




a novice

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