Solved

GetCommmandLine Problem

Posted on 1998-01-26
1
573 Views
Last Modified: 2012-06-22
I use the GetCommandLine function to obtain parameters send to my exe file. It works very well in W95 but in WinNT in doesn't. Here is the declaration:
Declare Function GetCommandLine Lib "kernel32" Alias "GetCommandLineA" () As String
What happens when I call this function in WinNT: Program error occurs(GPF). I tried to change the declaration from  <Alias "GetCommandLineA" () As String> to :
<Alias "GetCommandLineW" () As String> but in that case the function returns only the first character of the command line string.
What's the problem and how to avoid it?
--
I use WinNT 4.0 and VB 5.0 EE
0
Comment
Question by:polygon
[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
1 Comment
 
LVL 8

Accepted Solution

by:
mrmick earned 90 total points
ID: 1453494
Use the VB Command function instead, for example,

CommandParameters$ = Command
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

724 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