none
Using shell32.dll using interop RRS feed

  • Question

  • I have a question about "Microsoft Shell Controls And Automation" (shell32.dll). I am attempting to use it in C# using interop. I probably should post the question in General Windows Desktop Development Issues but since it is specifically about the interop not working perhaps the question is more appropriately somewhere specific to the CLR or .Net (Common Language Runtime Internals and Architecture?). This specific question has been asked in other web sites without a solution but I have found a CodeProject sample that is able to do what I want to do but I don't understand why it works.


    Sam Hobbs
    SimpleSamples.Info

    Saturday, January 27, 2018 1:28 AM

Answers

  • I probably would have suggested the windows desktop dev forum but there's probably no harm in asking in both forums you mentioned.

     

     



    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows Server] Datacenter Management

    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.

    Saturday, January 27, 2018 2:28 AM
    Moderator
  • I did more research preparing to post a question and I found the answer. So I don't need anything more. The answer is that we need a STAThread; console applications are MTAThreads by default.


    Sam Hobbs
    SimpleSamples.Info

    Sunday, January 28, 2018 2:29 AM

All replies

  • I probably would have suggested the windows desktop dev forum but there's probably no harm in asking in both forums you mentioned.

     

     



    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows Server] Datacenter Management

    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.

    Saturday, January 27, 2018 2:28 AM
    Moderator
  • If I post in either one and someone says it should have been posted elsewhere then at least I can say I tried.

    I think that Microsoft representatives sometimes merge questions that are asked in more than one place. So I will post my question in one forum and if there are not answers then I might try the other one,.



    Sam Hobbs
    SimpleSamples.Info

    Saturday, January 27, 2018 9:34 PM
  • You're right, they might merge if they happen to moderate in both forums.

     

     



    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows Server] Datacenter Management

    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.

    Saturday, January 27, 2018 9:49 PM
    Moderator
  • I did more research preparing to post a question and I found the answer. So I don't need anything more. The answer is that we need a STAThread; console applications are MTAThreads by default.


    Sam Hobbs
    SimpleSamples.Info

    Sunday, January 28, 2018 2:29 AM
  • The ultimate outcome.

     

     



    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows Server] Datacenter Management

    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.

    Sunday, January 28, 2018 2:41 AM
    Moderator
  • The thread Instantiate Shell32.Shell object in Windows 8 has a response that should be marked as an answer, if someone can do that then I think that would help.


    Sam Hobbs
    SimpleSamples.Info

    Sunday, January 28, 2018 5:30 AM
  • Sometimes flagging it with a comment gets the attention of moderator's. I couldn't do it as I'm not a mod over there.

     

     



    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows Server] Datacenter Management

    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.

    Sunday, January 28, 2018 1:42 PM
    Moderator