DWF Viewer (Read Only)
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

how to use the ActiveX in vfp program

6 REPLIES 6
Reply
Message 1 of 7
vfp00
301 Views, 6 Replies

how to use the ActiveX in vfp program

I want to know
1.how to control the only user who has proper print right can print dwf file by pressing print icon key in the toolbar or right click or pressing ^p.
2.how to forbid the user who hasn't print right printing the file?
3.How can i know user press 'ok' or 'undo' when printdialog shows?
4.Is there best ways to count times that user print the dwg file?
thanks you advance !!!
6 REPLIES 6
Message 2 of 7
Anonymous
in reply to: vfp00

Best way is to write your own GUI around the Viewer control. Then you can disable and interact with events to handle your restrictions. I've done a lot of "shop floor viewers" that handle cases similar to yours. You would also need a backend datasource like Access or XML files to track printing if you want to restrict the times a person can print a particular file. -- Mike ___________________________ Mike Tuersley CADalyst's CAD Clinic Rand IMAGINiT Technologies ___________________________ the trick is to realize that there is no spoon...
Message 3 of 7
vfp00
in reply to: vfp00

Mike ,thank for your reply.
I have made my own GUI (vfp+sql2k),but i found the ActiveX offer all rights (copy,print and so on) to users who has right to open the form in which includes the ActiveX .Of course the user who has not right can't print files.
I want to let all users are divided into 3 types:
a.can't access form
b.can access form ,but only view
c.can access form and print also
now,my progress as follow:
a----is no problem
b---- i don't know how to forbid the user printing #######
c---- because ActiveX offer all rights in default,so it's no problem
Mr.Mike, you have similar experiences, would you mind teaching me how to control it?
thank advance!
Message 4 of 7
vfp00
in reply to: vfp00

Hi,Mr.Mike
Do you know how to use these methods?
1. ole1.showprintdialog
2. ole1.onkeydownI
I have a little puzzle:
when i write some codes in ole1.onkeydown as follow:
**********ole1.onkeydown.method code*********
ON KEY LABEL CTRL+O MESSAGEBOX('EXPRESS OPEN') && line1
on key label CTRL+P MESSAGEBOX( 'EXPRESS PRINT ') && line2
ON KEY LABEL CTRL+N MESSAGEBOX('CREATE NEW' ) && line3
**********ole1.onkeydown.method code*********
line1 and line3 runs ok ,system runing order can be headed off . But when running line2 ,system shows printdialog at first and show my messagebox latter, i don't want system pops printdialog ,do you know how to do? tell me,thanks a lot!!
Message was edited by: vfp00
Message 5 of 7
vfp00
in reply to: vfp00

Mr.Mike :
check attachment pls 2 jpeg files.
Message 6 of 7
vfp00
in reply to: vfp00

I have tried it ,but it's a pity that no 'IADPageViewer2' and 'DocumentHandle' and 'ToolbarVisible' and 'UserInterfaceEnabled' are found in vfp .
where can I find them ?
who can help me???
thanks advance

Message was edited by: vfp00
Message was edited by: vfp00
Message 7 of 7
Anonymous
in reply to: vfp00

Well I've never used vfp so you may need to seek help elsewhere, but if its the same as other MS apps this will work. First off, you can't use OLE to disable stuff. In the source code of you form, use the form_load or Form_initialize event to do your disabling as such: Friend dwfViewer As IAdViewer Private Sub frmProgress_Load(ByVal sender As Object, _ ByVal e As System.EventArgs) Handles MyBase.Load 'capture the ExpressViewer control dwfViewer = AxCExpressViewerControl1.DocumentHandler With dwfViewer 'Turn off toolbar .ToolbarVisible = False 'Turn off right-click menu .UserInterfaceEnabled = False End With End Sub This is in VB.NET but you should be able to follow it. Now for your other questions: >>2.how to forbid the user who hasn't print right printing the file? >>3.How can i know user press 'ok' or 'undo' when printdialog shows? YOU make your own print dialog box >>4.Is there best ways to count times that user print the dwg file? Again, use some sort of backend data storage to track it. It could be an xml file that shadows the dwg file and has in it the record of everyone who has printed the drawing. -- Mike ___________________________ Mike Tuersley CADalyst's CAD Clinic Rand IMAGINiT Technologies ___________________________ the trick is to realize that there is no spoon...

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report