|
-
Oct 17th, 2008, 10:53 PM
#1
Thread Starter
PowerPoster
[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...
-
Oct 18th, 2008, 01:02 AM
#2
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.
-
Oct 18th, 2008, 02:00 AM
#3
Thread Starter
PowerPoster
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...
-
Oct 18th, 2008, 02:05 AM
#4
Re: Variable Sent To Other VB6 Project?
 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.
-
Oct 18th, 2008, 02:13 AM
#5
Re: Variable Sent To Other VB6 Project?
 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.
-
Oct 18th, 2008, 02:24 AM
#6
Thread Starter
PowerPoster
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...
-
Oct 18th, 2008, 02:34 AM
#7
Re: Variable Sent To Other VB6 Project?
 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
-
Oct 18th, 2008, 02:46 AM
#8
Thread Starter
PowerPoster
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|