|
-
Nov 4th, 2004, 10:01 AM
#1
Thread Starter
New Member
Launching Application from VB6 by Shell
Dear All
I need to run a paging programmer application inside my Visual Basic 6, application,
I am using Shell command as below;
dim retVal
retVal = Shell ( "C:\Programminh\...\Elf.exe",vbMaximizedFocus)
AppActivate retVal
The application runs perfect but the problem is, when the application lauch, it can not find parallel port. But when I run the application out of my VB6 application, It works fine,
I know there is another command in VB6 to launch external application but I can not remember,
Can anybody help me please,
Regards
Behnam
-
Nov 4th, 2004, 10:06 AM
#2
Member
VB Code:
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Private Sub Form_Load()
ShellExecute Me.hwnd, vbNullString, "C:\Programminh\...\Elf.exe", vbNullString, "C:\", vbMaximizedFocus
End Sub
-
Nov 4th, 2004, 10:20 AM
#3
Thread Starter
New Member
There is no difference,
Still it can not find Parallel port even I used ShellExecute
Thanks
Behnam
-
Nov 4th, 2004, 10:27 AM
#4
Thread Starter
New Member
Can anybody let me know what is the other command for launching external application,
I know there are other commands in VB apart from Shell and ShellExecute
Regards
Behnam
-
Nov 4th, 2004, 11:20 AM
#5
Addicted Member
It doesn't matter how you launch the application. An execute call is an execute call. Your application may run differently from design mode than in compiled mode. It may have to do with Windows permissions as well. If the program runs stand alone when compiled then it should execute the same from VB.
poooof
Wizard Since 1997    
SQL Server 7.0:2K, Oracle, VB 6.0 EE, VBScript, C/C++, COBOL, RPG ILE, HTML, XML, Perl
-
Nov 4th, 2004, 11:30 AM
#6
Thread Starter
New Member
Hi
Thanks for your email.
my external application which is Elf.exe will run perfect if I run it from desktop. Or run it from explorer. But if I run it from my own executable appliction which I made exe by VB6, It still runs the Elf.exe but Elf.exe can not find parallel port when it runs from my application.
I tried Shell and ShellExecute.
I know there are other command for runing application from VB6 which I have not tried yet, can you please let me know what are they??
Thanks
Behnam
-
Nov 4th, 2004, 11:53 AM
#7
is the port being used by the OS?
-
Nov 4th, 2004, 11:54 AM
#8
Thread Starter
New Member
I SOLVED THE PROBLEM
I put the Elf.exe inside a .bat file and ran the .bat file from my application and it worked.
Thanks all anyway
Behnam
-
Nov 4th, 2004, 11:55 AM
#9
Which Windows version are you using?
-
Nov 4th, 2004, 11:56 AM
#10
Thread Starter
New Member
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
|