CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    Join Date
    Feb 2013
    Posts
    8

    Post Find and Open a File on Remote Computer

    I have a file on one server(Windows 2003) and need to access from another server (IIS server - Windows 2008) , I have written the program for the same which works fine and I can access the file.

    But when this comes to the DLL (which registered successfully on Windows 2008), its not able to find the file on Windows 2003.

    What could be possible reasons, please help !!!

    Thanks in advance!

  2. #2
    2kaud's Avatar
    2kaud is offline Super Moderator Power Poster
    Join Date
    Dec 2012
    Location
    England
    Posts
    7,822

    Re: Find and Open a File on Remote Computer

    For the moment, forget your program. From the Windows 2008 computer can you see/access the file on the Windows 2003 computer using sharing and Windows Explorer? There are various security policy settings re network that can cause this problem, so these need to be checked first.

  3. #3
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,620

    Re: Find and Open a File on Remote Computer

    Quote Originally Posted by Umesh... View Post
    But when this comes to the DLL (which registered successfully on Windows 2008), its not able to find the file on Windows 2003.
    Could you elaborate a bit on the DLL being registered somewhere? Do you mean that the DLL is COM server?
    Best regards,
    Igor

  4. #4
    Join Date
    Feb 2013
    Posts
    8

    Re: Find and Open a File on Remote Computer

    Yes, I can access the file from Windows 2008 on the Windows 2003. I have written one small seperate program in c++ which runs on Windows 2088 and accesses files from Windows 2003.

  5. #5
    Join Date
    Feb 2013
    Posts
    8

    Re: Find and Open a File on Remote Computer

    The DLL contains the C++ code which search for a file and try to open it.
    The DLL need to be registered on Windows 2008 and the the function to search a file will be called from the ASP code.

  6. #6
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: Find and Open a File on Remote Computer

    @umesh, can you answer the questions asked in post #3?

  7. #7
    Join Date
    Feb 2013
    Posts
    8

    Re: Find and Open a File on Remote Computer

    I have saved the DLL in C:\Windows\Syswow64 folder on Windows 2008 and then registered using regsvr32 command.
    Yes, the DLL is COM server.

  8. #8
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: Find and Open a File on Remote Computer

    Is the dll 32 bit or 64 bit? If 64 bit, is the 2003 system 32 or 64?

    If you have access to the dll source code, I'd recommend creating a debug build and add some trace statements (or logging) to the dll to see what's going on.

    It could be a permissions problem, different path, or a host of other problems. You need to trace/log to find out exactly where things are going wrong.

  9. #9
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,620

    Re: Find and Open a File on Remote Computer

    Quote Originally Posted by Umesh... View Post
    Yes, I can access the file from Windows 2008 on the Windows 2003. I have written one small seperate program in c++ which runs on Windows 2088 and accesses files from Windows 2003.
    Okay, how much you know about COM servers? Are you aware you need to register COM server in the system where you are to invoke one? So did you register it? Otherwise, which way you create the class the DLL hosts?
    Best regards,
    Igor

  10. #10
    Join Date
    Feb 2013
    Posts
    8

    Re: Find and Open a File on Remote Computer

    @Arjay The DLL is 32 bit and I need to register it on Windows 2008 - 64 bit system.

    Do you have any idea, if it makes any difference and if yes then whats that exactlly .... Please help!

  11. #11
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: Find and Open a File on Remote Computer

    Quote Originally Posted by Umesh... View Post
    Do you have any idea, if it makes any difference and if yes then whats that exactlly .... Please help!
    I am trying to help, did you see my previous response?

    If you have access to the dll source code, I'd recommend creating a debug build and add some trace statements (or logging) to the dll to see what's going on.

    It could be a permissions problem, different path, or a host of other problems. You need to trace/log to find out exactly where things are going wrong.
    What I mean here is you are going to have to debug the dll. Either step through the code in a debugger, attach a remote debugger to a debug build of the dll, or add some trace statements and logging.

  12. #12
    Join Date
    Feb 2013
    Posts
    8

    Re: Find and Open a File on Remote Computer

    Okay, I have found that I am getting error code 5 (i.e. Access denied for the user) by using GetLastError() method.

    Now, I have tried to resolve this issue by providing all the access rights to the user, but still I am getting same issue(Error code 5)

  13. #13
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: Find and Open a File on Remote Computer

    Quote Originally Posted by Umesh... View Post
    Okay, I have found that I am getting error code 5 (i.e. Access denied for the user) by using GetLastError() method.

    Now, I have tried to resolve this issue by providing all the access rights to the user, but still I am getting same issue(Error code 5)
    If the dll is running under IIS, you may need to grant the IIS or app-pool account access.

  14. #14
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,620

    Re: Find and Open a File on Remote Computer

    Quote Originally Posted by Umesh... View Post
    Okay, I have found that I am getting error code 5 (i.e. Access denied for the user) by using GetLastError() method.

    Now, I have tried to resolve this issue by providing all the access rights to the user, but still I am getting same issue(Error code 5)
    That's amazing. All this long thread, it does not give a single clue, when the problem happens. Is it registration? Or object creation? Else?
    Best regards,
    Igor

  15. #15
    Join Date
    Feb 2013
    Posts
    8

    Re: Find and Open a File on Remote Computer

    Quote Originally Posted by Arjay View Post
    If the dll is running under IIS, you may need to grant the IIS or app-pool account access.
    Thanks for the tip Arjay... I am trying the way you suggested but till now its not been resolved.

    Please keep posting if anyone has the clue for it.

Page 1 of 2 12 LastLast

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

Featured