Visual Studio 2005 Visual Basic - getting started

  • Hi,

    Looks like a great control but I am having trouble getting going.

    Downloaded the demo. Used the Tool/Choose Toolbox Item and browsed to C:\Program Files\TextDynamic\Redis\WPTDynInt2.dll to add WPBLLInt to the Toolbox - shows up fine. Then Project\Add Reference and did the same.

    Next dragged a control onto a form and so far so good. It runs and displays a text entry area with rulers and vertical scroll bar.
    Then added code below as per example. Commented out first line as not sure if this needed. Had to add Imports WPDynamic at top of class to get rid of errors after Me.

    Code
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load        'Me.WpdllInt1.EditorStart(your_name, your_key)        Me.WpdllInt1.SetLayout("buttons.pcc", "")        Me.WpdllInt1.SetEditorMode(EditorMode.wpmodSingleEditor, (EditorXMode.wpmodexPDFExport Or (EditorXMode.wpmodexTables Or (EditorXMode.wpmodexSpellcheck Or EditorXMode.wpmodexToolbar))), (EditorGUI.wpguiPanelH1 Or (EditorGUI.wpguiHorzScrollBar Or (EditorGUI.wpguiVertScrollBar Or EditorGUI.wpguiRuler))), EditorGUI.wpguiDontSet)    End Sub

    This runs and shows top and bottom toolbars but no status bar or menu. Code below gave error as couldn't reference status bar.

    Code
    Private Sub wpdllInt1_OnUpdateGUI(ByVal Sender As Object, ByVal Editor As Integer, ByVal StateFlags As Integer, ByVal PageNr As Integer, ByVal PageCount As Integer, ByVal LineNr As Integer)
            Me.stPage.Text = (Convert.ToString(PageNr) & "/"c & Convert.ToString(PageCount))
            Me.stLine.Text = ("Line " & Convert.ToString(LineNr))
            Me.stIns.Text = IIf(((StateFlags And 2) <> 0), "INS", "")
        End Sub

    Bit stuck now. Not sure where to put WPDLLInt.SetDLLName("C:\Program Files\TextDynamic\Redis") or equivalent in a Visual Basic 2005 program.

    Any help appreciated.

    Regards,

    GRS

    PS Couldn't see a Dock property for the control either.

    [Blockierte Grafik: http://www.accessgp.com/html/vbnmscreens_39.html]
    [Blockierte Grafik: http://www.accessgp.com/html/vbnmscreens_40.html]

    Einmal editiert, zuletzt von GRS (17. August 2006 um 09:05)

  • Figured it out. You have to add your own status bar.

    Dock can be set programmatically. But if I do this and resize the form my Toolbar icons disappear off to the left . Thanks for any help on this.

    Regards,

    GS

    • Offizieller Beitrag

    Hi,

    I think you need to make the control ato resizing on the form using the Anchor properties. (I have those in C#)

    The call to SetDLLName must be executed at the earliest point in your application, that is not necessarily this form. Form.OnLoad is probably too late, it must be before the creation of the controls from the resource file. Sorry, I don't know where this is VB would be, in C# it is in Main()

    Code
    static void Main() 
                    {
                            //TODO!!! Update to use YOUR path
                            WPDLLInt.SetDLLName("{hkcu}Software\\MyCompany\\TextDynamic\\path");
                            Application.Run(new WinForm());
                    }

    In this example the path ould be loaded from the registry, your installer has to create this entry. Of course you can specify an absolute path, too. Note that the buttons.pcc file (or how you name it) should be in the same path as the DLL when loaded without specifying a path.

    Yes, the statusbar is not part of the control - the manual describes how to get the usual information bits.

    Kind Regards,

    Julian Ziersch

  • Hi,

    I haven't made a call to SetDLLName at all and it works fine in Visual Basic. Just added a reference to the .dll from the Project/Add Reference menu.

    Dock doesn't show up in the Properties box in the designer but it can be set programatically and as long as the text control is place in a panel and not on the form itself the icons display nicely. Anchor works for me no matter what.

    I am still experimenting but would it be possible to programatically add text to a Dynamic text control which has its Visible property set to False then Printing or Print Previewing under program control and never displaying the text on the actual control. This would solve a lot of my problems with printing in Visual Basic .Net.

    Regards,

    Geoff

  • Hi again,

    I see now that the demo version doesn't need the call to SetDLLName to work on the machine the demo is installed on. I tried a simple deployment on another machine without the demo installed and of course it didn't work. However when I did make the call with the following

    Code
    WPDLLInt.SetDLLName("C:\Documents and Settings\Geoffrey Stokeld\My Documents\Visual Studio 2005\Projects\WindowsApplication5\WindowsApplication5\bin\Release\WPTDynInt2.dll")

    it still doesn't work. Just wondering if the demo allows a trial deployment like this or am I on the wrong track.

    I am also a little worried that if I was to purchase this control it seems a little uncertain where to put the call to SetDLLName in a Visual Basic application.

    Regards,

    Geoff

    • Offizieller Beitrag

    Hi,

    1. The best place for SetDLLName under VS.NET is the method Run:

    WPDynamic.WPDLLInt.SetDLLName("...") will work if you use a dynamic control (see below).

    2. Yes, you can use an invisible control to process text.

    This example opens an RTF file, asks for a PDF file name and converts the RTF to PDF. Of course it would be possible to create the text at runtime as well.

    If you get a MDA LoaderLock exception in the debugger (that will not show up outside) please open the Menu "Debug", select the item "Exceptions" and in the dialog disable the check at the entry "Loader Lock" listed under "Managed Debugging Assistants".

    Regards,

    Julian Ziersch

  • Hi again,

    Thanks for all your help. Tried your code and it works fantastically with no errors. I just copied an entire visual basic project to a machine with only .Net 2 framework installed and it runs fast and well.

    Thanks again.

    Geoff

  • Hi,

    I plan to have more of a play with it and compared to other text controls it is great value for features. It would be very easy to make a stand alone fully featured word processor with it.

    The only thing lacking that I can see is code examples. Could you point me in the direction of any that are available in Visual Basic or I am sure I could adapt C# examples. The manual has some I know but the documentation is a little daunting for newbies like me.

    One I get the menus connected in a Visual Basic project I would be glad to make it available to the community if any interest.

    Regards,

    Geoff