Solved

Small Footprint

Posted on 2002-04-19
4
151 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
  • 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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

803 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