Solved

Small Footprint

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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…
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…
Suggested Courses
Course of the Month6 days, 9 hours left to enroll

636 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