Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Need to start an external application using VB.net & CF

Posted on 2006-11-14
7
Medium Priority
?
376 Views
Last Modified: 2010-04-24
I either need to be able to send VK_OFF to the keyboard or I need to be able to start and external application using VB.net w/ CF.  Since I have not a clue how do send a vertual key and I have a utility the suspends the device I figured it would be easy to shell out and run the utility.   This however has not turned out to be so easy.

First I tried

 If File.Exists(strFile) Then
  intRslt = Shell(strFile,AppWinStyle.NormalFocus, True, -1)  
end if

This oddly enough generated a File Not Found Error even after passing the file.exist command.

Next I tried the following getting with the same result

 System.Diagnostics.Process.Start("sample.txt")

Both work wonderfully in the .NET Framework.  Not so well in the CF.  
0
Comment
Question by:Kmc86
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 16

Expert Comment

by:Hillwaaa
ID: 17944756
Hi Kmc86,

Basically the System.Diagnositics.Process() approach is the way to go.  It should work fine (according to msdn, it is supported by CF v2.0 - http://msdn2.microsoft.com/en-us/library/system.diagnostics.process.aspx).  

If you are still having trouble with file not found errors, try (as a test) putting the full path to the application (like c:\temp\sample.exe).

There is also a good article on this (although not for CF) at http://www.devx.com/dotnet/Article/7914

Let us know how you go.

Cheers!
0
 

Author Comment

by:Kmc86
ID: 17947576
When I couidn't get the shell command to work I did  some searching and I found that same article.  The sample code for it works great I actually block copied the code to make sure I wasn't overlooking a simple typo.  But unfortunately still no luck
0
 
LVL 16

Expert Comment

by:Hillwaaa
ID: 17950674
Ok, can you please post the code you are using to try and call your utility?
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:Kmc86
ID: 17951354
It appears as though the shell and the system.diagnostics.process are not supported under the compact framework.  In order to do what I needed done I had to PInvoke.    Thanks anyway

0
 
LVL 16

Expert Comment

by:Hillwaaa
ID: 17951376
No worries - just check that you are using CF v2.0 - it should be supported - but at least you got it working!
0
 

Author Comment

by:Kmc86
ID: 17952693
I have tried it on CE4.1 & CE4.2  w/ CF 1.1  and CE5.0 with CF 2.0 and 2.0 w SP1.   If it is suppose to be supported Microsoft has screwed up.  SURPRISE!!!!!!!!!!!!!!!!  Thanks again
0
 
LVL 16

Accepted Solution

by:
Hillwaaa earned 1000 total points
ID: 17952720
No worries - sorry to have not been more help!
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question