VerQueryValue returning NULL for JNICALL

Tech-Archive recommends: Fix windows errors by optimizing your registry



Hi experts,

When I tired to extract the application names from a path Every thing
working perfectly expect for Java appliactions such as JBuilder, java EXEs
...etc. It runs perfectly when I tried to run without using JNICALL.. But
when I tried to use JNI it returns NULL

my code is like

buffLength=GetFileVersionInfoSize(pathOfExe,0);

if(GetFileVersionInfo(sTempStr.begin(),NULL,buffLength,szFileData))
{
bool bRet=VerQueryValue(szFileData,TEXT("\\VarFileInfo\\Translation"),

(void**)&lpTranslate,&nLen);

wsprintf( SubBlock,
TEXT("\\StringFileInfo\\%04x%04x\\FileDescription"),
lpTranslate[0].wLanguage,
lpTranslate[0].wCodePage);



VerQueryValue(szFileData,
SubBlock,
(void**)&lpBuffer,
&nLen);
}

//********

And output is like
1) EXE Path= C:\WINNT\Explorer.EXE
APPNAME = Windows Explorer // CORRECT

2)EXE Path= C:\JBuilder6\jdk1.3.1\bin\java.exe
APPNAME NAME= (null) //Error..

Why this happends?
Pls help
ani


.