April 26, 2024, 07:03:04 AM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


GetCommandLineA causing error

Started by Allan, September 02, 2008, 07:08:15 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Allan

September 02, 2008, 07:08:15 PM Last Edit: September 02, 2008, 07:20:13 PM by Allan
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.

Ionic Wind Support Team

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.
Ionic Wind Support Team

Allan

Oops!   ::)

Thanks Paul.

The most obvious things are invisible...