Sameers Portal


Sameers BLOG

Skip Navigation Links.

Command Line Arguments processing in Pocket PC Application

Posted On: 8/24/2008

When you need to send command line arguments to you Pocket PC (Windows CE) application, you may shock to see that "Command" property (For VB users) is not supported and it throws "NotSupported" Exception. Hummmn, alternate is to use System.Environment.GetCommandLineArgs. BUT when you type this, you will shock again that GetCommandLineArgs is not member of System.Environment. hummm, what to do now?

Well, there is a work around here, fortunately. You need to define a Main function in your application, the entry point to the application. And give it signatures like this

 

Public Sub Main( ByVal args As String ())
': Process the command line arguments here, available in args array
Application.Run( New frmMain)
End Sub

For C# users, the should also use the same technique, by changing the signature of Main function.

So, you can now pass arguments to your Windows CE applications.

Sameers


Comments


Post your comments

Your Name: (Required)
Email or HTTP address: (Optional)
Comments: