Results 1 to 13 of 13

Thread: How to Increase Visual Basic Functions STACK

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2010
    Posts
    12

    How to Increase Visual Basic Functions STACK

    Hi,I have to use nested & complex functions (call 3 functions inside a function) in my app. But I am sure that visual basic 6 stacks is not enough for my purpose. How can i increase stack?

  2. #2
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: How to Increase Visual Basic Functions STACK

    VB doesn't havea stack... the computer has a stack... why would you think that you would need more stack space?

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  3. #3

    Thread Starter
    New Member
    Join Date
    Mar 2010
    Posts
    12

    Re: How to Increase Visual Basic Functions STACK

    Becase when i called a major function( a function which call 5 heavy functions inside of itself) all my sub functions worked perfectly but the next line after the major function didn`t execute.

  4. #4

    Thread Starter
    New Member
    Join Date
    Mar 2010
    Posts
    12

    Re: How to Increase Visual Basic Functions STACK

    I am using BASCOM too & there is an option for increasing Stack for functions. It gives me this ability to call more than 3 sub functions in a major function.

  5. #5
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: How to Increase Visual Basic Functions STACK

    then something else is going wrong because I've created hundreds of funciton that call dozens of other functions, and in some cases that function is on a different machine from the app.... never had a problem. Something must be wrong with the functions you are calling or something... there's no reason just calling three functions would cause a problem.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  6. #6

    Thread Starter
    New Member
    Join Date
    Mar 2010
    Posts
    12

    Re: How to Increase Visual Basic Functions STACK

    Thank you from bottom of my heart.

  7. #7
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: How to Increase Visual Basic Functions STACK

    Quote Originally Posted by techgnome View Post
    then something else is going wrong because I've created hundreds of funciton that call dozens of other functions, and in some cases that function is on a different machine from the app.... never had a problem. Something must be wrong with the functions you are calling or something... there's no reason just calling three functions would cause a problem.

    -tg
    I'm curious to know about that. Could you tell me about that

    @amrbab: Could you post your function and the line in which the error occurs ?

    Good luck

    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet

    Social Group: VBForums - Developers from India


    Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...

  8. #8
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: How to Increase Visual Basic Functions STACK

    akhileshbc - it's a .NET thing... called Remoting... I'm not sure that VB6 has that capability.
    It's similar to calling a WebService, but it's different. Not sure I can explain it in a clear, comprehendable way.


    Basically, you create an object (which has to implement the remoting interface), but you can't simply use
    Dim something As New SomeObject
    You have to use a special construct that tells VB 1) That it's a remote object and 2) Where that object is. The object then gets created on the machine at that location - it can be another server on the network, and it can even be the local machine. It's controlled by the config file. So, like in our case, we have a config file that we use during development that says to use the local machine, that way we can debug locally. Then the different servers from the different environments (QA, Testing, Production) have their configs set accordingly.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  9. #9
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,487

    Re: How to Increase Visual Basic Functions STACK

    VB6.EXE seems to use the default stack reserve size, which is 1MB of virtual memory. It also seems to use the default commit increment (chunks the stack is extended by as needed). I can't find the default commit value though.

    The initial stack is probably one or more commit sized blocks but extension to the full reserve amount is automatic.


    Changing these two values is probably possible by relinking the EXE using the /EDIT switch along with the /STACK switch... or by manually altering the PE header of the EXE. As far as I know nobody ever does this.

    Blowing the stack is almost always a sign of runaway recursion.

  10. #10
    Frenzied Member
    Join Date
    Mar 2009
    Posts
    1,182

    Re: How to Increase Visual Basic Functions STACK

    techgnome and akhileshbc, that would be DCOM in the world of VB6...
    Option Explicit should not be an Option!

  11. #11
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: How to Increase Visual Basic Functions STACK

    Quote Originally Posted by techgnome View Post
    akhileshbc - it's a .NET thing... called Remoting... I'm not sure that VB6 has that capability.
    It's similar to calling a WebService, but it's different. Not sure I can explain it in a clear, comprehendable way.


    Basically, you create an object (which has to implement the remoting interface), but you can't simply use
    Dim something As New SomeObject
    You have to use a special construct that tells VB 1) That it's a remote object and 2) Where that object is. The object then gets created on the machine at that location - it can be another server on the network, and it can even be the local machine. It's controlled by the config file. So, like in our case, we have a config file that we use during development that says to use the local machine, that way we can debug locally. Then the different servers from the different environments (QA, Testing, Production) have their configs set accordingly.

    -tg
    Thanks tg ...

    Quote Originally Posted by vb5prgrmr View Post
    techgnome and akhileshbc, that would be DCOM in the world of VB6...
    What is DCOM ?

    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet

    Social Group: VBForums - Developers from India


    Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...

  12. #12
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,487

    Re: How to Increase Visual Basic Functions STACK

    Quote Originally Posted by akhileshbc View Post
    What is DCOM ?
    DCOM

    Pretty fundamental to VB and Windows.

  13. #13
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: How to Increase Visual Basic Functions STACK

    Quote Originally Posted by dilettante View Post
    DCOM

    Pretty fundamental to VB and Windows.
    Ok.. Thanks..

    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet

    Social Group: VBForums - Developers from India


    Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width