|
I am not sure if this is the proper forum...
I am looking to create a VB.NET based Forms App that will interact with a Web Service. I want to have a main/UI thread that spawns a thread to handle the web service. How do I then, communicate between the two once this is done? I will need to have the Web Service handling thread send information back to the UI, but also have the UI thread send new information back.
Can someone point me in the right direction or to some articles? I haven't had much luck and, with what I have found, have more questions than answers.
|
|
|
|
|
|
|
I have a VB6 app that needs to send keys to a message box. Is there a way to use the SendKeys method to do so or is there another way? Also..is there a way to execute the next line of code if a line is interupted by a message box... kind of like On Error Resume Next only instead of an error there is a message box?? Thanks for any help.
"Half this game is ninety percent mental."
- Yogi Berra
|
|
|
|
|
You'll find that the method you've chosen to control another application is problematica at best...
You can use the AppActive function to switch the input focus to the window you want (all you need is the exact title of the window) immediately before using the SendKeys function to send the keystrokes. The problem is, the user or another app can steal the focus at any time after the AppActivate function returns. This means that the focus can be moved before OR DURING the SendKeys function. There is NO ERROR when this happens. There is no way you can catch this situation and handle it. Using SendKey, this is just something you have to leave to chance...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Ok..now what I'm really trying to do is find a work around for the Outlook Object Model Guard. The vb6 app gets and sends email through outlook 2003. The Redemption[^] library works well but what about when its time to upgrade to Office 2005 or something?? We have a lot of apps (web and windows)that use Outlook 2003 and we dont want to have to go through each of those in a couple years and clean out all the redemption stuff if redemption doesnt happen to be around.We really need to find a work around without using third party software. Thats why I thought about using SendKeys. I need some code that "watches" for message boxes so I can SendKeys to them as needed.
|
|
|
|
|
Your only work around is to disable the security through policies. But, that would also let the email worms do what they want to. There is no easy way around this. The "SendKeys" method is also not a method I would in production. It's just to unreliable...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I have a VB.Net Windows service that needs to access a network drive. The code works as desired as a console app on the server but fails on the network share access as a Windows service. I have used both the Local System account as well as the local admin account to run the service. Same results both times. In ASP.NET I know the work around is to use Identity Impersonate in the web.config file but this is a Windows app not a web app. Any suggestions are appreciated and I apologize for the cross post.
"Your destiny lies before you, choose wisely."
|
|
|
|
|
You've used both the Local System account and the Local Admin account, neither of which has rights to the network share. You have to run the service under an account that has appropriate rights to the local system AND to the network. That's why the app ran fine in the debugger. It was running under YOUR account.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I am not able to select the 1st item from the dropdownlist.
If I select any other item .. it recognice and i am able to see it in Dropdownlist1.selecteditem.item
any help please
|
|
|
|
|
There is no known problem with the DropDownList. You'll have to post the code your using to populate the list and handle the SelectedItem event so we can see what your doing wrong...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I am reading XMlnode file and row tage have THISNAME AND THISID attributes
Dim NodeList As XmlNodeList = node.SelectNodes("//row")
Dim i = 0
Dim count = NodeList.Count
While (i < count)
Dim element As XmlElement
element = NodeList.Item(i)
Dim thisNameNode As XmlNode = element.Attributes.GetNamedItem("THISNAME")
Dim thisIdNode As XmlNode = element.Attributes.GetNamedItem("THISID")
If Not (thisNameNode Is Nothing) And Not (thisIdNode Is Nothing) Then
Dim thisNameValue As String = thisNameNode.Value
Dim thisIdValue As String = thisIdNode.Value
Dim item = New ListItem(thisNameValue, thisIdValue)
DropDownList1.Items.Add(item)
End If
i += 1
End While
Thanks,
|
|
|
|
|
So far, so good... What about the code that handles the SelectedItem event?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
private Sub DropDownList1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DropDownList1.SelectedIndexChanged
If DropDownList1.SelectedItem.Selected = True Then
Label3.Text = DropDownList1.SelectedItem.Text
End If
End Sub
here i don't see anything when i select 1st item
|
|
|
|
|
Don't check for the status of the Selected item. I take it your supporting only one selected item at a time. So don't check for the Selected property, you don't need it. Just use this:
Private Sub DropDownList1_SelectedIndexChanged( _
ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles DropDownList1.SelectedIndexChanged
' This will check to see if an Item is really selected...
If Not DropDownList1.SelectedItem Is Nothing Then
Label3.Text = DropDownList1.SelectedItem.Text
End If
End Sub
If the event that more than one item is selected, this code will return the selected item with the lowest index in the DropDownList Items collection.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
It waorks fine when i have dropdownlist with more then one item but when i select the first item from dropdownlist in this case only one item in dropdownlist .. still the same problem.
I am populating dropdownlist dynamically so don't know how many items will be in that dropdowmlist. i know it's going to be atleast one.
|
|
|
|
|
Then take out the if statement. This won't catch any errors and doesn't put any restrictions on what will be displayed.
Private Sub DropDownList1_SelectedIndexChanged( _
ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles DropDownList1.SelectedIndexChanged
Label3.Text = DropDownList1.SelectedItem.Text
End Sub
RageInTheMachine9532<font size="-1">
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome</font>
|
|
|
|
|
|
I have no idea what your doing wrong, because the same code works fine for me...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
(REVISED)
I am trying to do the following:
-Check each Point of a chart series to ensure it is within specific limits
-If Point is not in limit, change the Marker type of that Point
What my question is, how do you check specific Points in a series using VBA?
---------------------------------
After posting this question, I found out how to check the point values. I still cannot figure out how to change these individual Marker types to what I want.
Here is the code to check the values:
'***Checks series points, and colors them if need be<br />
Function RefreshPoints(ChartName)<br />
<br />
Dim nPts As Integer<br />
Dim aVals As Variant<br />
<br />
Worksheets(ChartName).ChartObjects(1).Activate<br />
<br />
With ActiveChart.SeriesCollection(1)<br />
nPts = .Points.Count<br />
aVals = .Values<br />
For iPts = 1 To nPts<br />
MsgBox aVals(iPts)<br />
Next iPts<br />
End With<br />
<br />
End Function
Can anyone tell me how to build on that above function to change the marker type of a single Point?
|
|
|
|
|
For those who care, I have solved my problem.. here is the final code:
'***Checks series points, and colors them if need be<br />
Function RefreshPoints(ChartName)<br />
<br />
Dim nPts As Integer<br />
Dim aVals As Variant<br />
<br />
Worksheets(ChartName).ChartObjects(1).Activate<br />
<br />
With ActiveChart.SeriesCollection(1)<br />
nPts = .Points.Count<br />
aVals = .Values<br />
For iPts = 1 To nPts<br />
.Points(iPts).MarkerBackgroundColorIndex = 35<br />
.Points(iPts).MarkerForegroundColorIndex = 1<br />
.Points(iPts).MarkerStyle = xlTriangle<br />
.Points(iPts).MarkerSize = 13<br />
.Points(iPts).Shadow = False<br />
Next iPts<br />
End With<br />
<br />
End Function
Now its just missing a few If statements to finish up, but thats what got it working. Just thought I'd post the code if anyone was interested.
|
|
|
|
|
When I use this code:
Dim pubsadapter As sqldataadapter = New sqldataadapter("select*from authors", pubssqlconn)
And Build It. the results gives me that sqldataadapter not defined.
I Imports the following before:
Imports System.Data
Imports System.Data.SqlClient
Thanks
Go forward and never Stop....
|
|
|
|
|
Then it should work. The lowercase spelling of the SqlDataAdapter name tells me that the Imports statements are incorrect somehow. They are spelled correctly, but possible not at the very top of the code file? They should normally come before any Namespace or Class statements.
You might want to try posting the code so we can see it?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Does it give any error at 'Imports' statement. VS.NET includes reference to System.Data.dll in most of the project templates. If we remove this reference to System.Data.dll, Imports will have no meaning. Imports is just to import the namespaces just for coding purpose but we still have to have a reference in the project.
BK
|
|
|
|
|
Hi.
Can anybody tell me if there is a way to move nodes within a TreeView? I have found how to use drag-and-drop between two different TreeViews but haven’t been able to figure out how to tweak the code to make it work within ONE TreeView.
I would like to be able to simply move child nodes (and parent, if possible) up and down in the Tree.
Thanks
Brad
|
|
|
|