IonicWind Software

IWBasic => General Questions => Topic started by: Allan on September 02, 2008, 07:08:15 PM

Title: GetCommandLineA causing error
Post by: Allan on September 02, 2008, 07:08:15 PM
I am having problems in a project and ran it with DEBUG..

' Test Commandline which is used with '-hide' when computer is booted up
SUB TestCommandLine
STRING Str2
' Test for any Schedules for today
Str2 = GetCommandLineA()
IF INSTR(Str2, "-hide")
MainDlgState = @SWHIDE  :' Boot up of computer
ELSE
MainDlgState = @SWSHOW  :' Normal start up of Schedule Program
ENDIF
ENDSUB


This code seems to be causing a problem.
If I delemeter out the GET Comandline code it does not throw open the DEBUG window and the program runs.

Leaving it in gets the following in DEBUG window...and the program soes not run.

DEBUG info...
QuoteCall stack:
ntdll! DbgBreakPoint + 1
ntdll! RtlpNtMakeTemporaryKey + 27508
ntdll! RtlpNtMakeTemporaryKey + 32090
ntdll! RtlInitializeSListHead + 71104
ntdll! iswdigit + 296
Schedule! FreeHeap + 133
Schedule! TestCommandLine + 40 File: C:\My EBasic\Schedule\Main.eba, Line: 858
Schedule! SetupMain + 95 File: C:\My EBasic\Schedule\Main.eba, Line: 715
Schedule! ib_main + 697 File: C:\My EBasic\Schedule\Main.eba, Line: 36
kernel32! RegisterWaitForInputIdle + 73

Line 858    IF INSTR(Str2, "-hide")
Line 715    Is after the exit of the Call TestCommandLine()
Line 36      Is after the exit of the sub SetupMain()  which initially called the sub TestCommandLine()

Checked the API docs and it appears to be correct.

' used for auto STARTUP on system boot up
DECLARE EXTERN GetCommandLineA(),string

Any help please?


EDIT

I have attached a small project which shows up the same problem.
Title: Re: GetCommandLineA causing error
Post by: Ionic Wind Support Team on September 02, 2008, 07:37:01 PM
Your GetCommandLineA declare is wrong.  The correct one is:

declare import, GetCommandLineA(), STRING

There is a difference between importing a function and declaring it as external. 

Paul.
Title: Re: GetCommandLineA causing error
Post by: Allan on September 02, 2008, 07:57:13 PM
Oops!   ::)

Thanks Paul.

The most obvious things are invisible...