Welcome to Windows Workflow Foundation (WF)
Top Tasks :

WF Team Bloggers

Browse by Tags

All Tags » C/C++   (RSS)

  • Visual Studio Tip : AutoFormat Your Code

    Has this ever happened to you? You find some code on the Net so you copy and paste it into a source file within Visual Studio and notice that all the formatting is somehow messed up. For example. some lines might be indented while others are not.

    To have Visual Studio fix it all up nice and tidy for you, select the text, hold CTRL and hit K followed by F (CTRL+K-F). What I usually do is do a CTRL-A to select all text then do the CTRL+K-F combo. Voila!

  • .NET Sidebar Gadget Creator 2.0 Release

    Ok, I finally worked out most of the bugs (I hope). I'll post the link and follow up with some tutorials and Sidebar Gadget development using .NET.

    Here's the file...using the new SkyDrive Beta to host the file!!!

  • .NET Sidebar Gadget Creator Update #2

    I had quite the breakthrough today. First off, I totally rewrote major portions of the .NET Sidebar Gadget Creator. It is now a wizard (photos below) that leads you through the steps to create a Vista Sidebar that uses .NET. Here are some of the changes (then I'll explain my breakthrough):

    • You can now create any .NET type. You have the "option" of embedding a UserControl as the UI but it isn't required. Have a cool class you want to use. This makes it easy.
    • A .gadget file is automatically created for you. More often than not, you will need to fiddle around with the final result, but just in case, I went ahead and added this feature anyway
    • Reworked the entire act of copying to temp directory and registering assemblies...this is the breakthrough

    As one reader pointed out, they noticed that I was simply copying the .NET assembly to the temp folder, creating the COM Interop registry keys to point to that location and having sidebar/Trident load it up from there. Was that the ideal solution? No way. He was right. It was the wrong way to do it. The benefit was that it allowed you to uninstall your gadget from the Sidebar UI, but left the file in the temp directory and orphaned registry keys.

    Here's the breakthrough. What if I told you that your .NET assemblies are not copyed over. They remain in your gadget directory. What if I also told you, you don't have to worry about registration. Yeah, so. You didn't with previous versions either right since my tool did it for you. Well, what if I told you that my tool also doesn't have to worry about registering your assemblies for COM interop? You heard right. Nothing about your assembly ever gets registered into the registry (i.e. I don't register your assembly for COM interop). However, you will still be loaded just fine and if you are a UserControl based object, you will be embedded. Additionally, you can still be safely uninstalled and all the gadget files will be deleted just fine.

    If you have a clue as to how I do this...feel free to submit your best guesses. I'm going to put the finishing touches on the tool and send it out. After that, I'll have a series of tutorials and an examination of the code (as well as my solution to how I solved this problem).

  • Hosting .NET Runtime in C++ Tip o' the day or "Where is IAppDomainSetup?"

    Are you hosting the .NET runtime and trying to create another AppDomain? Notice that you need to call CreateDomainSetup and cast the IUnknown to IAppDomainSetup to set properties? Notice also that IAppDomainSetup isn't defined in mscoree.h? Add the following (stdafx.h or anywhere else):

    #import <mscorlib.tlb> raw_interfaces_only no_smart_pointers high_property_prefixes("_get","_put","_putref")

    then you can say:

    CComPtr<mscorlib::IAppDomainSetup> pAppDomainSetup;

    Ta da!

  • ActiveX based Sidebar gadget problem solved!

    Ok, I just ran a test with some new code that creates an ActiveX based sidebar gadget and I was able to get the dll unloaded from the sidebar process so it can uninstall successfully! This is good news for all the people that can't seem to get around this issue (and there's a few of you). I'll get going on a solution and post the results here. If you want to be emailed when its ready, just ping me and I'll add you to a list.

    Want a hint as to how I solved it? Take a look at this post's tags :-)

Copyright © 2006 Microsoft Corporation. All Rights Reserved. | Terms of Use | Privacy Statement | Contact Us