none
Help! Weird COM dll problem. access denied on XP

    General discussion

  • Please, somebody give me the answer to this puzzle.

    I have re-compiled my C++ com dll with a updated static lib.
    The dll appears to resgister correctly.
    On XP OS I get an Acess Violation calling any of the functions.
    However, on a Vista system, all the function calls work!!!
    If I recompile using the old static lib, then the COM dll works on XP and Vista.

    The COM dll project is VS2005.
    The old static lib is built in VS2003.
    The new static lie is built in VS2005.



    • Changed type Rong-Chun Zhang Wednesday, October 07, 2009 5:56 AM OP doesn't follow up
    Monday, September 21, 2009 5:34 PM

All replies

  • The answer is, you need to debug it to find out where the access violation is coming from.
    Monday, September 21, 2009 5:43 PM
  • Hello Watson,

    Thanks for your post on MSDN forum.

    I am a little confused, when you failed call the functions, is it Access Denied or Access Violation?

    If it is Access Violation, as Brain suggested, you need to debug it and can read the call stack to find where the access violation is coming from.

    If it is Access Denied, it might be caused by some sucerity settings if you use DCOM. Please check the security tab of your DCOM component and make sure that you have the right permission to access the component.

    Thanks,
    Rong-Chun Zhang
    MSDN Subscriber Support in Forum
    If you have any feedback on our support, please contact msdnmg@microsoft.com
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Tuesday, September 22, 2009 8:40 AM
  • I have debugged it right down to the line in the COM dll that calls the function from the lib.

    The error is: Unhandled exception at 0x1001d33a (test.dll) in example.exe: 0xC0000005: Access violation reading location 0x00000000.
    The the debugger is at in the call stack says: > test.dll!__levLog2()  + 0x2a bytes
    That means nothing to me and is not a function in the dll, so must be from the lib I'm linked to.

    I looked at the DCOM side of things and cannot see anything relevent there.

    I think the cause has to be the underlying lib that the COM dll is linked with.
    Everything works well with a lib compiled in VS2003, but with VS2005 lib the application only works on Vista.
    Tuesday, September 22, 2009 9:03 PM
  • Hello Watson,

    Thanks for your effort.

    With the call stack, we can get that the error happened in the levLog2() method. However, it hard to guess why it throw the error without seeing the code. I would like to suggest that you debug the it with the source code to see why it get the Access Violation error.

    If it is convenient, could you please also show us some of your(levLog2 in the static lib)?

    Thanks,
    Rong-Chun Zhang
    MSDN Subscriber Support in Forum
    If you have any feedback on our support, please contact msdnmg@microsoft.com


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Wednesday, September 23, 2009 10:54 AM
  • Hello Watson,

    Thanks for your effort.

    With the call stack, we can get that the error happened in the levLog2() method. However, it hard to guess why it throw the error without seeing the code. I would like to suggest that you debug the it with the source code to see why it get the Access Violation error.

    If it is convenient, could you please also show us some of your(levLog2 in the static lib)?

    Thanks,
    Rong-Chun Zhang
    MSDN Subscriber Support in Forum
    If you have any feedback on our support, please contact msdnmg@microsoft.com


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Wednesday, September 23, 2009 10:55 AM
  • Hello Watson,

    I am writing to check the status of the issue on your side. Would you mind letting me know the result of the suggestions? If you have any additional question, welcome to post here.

    Have a great day!

    Thanks,
    Rong-Chun Zhang
    MSDN Subscriber Support in Forum
    If you have any feedback on our support, please contact msdnmg@microsoft.com


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Friday, September 25, 2009 6:55 AM
  • We are changing the issue type to “General Discussion” because you have not followed up with the necessary information. If you have more time to look at the issue and provide more information, please feel free to change the issue type back to “Question” by opening the Options list at the top of the post window, and changing the type. If the issue is resolved, we will appreciate it if you can share the solution so that the answer can be found and used by other community members having similar questions.

    Thank you!
    Rong-Chun Zhang
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Wednesday, October 07, 2009 5:56 AM