|
i send a vairable to another application but some time the variable damage and add some thing diffrent ... i dont know why ...
for example :
dim s as string ="4294:DN"
windows.minimaiz
send.sendwait("s")/ print in active window
windows.maximize
the problem the first time print the s as 4294:DN on the another window but aftet repeat the action of print the variable will print some thing deffirent like 44294:::DN
why the variable change ??????????
kilany
|
|
|
|
|
Mr kilany wrote: i send a vairable to another application
How are you doing this? There's only about a dozen different ways...
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
i send variable by this fuction
dim ss as string = textbox1.text // here imagen i put "2415666:"
/// here code whcih minimaze the form of vb.net
System.Windows.Forms.SendKeys.SendWait("ss")// here the code which different and change . and after many click of button which make this action the string will print as "245566654" or some thing wrong .. the question why the variable printed like this ....
///here code whcih minimaze the form of vb.net
kilany
|
|
|
|
|
Copy and paste the ACTUAL code, don't retype it here.
What your saying is happening is impossible from the code that you've posted.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
Try
Dim cone As New Conection
Dim ii As Integer = ds.Tables(0).Rows(ComboBox1.SelectedIndex).Item(0)
Dim sh As String = cone.get_Special_data("select Switch_Access_Code from Swiches where Swich_ID=" & ii & "")
b2 = ""
b2 = sh
Me.WindowState = FormWindowState.Minimized
System.Windows.Forms.SendKeys.SendWait(b2)//b2="2494:" come from //database on sql server
Me.WindowState = FormWindowState.Normal
b2 = ""
Catch ex As Exception
MsgBox("الرجاء اختيار القسم")
End Try
End Sub
some times when i click on this button will type on active window 4294: but aslo some time type 44294: and some time 4294:: and some time 4294: and some time 4449942: althought the data which comes from data base is just 4294:
why the variable b2 some time print wrong data not as want ???????
kilany
|
|
|
|
|
Don't make me repeat myself....
The problem is not the variable, but the method in which your code is TYPING it into the other application. I just got done telling you that you've chosen, possibly, the worst method to pass data to another application. SendKeys is NOT guaranteed to put the data into that TextBox exactly as sent. This is because SendKeys cannot control how the keystrokes you're sending are processed by the other app.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Dear.
sorry ... but can you give me a best method which pass data to another application ...
really i need to use it ...and the way to use it ?
kilany
|
|
|
|
|
The best method is if the other application exposes a COM object model to use. Other that that, the possibilities get very complicated. If you're putting text into a TextBox, then you could find a way to get the window handle of the target window and use WM_SETTEXT to fill in the TextBox. Google for "WM_SETTEXT FindWindow" and you'll come up with some examples.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
i dont need to write in note pade and the another application read from it. i need to use the sendwait() method but the problem what happed ? really i dont know maybe i shoudl add timer to the button action to slow down the transfer of data from vb.net to another application ..so i need the solution .. because i work with seminar project and i have a 1/5 as a dead date .. the problem is transfer a data from vb.net to another application without any changes of data..
please i send more than 12 to get the answer but still at this moment without a correct soluation...please help me.
kilany
|
|
|
|
|
No matter what, SendKeys cannot control how the destination application processes the keys sent to it. You can slow it down using a Timer, but I seriously doubt that it'll do you any good.
If you really want to use SendKeys, you'll have to pay VERY close attention to how you other application behaves and how each control behaves when it gets the focus from your app. Then you'll have to modify the key string you send to account for being in the wrong control or to make sure the focus is in the correct control and the insertion point is in the correct position before you send any data. Even then, you can't guarantee accurate results. This is because ANY keystroke or mouse click anywhere on the screen during the SendKeys command, or before the target app processes the keystrokes can seriously screw up what you sent.
The bottom line is there is NO RELIABLE METHOD TO DO THIS!!
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
hi this is a very simple question.
but i'm not getting the ouput.
please some body can send me the code of bind the datagrid with diplaying the image in the datagrid from database.
plz its urgent.
byeeeee
|
|
|
|
|
|
Hey guys,
Is it possible to check if an instance of my application is already running, and if it is, can I make sure that the new instance gets cancelled, and the already running instance gets the focus and a string sent by the new instance before it gets cancelled.
I hope you guys can help me out, because this is one of the things my application really needs to be able to do(it's a Musicplayer).
EDIT: I'm using vb.net 2005 ( )
|
|
|
|
|
VB.NET 2005 (and only 2005) has single instance support built in IF you have enabled the Application Framework option in My Project properties. Then you can enable the "Make single instance application" option just under "Enable application framework". It will not, however, handle passing parameters between the newly started instance and the already started instance.
You can read more about implementing this by searching the articles for "single instance[^]". There's plenty of examples...
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I want to play a wave file using the default audio windows device and also (if installed)the others audio devices.How can I do in visual basic?in particular I already use the Api:
Public Declare Function PlaySoundData Lib "winmm.dll" Alias "PlaySoundA" _
(lpData As Any, _
ByVal hModule As Long, _
ByVal dwFlags As Long) As Long
but this play a file only in default windows audio device.
The next step, that I want to do, is that the user of my application, select which audio device use to reproduct the audio.
|
|
|
|
|
i'm using following statement to redirect the value of single variable value to another page:-
Response.Redirect("AdminAgent.aspx?EMPID=" & x)
within statement i want to send name variable also.
how can i redirect.& similary how can i get in other page.
|
|
|
|
|
The name-value pairs in the querystring are separated by the & character. You should construct an url in the format:
page.ext?key=value&key=value
---
b { font-weight: normal; }
|
|
|
|
|
when i tried the following code from ur suggestion
At the time of Reirecting :
Response.Redirect("AdminAgent.aspx?EMPID=x & EMPName=name")
At the time of Requesting:
Dim id As Integer = CType(Request.QueryString("EMPID"), Integer) for integer
Dim name As string = CType(Request.QueryString("EMPName"), string) for string
its giving error in BOLD Line
Conversion from string "x " to type 'Integer' is not valid.
if u can then send the approprite code
thanx
|
|
|
|
|
aavesh wrote: Response.Redirect("AdminAgent.aspx?EMPID=x & EMPName=name")
That's because you sent the character X, not a value that can be converted to a number.
Response.Redirect("AdminAgent.aspx?EMPID=" & x & "&EMPName=" & name")
In your AdminAgent page:
Dim id As Integer = CType(Request.QueryString("EMPID"), Integer)
Dim name As string = Request.QueryString("EMPName")
I don't where you got this "for integer" stuff from and QueryString returns a String, so there is no need to convert a String to a String...
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
hi
thanx for giving me a solution.
sir i'm working on a project in vb.net.which is basically a web site creater project.
i don't have any abt web site creator application.could u guide me.
right now i'm working on its admin part.
according to my project specification there is licesense funda for sites which will be creating.
sir if u can positively help me then let me know.
if possible then i'll sendu my specification on ur personal id.
if u r not interested then plz let me know too.
thanx..whatever will be ur decision..
byeeeeee
|
|
|
|
|
aavesh wrote: i don't have any abt web site creator application
What?? You don't have any "???" web site creator application?
aavesh wrote: according to my project specification there is licesense funda for sites which will be creating
What's a "funda"??
aavesh wrote: sir if u can positively help me then let me know
I don't understand the questions, so there's not much I can say to help...
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
hello sir
sorry for inconvinience.
sir my question is i have to create a web site creator application.
and i don't have any idea about it.how should i work on it.
my second question was how can i attach the licensing feature with my project.
so for that reason i asked u could u guide me on this project.
thanx
|
|
|
|
|
aavesh wrote: how should i work on it.
This is a VERY vague question and entirely dependant on what you mean by a "site creator" and what features you want. The most basic of HTML editors is nothing but a glorified text editor.
Licensing? Google for "software licensing solutions[^]" and you'll come up with a bunch of them. None of them are free though...
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi,
I am new in .NET. I have a system in VB.net currently and the pages is already developed in VB.net. Here if i'd like to use the C# for incoming pages, izzit possible for me to combine both programming language in one solution? Thank you!
|
|
|
|
|
Yes, you can combine different languages in the same solution, but not in the same project. You can have your UI written in VB and in a different project(s), write your Logic and Data layers in C# if you want.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|