• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • Discussion Groups

    .NET

    Reply
    Active Contributor
    Posts: 41
    Registered: ‎11-01-2001
    Accepted Solution

    Open drawing - commandflag.session - there is no sourcecode for this location

    89 Views, 1 Replies
    03-19-2013 12:40 AM

    Hi,

     

    When opening a drawing I have errors:

    1. the drawing is opened, but it freezes during open-command, and is not activated, OR

    2. the drawing is opened, but I cannot start the program a second time, then it gives an error.

     

    explanation:

     

    I have a project with an attached large 'common' project, which I attached with "menu file > add > exisiting project" in VB2008express:

     

    Solution 'CNC' (2 projects)

    - CommonMacro   (>>added project)

        - cad.vb

    - CNC    (>> main project)

        - main.vb

     

     

    1. When I open a drawing, first it freezed during this open-command, and did not activate this drawing. Only after clicking right mouse button, it continued the program, activated the drawing. But this is no option for me.

    ---

    <CommandMethod("CNCP")>Public Sub StartProgrammaProductie()

     

        cad.init    (>> routine in commonmacro-project)

     

        Dim acDocMgr As DocumentCollection = Application.DocumentManager

        Dim Nieuwbestand as document

        NieuwBestand = acDocMgr.Open(Pad_en_Bestand, BestandsInfo.IsReadOnly)   (>>>FREEZE)

        acDocMgr.MdiActiveDocument = NieuwBestand

    end sub

    ---

     

     

    2. I added commandflag.session to the subroutine, the first time I use "CNCP" the drawing is opened fine, but now when the second time I start my program and a drawing is opened, it loses contact with the common project

    ---

    <CommandMethod("CNCP", CommandFlags.Session)>Public Sub StartProgrammaProductie()

     

        cad.init     (>> ERROR: there is no sourcecode for this location)

     

        Dim acDocMgr As DocumentCollection = Application.DocumentManager

        Dim Nieuwbestand as document

        NieuwBestand = acDocMgr.Open(Pad_en_Bestand, BestandsInfo.IsReadOnly)

    acDocMgr.MdiActiveDocument = NieuwBestand

    end sub

    ---

     

    How can I open and activate drawing's and still have connection to the common project dll? 

    or how do I end a routine properly?

     

    kind regards

     

    Wouter de Haan

     

     

    Please use plain text.
    Active Contributor
    Posts: 41
    Registered: ‎11-01-2001

    Re: Open drawing - commandflag.session - there is no sourcecode for this locatio

    03-19-2013 07:49 AM in reply to: wbdehaan

    Hi there,

     

    solved my problem by turning the GUI.Showdialog to GUI.show

     

    Wouter

    Please use plain text.