|
-
Aug 7th, 2000, 01:44 PM
#1
Thread Starter
Lively Member
I have a program that has many forms with heavy graphics and controls. I wanted to preload all the forms in the memory but I found that the GDI resource is not enough and hang my PC. Is there actually a way to allocate more resource for this without adding new hardware ?
What hardware that affect this ? RAM, Video RAM, Processor ..
Thanks
-
Aug 7th, 2000, 04:12 PM
#2
Monday Morning Lunatic
One of the main problems is running out of GDI handles. There's really no way round it other than rethinking how you put your form together. However, if you use dynamic allocation of things like that, you can often extend the limit.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Aug 7th, 2000, 04:17 PM
#3
transcendental analytic
Try to avoid using too many controls and objects, if you spend much on the interface you could just draw directly on the form instead.
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Aug 7th, 2000, 05:58 PM
#4
When possible, try to use Image's instead of PictureBox's.
-
Aug 7th, 2000, 06:36 PM
#5
transcendental analytic
In other words, if you just need the image for interace you use image control. If you need to access the DC and drawing Vb methods use picturebox.
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Aug 7th, 2000, 06:42 PM
#6
If you're going to draw it on the DC, you'll need a PictureBox anyway so I don't think it will do much, unless you have to draw the same picture multiple times.
-
Aug 8th, 2000, 03:55 AM
#7
Thread Starter
Lively Member
Thank you.. but the problem is that I wanted to load all my forms during startup ( about 30 of them).. so, I guess there is no fix for this unless reduce the preload form.
-
Aug 8th, 2000, 07:47 AM
#8
transcendental analytic
Why do you need 30 forms?
Do you need them to be displayed all at the same time?
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Aug 8th, 2000, 08:12 AM
#9
Fanatic Member
And why do people add apostrophes where they do not belong:
?
One of those high-ranking questions alongside why dogs smell after having a shower.
-
Aug 8th, 2000, 01:20 PM
#10
transcendental analytic
It's probably only my apostrophes out there, i can't help them
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Aug 8th, 2000, 01:29 PM
#11
Thread Starter
Lively Member
no lah.. is just that I want the form to instant popup when call.. since my form use heavy graphics, the form loading take about 1-2 seconds.. which is not nice..
-
Aug 8th, 2000, 03:52 PM
#12
You can use the GdiFlush API to improve performace slightly.
-
Aug 8th, 2000, 10:20 PM
#13
Good Ol' Platypus
If you need 30 forms, what are they for? If most of them are closely related, I suggest making a Subroutine for loading the form with different functions. For example, if it was a dialog, you could try this:
Code:
---form1---
Sub myMessage(Choice1 as String, Choice2 as String, C1Funct as String, C2Funct As String, Message as String)
frmDialog.Text1.Text = Message
frmDialog.Cmd1.Caption = Choice1
frmDialog.Cmd2.Caption = Choice2
'declare C1F and C2F as strings in a module
C1F = C1Funct
C2F = C2Funct
End Sub
---mod1.bas---
Option Explicit
Public C1F As String
Public C2F As String
---frmdialog---
Private Sub Cmd1_Click()
CallByName C1F
End Sub
Private Sub Cmd2_Click()
CallByName C2F
End Sub
I haven't checked the code but it'll probably work.
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation. 
(Just a heads-up)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|