PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197

PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197
Pass an integer variable to vb6-VBForums
Results 1 to 15 of 15

Thread: Pass an integer variable to vb6

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2004
    Location
    in the heart of the Mediterranean
    Posts
    1,143

    Pass an integer variable to vb6

    hey,


    Is it possible to pass a variable from a form in a different project with vb.net to a form in vb6?? If so can someone please give me an example

    Please help me out cos its very urgent for me. Many thanks.

  2. #2
    Fanatic Member
    Join Date
    Jul 2006
    Location
    nasik,india
    Posts
    895

    Re: Pass an integer variable to vb6

    i think,
    you can use a text-file to store variable contents and then you can get value.
    WHETHER YOU SUCCEED OR FAIL IS NOT AS IMPORTANT AS WHETHER YOU TRIED YOUR BEST

  3. #3
    Super Moderator RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,708

    Re: Pass an integer variable to vb6

    If all that is needed is to pass the variable during startup of the app you can use a command line argument.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  4. #4
    Frenzied Member moinkhan's Avatar
    Join Date
    Jun 2000
    Location
    Karachi, Pakistan
    Posts
    2,011

    Re: Pass an integer variable to vb6

    Once I made two Java and VB6 applications to talk with each other through socket programming...

  5. #5
    Hyperactive Member
    Join Date
    Feb 2006
    Location
    Melbourne, Australia
    Posts
    415

    Re: Pass an integer variable to vb6

    You can use SendMessage and create a message hook in the recieving form

  6. #6
    Fanatic Member schoolbusdriver's Avatar
    Join Date
    Jan 2006
    Location
    O'er yonder
    Posts
    1,020

    Re: Pass an integer variable to vb6

    You could use CreateFileMapping to create a shared file in memory...

    Also, if your apps are already making use of the registry, create a key they all access...

  7. #7

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2004
    Location
    in the heart of the Mediterranean
    Posts
    1,143

    Re: Pass an integer variable to vb6

    Hey,

    Many many thanks for all your great responses.

    What I actually can do is use test 2 of your suggestions and see how best they fit with the engine behind the VB6 ( which is not done by me)

    Can the guys who have suggested the following please give me an example?

    RobDog888: how to
    pass the variable during startup of the app you can use a command line argument
    .

    shukla : how to store the variable contents in a text-file

    Appreciate it if you give me some example I can twist around to fit my app.

  8. #8
    Super Moderator RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,708

    Re: Pass an integer variable to vb6

    When you start or shell your vb6 exe you pass the commandline arguments after the exe's filepath and name in the arguments overloads.

    VB Code:
    1. 'VB.NET
    2. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    3.     System.Diagnostics.Process.Start("C:\MyProgram.exe", " /Arg1:SomeArgValue /Arg2:SomeArgValue")
    4. End Sub
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  9. #9
    VB Guru ganeshmoorthy's Avatar
    Join Date
    Dec 2005
    Location
    Sharjah, United Arab Emirates
    Posts
    3,031

    Re: Pass an integer variable to vb6

    to store in a text file and retrieve it...
    VB Code:
    1. Dim myNum As Integer
    2.     Dim sContent As String
    3.  
    4.     myNum = FreeFile()
    5.     Open "E:\Test.txt" For Output As #myNum
    6.     Print #myNum, "Abc"
    7.     Close #myNum
    8.  
    9.     myNum = FreeFile()
    10.     Open "E:\Test.txt" For Input As #myNum
    11.     sContent = Input$(LOF(myNum), #myNum)
    12.     Close #myNum
    13.     MsgBox sContent
    If an answer to your question has been helpful, then please, Rate it!

    Have done Projects in Access and Member management systems using BioMetric devices, Smart cards and BarCodes.


  10. #10
    Super Moderator RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,708

    Re: Pass an integer variable to vb6

    Another thing you can do to communicate between tow apps is to set up a DDE link and also using the mentioned APIs SendMessage and FindWindow, FindWindowEx.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  11. #11

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2004
    Location
    in the heart of the Mediterranean
    Posts
    1,143

    Re: Pass an integer variable to vb6

    RobDog888

    Another thing you can do to communicate between tow apps is to set up a DDE link and also using the mentioned APIs SendMessage and FindWindow, FindWindowEx
    Hey, the above is all too difficult for me.

    1. What is a DDE link and for what is it used exactly please??
    APIs SendMessage and FindWindow, FindWindowEx ??

  12. #12
    Super Moderator RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,708

    Re: Pass an integer variable to vb6

    Dynamic Data Exchange is where you set up your apps as able to process the "messages" from other apps sending it their requests. Its an older technology but has its uses where appropriate.

    The APIs I posted are a more feasible method of transmitting/receiving data. For more info on them check out http://allapi.net and download the API Viewer utility from tht site.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  13. #13

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2004
    Location
    in the heart of the Mediterranean
    Posts
    1,143

    Re: Pass an integer variable to vb6

    hi Robdog88,

    I went through the link and to no avail. It seems that the code provided is for the VB6 and also I could find any step by step of how to link a vb6 to vb.net or viceversa.

    Any better instructions please?? Is inserting a variable in a text file possible. If so do you know of any link or example please. The whole project (vb6,Falsh,vb.net) is using a textfile to collect integers.

  14. #14
    PowerPoster Keithuk's Avatar
    Join Date
    Jan 2004
    Location
    Staffordshire, England
    Posts
    2,235

    Re: Pass an integer variable to vb6

    Quote Originally Posted by angelica

    1. What is a DDE link and for what is it used exactly please??
    Post #5

    http://www.vbforums.com/showthread.php?t=411805
    Keith

    I've been programming with VB for 20 years. Started with VB4 16bit Pro, VB5 Pro, VB6 Pro/Enterprise and now VB3 Pro. But I'm no expert, I'm still learning.

  15. #15
    Super Moderator RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,708

    Re: Pass an integer variable to vb6

    Quote Originally Posted by angelica
    hi Robdog88,

    I went through the link and to no avail. It seems that the code provided is for the VB6 and also I could find any step by step of how to link a vb6 to vb.net or viceversa.

    Any better instructions please?? Is inserting a variable in a text file possible. If so do you know of any link or example please. The whole project (vb6,Falsh,vb.net) is using a textfile to collect integers.
    Did you look up FindWindow, FindWindowEx and SendMessage? They are the easiest methods available that will be the most stable too. What you want to do is not an easy topic to deal with.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width