|
I'm currently trying to write an application that needs to interface with a 3rd party vb app by automatically 'reading' the text from one of its textboxes into an array in my app.
I do not have access to any of the source code of the 3rd party app and therefore need a method of automatically reading the textbox data from a 'user' perspective.
Can anyone let me know if this is possible, and if so point me in the right direction?
Cheers
Grazza
|
|
|
|
|
Where should I look for info on developing a form
using .mdb on PocketPC in .NET?
"You say your computer won't turn on? Let's see ... [flip flip flip]. Have you run ScanDisk?" - Tech Support
|
|
|
|
|
In VB.NET:
I have yet to find much info on taking an Excel (.xls) file and taking the contents and dumping them into a text file that is comma delimited. I don't want to open Excel and dump the data. Anyone have experience with this or any information? I have no clue how to work with Excel in .NET.
Hollywood
hollywood_vb@yahoo.com
|
|
|
|
|
how can I set a shortkey for a image button?
my button only display bitmap, not display any text. I want set shortcut key on my button. pls, help me - a beginner!!!
thanks alot.
dungti
|
|
|
|
|
i may have answered your question on vbforums.com
like this....
Private Sub Button1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Button1.KeyDown<br />
If e.Alt = True Then<br />
If e.KeyCode = Keys.X Then<br />
MsgBox("alt & x")<br />
End If<br />
End If<br />
End Sub
hope thats what you wanted
Csharp™ the coder formally known as dynamic
Dim TwinsHaveArrived AsString = "twins arrived safely , 17/08/2003 (18:05 & 18:07)"
|
|
|
|
|
I have been tasked to maintain a very useful VB6/SQL2000 application that has third party controls (e.g. TrueDB grid, Crystal 8.5), and link to windows applications (Word2000, PMW) looking to have an intranet presence.
I like some advice on what options exist for porting/rewrite, including weighing the cost vs benefits of non .NET solutions that is compliant to our existing mixed .NET/Win32/IIS5.x environment.
In regards to .NET, we will continue to use Framework 1.0 and I understand the conversion tool does not cater for third party controls. Also if we migrate to .NET, webforms appear to be the more suitable implementation and I am concerned about loss of functionality, especially in links to office applications.
To add further complexity to my situation, the organisation has just began to use its acquired Plumtree portal (not yet .NET friendly), and will therefore need some consideration as to whether the next version of this software should be a portal application (gadget is the term they use).
Has anyone seen a good article I should be reading that discuss experience of other pioneers in this field? I would welcome little pearlets of experience even if there is no complete advice or solution for me. By the way, please do not advise me to use a consultancy firm, I do not want to be outsourced as yet
|
|
|
|
|
Hello, I've written a service that is using serial communication and ADO.
It is installed on about 20 different computers, and works mostly very well.
In some cases I found a problem. The service is automatically started and is normally working OK at reboot.
On these problem computers it does not start, says error "cannot be started, Could not connect to the Service Controller" and in the event log I get event ID 7000 and 7009.
When I start manually from SCM it fails the first time, and works the second time after a second or two. This is every time!!!
Now I had made an extra service with only one task: make sure the main service is running, checking every minute. With this I thought I could work around the problem.
But not!!!
Now at reboot it first fails to start the "Pilot service" and succeed to start the main service!
This is like 2 tries and fail first and succeed second time...
I have checked the computer at energy saving and so on, nothing is at sleep any time...
Anybody recognize this behaviour?
Please let me know before I go nuts...
Gösta Eriksson
|
|
|
|
|
Okay, I admit defeat, I've been looking at this for a long time and I can't figure it out. Look at the following code (VB6):
Private Sub CmdCopy(ByVal sourceFileOrDir As String, _
ByVal targetDir As String)
Dim fso As New FileSystemObject
If fso.FileExists(sourceFileOrDir) Then
' Copy source file to target folder
fso.CopyFile sourceFileOrDir, fso.BuildPath(targetDir, fso.GetFileName(sourceFileOrDir)), True
ElseIf fso.FolderExists(sourceFileOrDir) Then
' Copy source directory contents to target folder
CopyContents sourceFileOrDir, targetDir
Else
MsgBox sourceFileOrDir & vbCrLf & targetDir
End If
End Sub The sourceFileOrDir argument has already been validated, so the file/folder must exist. When I run this in trace mode, it runs fine, each file or folder contents are copied as requested.
But when I run it compiled, the folder contents copy fine but when sourceFileOrDir is a file, the fso.FileExists function returns false and the message box is displayed.
To be more specific, if I set a breakpoint on the first "If" then it works fine, but if I set a breakpoint on the MsgBox line then it doesn't.
Can anyone explain this bizarity for me? Is there a workaround?
Paul
|
|
|
|
|
Paul Riley wrote:
To be more specific, if I set a breakpoint on the first "If" then it works fine, but if I set a breakpoint on the MsgBox line then it doesn't.
You said you find problems after you compile .. How comes you say you put a breakpoint ?
can you show us how you call this function ?
do you use App.Path ?
|
|
|
|
|
hspc wrote:
You said you find problems after you compile .. How comes you say you put a breakpoint ?
Yeah, that comment was an afterthought when I realised that it wasn't necessarily the compile, just whenever you're not tracing when you hit that line specifically. I didn't explain myself very well... sorry.
hspc wrote:
can you show us how you call this function ?
The calling function is an overly complex iteration that parses a number of scripted files to perform automation functions (in short, it builds a whole bunch of stuff to create InstallShield Developer installers). Trust me, you'd wish you'd never asked
If you can give me a clue what you might need to see then I can cut it down to only the relevant bits.
hspc wrote:
do you use App.Path ?
No, the filenames are pulled from the script files.
Paul
|
|
|
|
|
Sorry I can't help..
I just had doubts about the application startup directory.
|
|
|
|
|
hspc wrote:
I just had doubts about the application startup directory.
I know what you mean, I've run into that problem before too.
Thanks for trying anyway. Anyone else?
Paul
|
|
|
|
|
I initiate an instance of Word with the following code, and send values from my form to the Word Template.
After Word closes, an instance of WINWORD.EXE still runs in the Windows Tasklist -> Processes. How do I close ALL instances of WINWORD.EXE after closing my VB.NET project?
Dim oWord As Word.Application<br />
Dim oDoc As Word.Document<br />
<br />
oWord = CreateObject("Word.Application")<br />
oWord.Visible = True<br />
<br />
oDoc = oWord.Documents.Add("AffiliationInvoice.dot")<br />
<br />
oDoc.Bookmarks.Item("AffiliationName").Range.Text = txtName.Text<br />
oDoc.Bookmarks.Item("AffiliationNumber").Range.Text = txtAffiliationLetter.Text & " " & txtAffiliationNumber.Text<br />
oDoc.Bookmarks.Item("ContactName").Range.Text = lblContactName2.Text<br />
<br />
oDoc.Bookmarks.Item("ContactTel").Range.Text = lblTelHome2.Text
|
|
|
|
|
Are you running a web app or a window app? Did you call oDoc.Close? How about oWord.Quit ?
God, I pity me! - Phoncible P. Bone
If I end up Windows ME someone is going to be hurting. - One of the answers to a question for What OS are you
|
|
|
|
|
Hi,
I am trying to make a Real-time plot in VB, where in an applications outputs some data every second to a text file and I need to use this info to plot graphs. Can anybody help me out?
Thanks,
Blaze
|
|
|
|
|
Hello,
Basicly you need to monitor file change (FileChangeNotification API) to detect when new data is available. Signalling your file read/plot routine.
However this is best way to do it, if the plot data resides in disk file. Better method is to allocate memory mapped file, write to it and then signal plotting application.
Regards
Benkku
|
|
|
|
|
Hi everyone. Just wondering if you could help me with this (I have never used VB before). Anyway, if I have a combo box, how do I add items to it through code?
I understand you have to use the AddItem, but dont know the syntax. Please help if you can.
|
|
|
|
|
ComboBox1.AddItem "Item"
simple, eh!
God, I pity me! - Phoncible P. Bone
If I end up Windows ME someone is going to be hurting. - One of the answers to a question for What OS are you
|
|
|
|
|
Hi,
I'm want to print the text file from my application. I use the code below and i use dot-matrix printer to print.
However, i find that the printing process is very slow because the printer will print twice per line.
What other method that can be used other than the method below? What other object can be used to print instead of ev.Graphics.DrawString? Or what other setting can used to make the printing faster/print once per row.
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim prtdoc As PrintDocument = New PrintDocument()
Dim strDefaultPrinter As String = prtdoc.PrinterSettings.PrinterName
Dim strPrinter As String
For Each strPrinter In PrinterSettings.InstalledPrinters
ComboBox1.Items.Add(strPrinter)
If (strPrinter = strDefaultPrinter) Then
ComboBox1.SelectedIndex = ComboBox1.Items.IndexOf(strPrinter)
End If
Next
End Sub
Private Sub pd_PrintPage(ByVal sender As Object, ByVal ev As PrintPageEventArgs)
Dim linesPerPage As Single = 0
Dim yPos As Single = 0
Dim count As Integer = 0
Dim leftMargin As Single = 0
Dim topMargin As Single = 0
Dim line As String = Nothing
' Calculate the number of lines per page.
linesPerPage = ev.MarginBounds.Height / printFont.GetHeight(ev.Graphics)
' Iterate over the file, printing each line.
While count < linesPerPage
line = streamToPrint.ReadLine()
If line Is Nothing Then
Exit While
End If
yPos = topMargin + count * printFont.GetHeight(ev.Graphics)
ev.Graphics.DrawString(line, printFont, Brushes.Black, leftMargin, _
yPos, New StringFormat())
count += 1
End While
'If more lines exist, print another page.
If Not (line Is Nothing) Then
ev.HasMorePages = True
Else
ev.HasMorePages = False
End If
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
streamToPrint = New StreamReader("D:\abc.txt")
Try
printFont = New Font("Verdana", 10)
Dim pd As New PrintDocument()
pd.PrinterSettings.PrinterName = ComboBox1.SelectedItem
If (pd.PrinterSettings.IsValid) Then
AddHandler pd.PrintPage, AddressOf pd_PrintPage
' Print the document.
pd.Print()
Else
MessageBox.Show("Invalid Printer")
End If
Finally
streamToPrint.Close()
End Try
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub
|
|
|
|
|
I'm writeing a small app to automate common taskes in a console based application.I need to send key strokes from my application to the other application, while it is running.I have tried to use System.IO.Process.StandardInput.Write("c") etc but it doesn't work for me. Any thoughts on how to go about this? More generaly is there an easy way (or hard way for that mater) to send an arbitrary windows message to another application?
Thanks
---Quatl
|
|
|
|
|
You could try using SendKeys(), which in theory might work, it is placing keys into the keyboard buffer after all, so another app. that has the foucs might well pick them up.
|
|
|
|
|
Does anyone know how to read/ get the body of message which is in RTF format.. from outlook mailitem?
I could read the message bodies which have either html or plain text format and store it in msg ( msg = String)... but whenever I tried to get the body with RTF format.. I lost all the text format like bold, table, etc..
I tried to used mailItem.HTMLBody and it gave me empty string sicne it is only work for HTML body...
So I found another article [URL=http://support.microsoft.com/default.aspx?scid=kb;en-us;172038]on Microsoft about reading and writing the RTF body message dll [/URL].
I tried to use it but it doesn't work either..
maybe i'm using the wrong way..
anybody used it before???
|
|
|
|
|
I am using the MSChart Control from VB6 using COM Interop. I am creating a 3d line chart. I need to make a bitmap or GIF or whatever of this chart. Can anyone tell me how to do this? Maybe doing something like a Print Screen or something? Thank for any help!
|
|
|
|
|
Hi, I was wondering if there is "report viewer" sample somewhere out there... I need an MS-Access report viewer that does NOT need MS-Access installed on the machine. I understand that in earlier versions of Access, it was possible using the Access Developer's Kit (ADT), but I don't really know how to use it, or any other better and more modern kits - if any exist.
The scenario is this: I have a machine, holding an MS-Access database, that has a few reports in store. The user is using a DIFFERENT computer, and wants to remotely view the reports inside the MS-Access database, but the user doesn't have Access installed.
Thanks..
/=/=/=/=
Deus
/=/=/=/=
|
|
|
|
|
Try the "Snapshot Viewer" free from MS...
|
|
|
|