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
Solved! Go to Solution.
Solved by wbdehaan. Go to Solution.