Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

open_Document(this string file) is not working in VS 2015 #1

Open
DinisCruz opened this issue Aug 14, 2015 · 0 comments
Open

open_Document(this string file) is not working in VS 2015 #1

DinisCruz opened this issue Aug 14, 2015 · 0 comments
Labels

Comments

@DinisCruz
Copy link
Contributor

here is the code that is not working

        public static IVsWindowFrame        open_Document(this string file)
        {
            try
            {
                if (file.fileExists().isFalse())
                    "[open_Document] provided file doesn't exist: {0}".info(file);
                else
                {
                    var package = VisualStudio_2010.Package;
                    var openDoc = package.getService<IVsUIShellOpenDocument>();
                    IVsWindowFrame frame;
                    Microsoft.VisualStudio.OLE.Interop.IServiceProvider serviceProvider;
                    IVsUIHierarchy hierarchy;
                    uint itemId;
                    Guid logicalView = VSConstants.LOGVIEWID_Code;
                    openDoc.OpenDocumentViaProject(file, ref logicalView, out serviceProvider, out hierarchy, out itemId, out frame);
                    if (frame.notNull())
                    {
                        frame.Show();
                        return frame;
                    }
                    "[open_Document] could not get IVsWindowFrame for file: {0}".info(file);
                }
            }
            catch (Exception ex)
            {
                ex.log("[in file.open_Document]");
            }
            return null;
        }

image

@DinisCruz DinisCruz added the bug label Aug 14, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant