Results 1 to 4 of 4

Thread: Illegal Operation Error!!!!

  1. #1

    Thread Starter
    Addicted Member Cuallito's Avatar
    Join Date
    Apr 2001
    Location
    You know that chest that you could never get opened? If you ever do, I'm there.
    Posts
    136

    Illegal Operation Error!!!!

    I get an illegal operation error whenever I try to run this program:

    Code:
    #include <iostream.h>
    #include <windows.h>
    
    
    int main()
    {
    	
    	LPSYSTEMTIME lp_time;
    	float sec;
    
    	sec=NULL;lp_time=NULL;	
    
    	while (1==1)
    	{
    	
    		GetSystemTime(lp_time);
    
         	sec=lp_time->wSecond; //This line probably causes the error
    		
    		cout<<sec;
    	}
    
    	return 0;
    }
    I think line 18 causes the error, becuase wenever I remove it and I ask it to cout the lp_time variable I don't get an error. Any ideas?
    BTW, Thanks for all your help

    Member of the anti-gay cross-dressing trans-species wolves alliance.

  2. #2
    I can't even get that far:

    Attached Images Attached Images  

  3. #3
    PowerPoster abdul's Avatar
    Join Date
    Dec 2000
    Location
    Ontario,Canada
    Posts
    2,827
    Remove the line that says "lp_time=NULL"
    Baaaaaaaaah

  4. #4
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Use SYSTEMTIME and pass &lp_time instead
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width