|
If I read what your doing correctly, all your are trying to do is launch an arbitrary application. In that case, all you have to do is start the application using the Shell.
But, for some reason, you are using the automation front ends for these applications. But you don't specify why that is. The flaw in your plan is not obvious, but simple. Most applications don't expose a usable automation front end; Notepad, Wordpad, and WinZip being examples.
Think about it... What is Notepad? Nothing but a TextBox control with a small interface wrapped around it. Wordpad is just an interface wrapped around a RichTextBox control.
In order to help out with this we're probably going to need a bit more information about what you are trying to do and why.
RageInTheMachine9532
|
|
|
|
|
Thanks for the reply.
Yes, I agree with respect to the simple applications (notepad, wordpad). I just listed them all because they are all on my list of common applications used by our users.
However, with respect to MS Project and WinZip, I assumed that these Microsoft products would have some form of object model interface.
The reason I don't want to use the shell, is that there will be instances whereby I will want to control aspects of the application launch that are not readily available through a Shell call. For example, I might want to auto-populate some tagged fields in Word.
Any ideas where I can find the object interfaces for these types of applications (not the simple ones ... but Third Party and Microsoft non-office apps).
Thanks,
|
|
|
|
|
Paul Melanson wrote:
WinZip
Paul Melanson wrote:
these Microsoft products
Huh?
Paul Melanson wrote:
For example, I might want to auto-populate some tagged fields in Word.
Well, Word has a COM automation interface, so that won't be too hard.
I'd really like to see the day when all applications have automation interfaces.
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
Sorry ... I assumed WinZip was a MS product, since that is where I downloaded my last version.
Yes, Word has what I need and it would be nice. Maybe XP and it's XML layer will solve the truly integrated office components problem; however, it is my understanding that it is still a few years away.
|
|
|
|
|
Hi.
I would like to know how to link a context menu to a control...
Actually, it's easy to do it with a control like a textbox (in properties, go to ContextMenu and choose your context menu ). But in my case I use an OCX control that does not have contextmenu in properties...
How can I do?
thx!!
bobo
|
|
|
|
|
my screen have some textbox, and I want to goto next textbox when I press ENTER (finish input) on one textbox (same textbox in VB6 Mircosoft Forms 2.0 object library)
thanks any help!
a beginner
dungti
|
|
|
|
|
Put in a KeyPress handler for the edit control, and add the following code:
<br />
if (KeyAscii) = 13 then ' Enter Key<br />
SendKeys "{TAB}"<br />
Endif<br />
This will trap the Enter key, and send a "Tab" to the form. Need to ensure that next control in the tab order is the next control youwant to go to....
Just out of interest - are you sure this is what you want to do? Not really standard windows behaviour, and precludes the use of enter as OK...
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
I have a MDI application that has several child forms. On different child forms, I have to open a dialog form that asks for user input and then update that form. The problem that I am having is that when the dialog box is displayed and the user clicks on another window (ex IE, Word, etc) and then returns to my app, when they close the dialog form the window that they were just on gets the focus rather than my MDI app. How do I fix that?
Thanks,
Brian
|
|
|
|
|
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.
|
|
|
|