Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Small Footprint

Posted on 2002-04-19
4
Medium Priority
?
157 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 300 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

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

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

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…
Suggested Courses

722 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