Results 1 to 8 of 8

Thread: [RESOLVED] Variable Sent To Other VB6 Project?

  1. #1

    Thread Starter
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,948

    Resolved [RESOLVED] Variable Sent To Other VB6 Project?

    I need to know how to get my first project to send another one of my projects a value, eg: Item1 = "1". That is only if the project is sending the value. But if the project isn't sending the value. My second project will be reading Item1 as "0" instead of "1".
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  2. #2
    PowerPoster Fazi's Avatar
    Join Date
    Aug 2005
    Location
    Underworld
    Posts
    2,525

    Re: Variable Sent To Other VB6 Project?

    TheEmp.
    there are many ways.
    you can use a common registry value to exchange data between your app.

    for example :

    Registry

    -Projects of TheEmp

    -- Project 1 Key
    -- Project 2 Key
    -- A common value use to exchange data.
    (so both programs use this location to exchange data.)
    Last edited by Fazi; Oct 18th, 2008 at 01:06 AM.

  3. #3

    Thread Starter
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,948

    Re: Variable Sent To Other VB6 Project?

    How about an INI or CFG file?
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  4. #4
    PowerPoster Fazi's Avatar
    Join Date
    Aug 2005
    Location
    Underworld
    Posts
    2,525

    Re: Variable Sent To Other VB6 Project?

    Quote Originally Posted by ThEiMp
    How about an INI or CFG file?
    yah yah that will also ok. many ways.
    you can also use sendmessage to post the data to your other app (to a hiden text box).

    sendMessage windowHandle,wm_settext, 0&, "Hai app"

    Last edited by Fazi; Oct 18th, 2008 at 02:09 AM.

  5. #5
    VB For Fun Edgemeal's Avatar
    Join Date
    Sep 2006
    Location
    WindowFromPoint
    Posts
    4,255

    Re: Variable Sent To Other VB6 Project?

    Quote Originally Posted by Fazi
    TheEmp.
    there are many ways.
    you can use a common registry value to exchange data between your app.
    yeah, One way I do it (instead of using DDE) is to use the registry to hold the window handle of a textbox and use SendMessage to send data to it, when the textbox receives something its change event fires and the program knows it has new incoming data form the other program.

  6. #6

    Thread Starter
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,948

    Re: Variable Sent To Other VB6 Project?

    Could you please send some source code showing that, particular demostration that you are talking about?
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  7. #7
    VB For Fun Edgemeal's Avatar
    Join Date
    Sep 2006
    Location
    WindowFromPoint
    Posts
    4,255

    Re: Variable Sent To Other VB6 Project?

    Quote Originally Posted by ThEiMp
    Could you please send some source code showing that, particular demostration that you are talking about?
    ' Receiver Program....
    Code:
    ' // Receive value from other program //
    ' * Add a textbox to the Form and name it "txtRcv"
    Option Explicit
    
    Private Sub Form_Load()
        ' hide the textbox so users can't enter data into it!
        txtRcv.Visible = False
        ' save textbox handle to registry.
        SaveSetting "MyCompanyName", "MyProgramName", "ClientRcv", txtRcv.hWnd
    End Sub
    
    Private Sub Form_Unload(Cancel As Integer)
        ' reset registry to zero for added handle.
        SaveSetting "MyCompanyName", "MyProgramName", "ClientRcv", 0
    End Sub
    
    Private Sub txtRcv_Change()
        ' -  incoming data text box -
        Dim IncomingValue As Double
        
        If Len(txtRcv.Text) = 0 Then Exit Sub
        IncomingValue = CDbl(txtRcv.Text)  ' convert incoming text to a double type value.
        txtRcv.Text = ""
        ' do something with the value received.
        MsgBox "Incoming Value = " & IncomingValue
        'Call MySub(IncomingValue)
        
    End Sub
    ' Sender Program....
    Code:
    Option Explicit
    Private Declare Function SendMessageByString Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As String) As Long
    Private Const WM_SETTEXT = &HC
    Private Declare Function IsWindow Lib "user32" (ByVal hwnd As Long) As Long
    
    Private Sub Command1_Click()
    
        ' Send a value to our other (receiving) program.
        Dim Dest_Hwnd As Long
        Dest_Hwnd = GetSetting("MyCompanyName", "MyProgramName", "ClientRcv", 0)
        If IsWindow(Dest_Hwnd) = 1 Then ' if textbox found then send text to it
            SendMessageByString Dest_Hwnd, WM_SETTEXT, 0, "1234567.89" ' send value as text
        Else
            MsgBox "Error: Handle not found!"
        End If
    
    End Sub

  8. #8

    Thread Starter
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,948

    Re: Variable Sent To Other VB6 Project?

    Thanks for that, EdgeMeal!!
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

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