Solved

Small Footprint

Posted on 2002-04-19
4
154 Views
Last Modified: 2010-05-02
I'm creating a simple tray icon prg and want it to use as little of ram as possible.  What can i do to acheive this?

Does creating and killing everything on the form (text boxes, labels, ect) with code decrease the imprint vs setting it up visually?

Thx,
geo
0
Comment
Question by:geo90
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 17

Accepted Solution

by:
inthedark earned 100 total points
ID: 6955654
Best thing for SysTray apps is C++ as you can create an app. which depends on nothing else.

The problem with VB Systray Apps is when the users loads another VB app, you may get a DLL in use message.

You can load  VB objects, like text boxes, on the fly but it won't make any difference.

You can also create a formless VB app using Sub Main().  Using Windows API calls you can Regeister a callback to receive Windows messages.  You can define and created Windows API objects using WinAPI type declarations.  But your app will still utilise the VB runtime DLL.

Your best course of action is to Start up C++ and use the application wizard to create a "Hello World" application based on Windows API. You can then see what is required for a minimal app.  Once you understand what is going on you can create the App in VB using the same process handling. But once you understand what is going on you will create you systray in C++ and make it either launch VB exe apps. or create VB ActiveX DLL objects.

If you posted this question on the C++ section you may even get some code that you will just need to insert the name of your VB Activex progID to make it work.
0
 
LVL 8

Expert Comment

by:glass_cookie
ID: 6955742
Hi!

> "Does creating and killing everything on the form (text boxes, labels, ect) with code decrease the imprint
vs setting it up visually?"

Regarding this, VB uses about 1KB of memory for each label, a little more than 1KB of memory for picture boxes, and for the pictures, it takes up the same memory as the size of the picture file (ie. 1 500KB picture uses 500KB of memory).

Thus, there's definitely a trade off between the display and memory usage.

Thus, using as little controls and pictures s possible would help decrease memory usage of your program.

That's it!

glass cookie : )
0
 
LVL 5

Expert Comment

by:gwgaw
ID: 6957347
Like inthedark says C++ is the best for systray apps and, whether you use C++ or VB, your systray app
should do nothing more than sit in the tray and launch another VB app or what ever. Your tray app
should have no controls other than a menu.

'The problem with VB Systray Apps is when the users loads another VB app, you may get a DLL in use message.'

I've been using VB for systray apps since VB4 and never got a dll in use message regardless of how
many VB apps were running.
0
 
LVL 17

Expert Comment

by:inthedark
ID: 6957459
gwgaw I hope you are right but dosen't it depend on what your systray app is doing?


0

Featured Post

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question