On Sun, 03 Aug 2008 12:33:55 -0500, Jay Sage <> wrote:
>Before my last reply, I had not read the rest of your message. I just
>downloaded and installed your version with the debug message. Here's
>what I get.
>
>C:\temp>*qbat
>QBAT will use the file: C:\temp\Files\JPSoft\TCMD9\tcc.exe
>QBAT: Bad file extension
Well, I'm dumbfounded. I would expect that string in argv[0] when the string
passed to QBAT is empty. But I'm not looking at argv[0]. What version of
Windows do you use? Below is the code leading to that message. Maybe Rex or
someone else can spot something.
I've put more debugging stuff in it (ftp://lucky.syr.edu/4plugins/qbat.zip).
I see:
g:\projects\plugsample\release> *qbat
psz = ****
argc = 1
argv[0] = **D:\TCMD9\TCC.EXE**
QBAT will use the file: G:\Projects\plugsample\release\qbat.bat
g:\projects\plugsample\release> *qbat jp.bat
psz = ** jp.bat**
argc = 2
argv[0] = ****
argv[1] = **jp.bat**
QBAT will use the file: G:\Projects\plugsample\release\jp.bat
Here's the code.
INT WINAPI QBAT ( WCHAR * psz )
{
INT argc;
WCHAR *p, *q, *r, szExtensions[256], **argv;
for ( p=psz; *p; p++ )
if ( *p == L'/' && *(p+1) == L'?' )
return QBATHELP();
Sprintf(szFileName, L"qbat.bat");
bDeleteFile = FALSE;
argv = CommandLineToArgvW(psz, &argc);
for ( INT i=1; i<argc; i++ )
{
if ( !lstrcmpi(argv
, L"/D") )
{
bDeleteFile = TRUE;
}
else if ( argv[0] )
{
lstrcpy(szFileName, argv);
break;
}
}
LocalFree(argv);
MakeFullName(szFileName, 1);
Printf(L"QBAT will use the file: %s\r\n", szFileName);