Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Pro VB 6
|
Pro VB 6 For advanced Visual Basic coders working in version 6 (not .NET). Beginning-level questions will be redirected to other forums, including Beginning VB 6.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 20th, 2007, 01:18 PM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default Why do API Declarations Incr. .EXE size?

I was pretty confident that this wouldn't happen, but decided to test to be sure.

When it did happen, I was really surprised.

I created a project, remove the default form, and added a module with
Code:
    Public Sub Main()
        Msgbox "I am running . . ."
        End
    End Sub
    in it.

I compiled it, and it became a 16Kb (16,384-byte) .EXE.

I added a module with 88 lines of type declarations. I recompiled, and the .EXE size was unchanged.

Then I added a module with 67 lines of API declarations. Recompiled, and the size swelled to 20,480 bytes.

None of these APIs are used. Why does adding API declarations change the .EXE size?

It seems that their presence ought to only add them to IntelliSense (strictly an IDE issue), and provide necessary info for the compilation process to include them, [u]when they are utilized in the execution process</u>.

What gives?
 
Old December 20th, 2007, 03:54 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

I'm thinking out loud, but maybe since you use a declare to do that, The exe now includes checks and data stuctures to handles the calls (or the future calls, the compiler doesn't check if you use them or not)...

HTH

Gonzalo

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from dparsons signature and he Took that from planoie's profile
================================================== =========
My programs achieved a new certification (can you say the same?):
WORKS ON MY MACHINE
http://www.codinghorror.com/blog/archives/000818.html
================================================== =========
I know that CVS was evil, and now i got the proof:
http://worsethanfailure.com/Articles...-Hate-You.aspx
================================================== =========
 
Old December 20th, 2007, 04:19 PM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

I dropped the exe into Word, and sure enough, the strings of the API names—and in some cases (though not all) the strings representing the location of the routines—are contained in the exe.

There didn't seem to be much more in the way of byte-count. Seems like the argument types might be contained, but not much in the way of structures. (They would have to be pretty small.)

Seems impossible that the reason they would be in the exe is so that they can be verified at exe-startup (now I'm thinking out loud...).
 
Old December 21st, 2007, 12:26 PM
Registered User
 
Join Date: Dec 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi

    i am justeen.now i am in development.in project have 3 seperate exe file
first exe have onely mdiforms.2 and 3 exe have onely fome

      run time can i set form to mdichid propert to first exe mdiforms

 
Old December 21st, 2007, 12:40 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

mmm.. what?

HTH

Gonzalo

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from dparsons signature and he Took that from planoie's profile
================================================== =========
My programs achieved a new certification (can you say the same?):
WORKS ON MY MACHINE
http://www.codinghorror.com/blog/archives/000818.html
================================================== =========
I know that CVS was evil, and now i got the proof:
http://worsethanfailure.com/Articles...-Hate-You.aspx
================================================== =========
 
Old December 21st, 2007, 01:22 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Justeen, don't try and hijack threads.

Justeens post:
http://p2p.wrox.com/topic.asp?TOPIC_ID=67793

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
.: Wrox Technical Editor :.
Wrox Books 24 x 7
================================================== =========
 
Old December 21st, 2007, 03:23 PM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

Justeen, First of all, post your own question.
Second, in English periods go at the ends of sentences, [u]FOLLOWED</u> by a space, and the first letter of the next sentence is capitalized. Following this set of three "rules" will make everything you write easier to follow.

(Also, “I,” as a pronoun naming yourself, is always, always capitalized.)

So:
  I am justeen. Now I am in development. In [my] project [I] have 3 seperate exe file. The first exe have onely [[u]has</u> only] mdi [add space] forms.[add space] 2 and 3 exe have onely fome [add period]





Similar Threads
Thread Thread Starter Forum Replies Last Post
When to use NEW in declarations LarryMoore BOOK: Beginning Microsoft Visual Basic 2008 ISBN: 978-0-470-19134-7 8 September 24th, 2008 04:02 PM
Where are my control declarations? Ron Howerton ASP.NET 2.0 Basics 13 December 6th, 2007 03:11 PM
running an .exe API without installing a service taunon C# 0 June 10th, 2006 09:37 AM
Variable Declarations New2ASPnet General .NET 1 July 30th, 2004 09:49 AM
retaining ENTITY declarations arvin XSLT 3 July 23rd, 2003 01:51 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.