Results 1 to 22 of 22

Thread: My program is not working on Win2K

  1. #1

    Thread Starter
    PowerPoster abdul's Avatar
    Join Date
    Dec 2000
    Location
    Ontario,Canada
    Posts
    2,827

    My program is not working on Win2K

    I started creating this program when I was running Windows 98. I was working fine, but when I run it on Windows 2000 now, it gives me that "illegal operation" error message at the start, and then it terminates.
    This program is not done yet because I just worked on it for some time and then just left it away.
    If you can run it on windows 98 properly then please post a reply, and if you can't run it on Windows 2000 then also post the reply about that.
    Attached Files Attached Files
    Baaaaaaaaah

  2. #2
    So Unbanned DiGiTaIErRoR's Avatar
    Join Date
    Apr 1999
    Location
    /dev/null
    Posts
    4,111
    I have win2k don't work, sorry.

  3. #3
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    What about doing a debug run from the start to exactly locate the eror? I don't have Win2k, so I can't do it myself.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  4. #4
    amac
    Guest
    Hey dude... in the function SetDialogsSettings() you are doing copying "Yes" into buffer?

    well buffer isnt allocated... atleast in the source that you posted...


    I dont think it would have been working on Win98 either....

    I have XP... so we can make sure this thing works on this too...

  5. #5
    amac
    Guest
    Alright...

    I think the probably is in your registry functions... You aren't allocating any of your character arrays.

  6. #6
    amac
    Guest
    Yep works fine now.

  7. #7

    Thread Starter
    PowerPoster abdul's Avatar
    Join Date
    Dec 2000
    Location
    Ontario,Canada
    Posts
    2,827
    Did you change anything to make in work? I think there might be some problem working with the registry. Win2K may be accessing the registry different way than Windows 98.
    Baaaaaaaaah

  8. #8
    amac
    Guest
    yah I did make some changes...


    Did you take a look at the SetDialogsSettings() function?

    You are using strcpy() with an invalid pointer. That isn't a Win2K thing.

    That is the first place it crashes

  9. #9

    Thread Starter
    PowerPoster abdul's Avatar
    Join Date
    Dec 2000
    Location
    Ontario,Canada
    Posts
    2,827
    PHP Code:

    BOOL SetDialogsSettings
    ()
    {
        
    HKEY regkey;
        
    char *buffer;
        
    //------------Option DialogBox Settings--------------------------

        
    RegCreateKeyEx(HKEY_CURRENT_USER"software\\Mughal\\EasyRun\\OptionDlg",0NULL0KEY_WRITENULL, &regkeyNULL);
        
    //Is AutoComplete?
        
    strcpy(buffer"Yes");
        
    RegSetValueEx(regkey"AUTOCOMPLETE"0REG_SZ, (LPBYTE)bufferstrlen(buffer));
        
    //Is sorting enabled in combobox?
        
    strcpy(buffer"Yes");
        
    RegSetValueEx(regkey"SORT"0REG_SZ, (LPBYTE)bufferstrlen(buffer));
        
    //Load at startup?
        
    strcpy(buffer"No");
        
    RegSetValueEx(regkey"LOADATSTARTUP"0REG_SZ, (LPBYTE)bufferstrlen(buffer));
        
    //Make a sound when something is run using "EasyRun"?
        
    strcpy(buffer"Yes");
        
    RegSetValueEx(regkey"MAKESOUND"0REG_SZ, (LPBYTE)bufferstrlen(buffer));
        
    //Do what when something is opened using "EasyRun"?
        
    strcpy(buffer"Nothing");
        
    RegSetValueEx(regkey"ONOPEN"0REG_SZ, (LPBYTE)bufferstrlen(buffer));
        
    RegCloseKey(regkey);


        return 
    TRUE;

    So, do I need to allocate some memory for "buffer"?
    Baaaaaaaaah

  10. #10
    amac
    Guest
    Yes

    i changed your declaration of buffer to

    Code:
    char buffer[4] = "";
    You should also get in the habit of initializing all your variables... I noticed a lot of that.

    That fixes everything in that function

  11. #11
    amac
    Guest
    oh wait... i didn't see the

    Code:
    strcpy ( buffer, "Nothing" );
    change it to char buffer[8] = "";

  12. #12

    Thread Starter
    PowerPoster abdul's Avatar
    Join Date
    Dec 2000
    Location
    Ontario,Canada
    Posts
    2,827
    Yah, I noticed that and changed it after.

    But I am still getting the other error message whenever I run my program.
    Here is the code that it gives the error on:

    PHP Code:
    if(MakeFirstReg() == 1)
           {
               
    SetDialogsSettings();
           }
           else
           {
               
    MessageBox(NULL"Second.. time","D",MB_OK);
           } 
    Baaaaaaaaah

  13. #13
    amac
    Guest
    Go through all your registry functions and make sure you are allocating space for all your buffers

  14. #14

    Thread Starter
    PowerPoster abdul's Avatar
    Join Date
    Dec 2000
    Location
    Ontario,Canada
    Posts
    2,827
    Yah, I'll do it...

    I forgot lots of code from this project because I stopped working on it some months ago...that is why, I am having problems with it now.
    Baaaaaaaaah

  15. #15
    amac
    Guest
    after i fixed all that stuff it worked fine.

    as far as i know that is.

  16. #16

    Thread Starter
    PowerPoster abdul's Avatar
    Join Date
    Dec 2000
    Location
    Ontario,Canada
    Posts
    2,827
    Originally posted by amac
    after i fixed all that stuff it worked fine.

    as far as i know that is.
    Is this code also working for you:
    PHP Code:
    if(MakeFirstReg() == 1)
           {
               
    SetDialogsSettings();
           }
           else
           {
               
    MessageBox(NULL"Second.. time","D",MB_OK);
           } 
    If yes, then you are probably not running Windows 2000 or later.
    Baaaaaaaaah

  17. #17
    amac
    Guest
    Are you trying to tell me I dont know what am running?

    And yes it works. And yes I do know what I am running... because I just installed it about 4 or 5 days ago... It's Windows XP.

  18. #18

    Thread Starter
    PowerPoster abdul's Avatar
    Join Date
    Dec 2000
    Location
    Ontario,Canada
    Posts
    2,827
    Originally posted by amac
    Are you trying to tell me I dont know what am running?
    Sounds rude but I did not mean that.

    ----

    If you can run it properly then I have some problem with my OS or the way my OS accesses the registry for my program.
    Baaaaaaaaah

  19. #19
    amac
    Guest
    Sounds rude but I did not mean that.
    Dont worry about it.


    I dont know what to say... do you have a Win2000 machine?

    Are you building on that machine? Because the source code that you posted with the changes I made... works.

    It doesnt crash... nothing.

    Maybe you could try building on that machine. Or if you can trace threw it on that machine.

  20. #20
    amac
    Guest
    Try running this...

    this is the exe I built

  21. #21

    Thread Starter
    PowerPoster abdul's Avatar
    Join Date
    Dec 2000
    Location
    Ontario,Canada
    Posts
    2,827
    It is working fine now..
    I will check my code again.
    Baaaaaaaaah

  22. #22
    amac
    Guest
    let me know when you find out

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