Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / Extensibility / December 2004

Tip: Looking for answers? Try searching our database.

"Parameter is incorrect" error

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Himo - 06 Dec 2004 10:29 GMT
I get this error in the EditorFactory.CreateEditorInstance() method and this
line is the cause:

ppunkDocView = Marshal.GetIUnknownForObject(newEditor);

At first it first great, what's wrong now that it doesn't work anymore.
I'm using Visual C# (Version 2003)

Thanks!
Signature

protected abstract void Me();

Ed Dore [MSFT] - 08 Dec 2004 03:38 GMT
Hi Himo,

What is newEditor defined as? I presume it's a class that derives from
IVsWindowPane and IOleCommandTarget at a minumum.

Sincerely,
Ed Dore [MSFT]

This post is 'AS IS' with no warranties, and confers no rights.
Himo - 08 Dec 2004 07:49 GMT
This class is generated by the VSIP package wizard and newEditor is a
standard code editor as made by the template, deriving from these classes:

public class EditorPane : System.Windows.Forms.UserControl,
        IVsPersistDocData,
        IPersistFileFormat,
        IOleCommandTarget,
        IVsWindowPane,
        IVsFindTarget,
        IVsDocDataFileChangeControl,
        IVsFileChangeEvents

So the editor is called like this:
EditorPane newEditor = new EditorPane(myPackage); where myPackage is a VSIP
package.

The error I get is in public class EditorFactory, which inherits from
IVsEditorFactory.
And the strange thing is that my package does work in debug mode. I already
signed this package with a PLK and run it with the /noVSIP parameter.

> Hi Himo,
>
[quoted text clipped - 5 lines]
>
> This post is 'AS IS' with no warranties, and confers no rights.
Himo - 08 Dec 2004 16:11 GMT
I also noticed when handling all the errors by the IDE, that it also errors
along these lines with a COMException:

//
            // EditorPane
            //
                this.Controls.Add(this.tabControl1);
                this.Name = "EditorPane";
                this.Size = new System.Drawing.Size(632, 600);
                this.Load += new System.EventHandler(this.EditorPane_Load)
                ((System.ComponentModel.ISupportInitialize)(this.WebBrowser)).EndInit();<---- Probably this is the cause, a strongnamed AxShDocVw
                this.tabControl1.ResumeLayout(false); <--- Errors here
                this.DesignPage.ResumeLayout(false);
                this.DesignMenuItems.ResumeLayout(false);
                this.ProgressDialog.ResumeLayout(false);
                this.PreviewPage.ResumeLayout(false);
                this.XMLCodePage.ResumeLayout(false);
                this.ResumeLayout(false);

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.