|
-
Nov 24th, 2005, 09:45 PM
#1
Thread Starter
Fanatic Member
[RESOLVED] reference comdlg32.ocx
hi i was messing around bc on the computers at my school when we try to open components (common dialogs and such) vb at once closes but if you reference COMDL32.oxc this allows you to dim a varable as a common dialog control but how would i go about using it when i dim it as such?
Last edited by dark_shadow; Nov 25th, 2005 at 12:28 PM.
-
Nov 24th, 2005, 09:46 PM
#2
Re: reference COMDL32.oxc
-
Nov 24th, 2005, 09:50 PM
#3
Re: reference COMDL32.oxc
Do you have ComDlg32.ocx on your system? Are you using VB6? Do you have SP6 installed? Don't try to use Office controls, as you cannot distribute them. You app won't work if the user doesn't have Office (with the same version as you do) installed.
-
Nov 24th, 2005, 09:54 PM
#4
Thread Starter
Fanatic Member
Re: reference COMDL32.oxc
 Originally Posted by dglienna
Do you have ComDlg32.ocx on your system? Are you using VB6? Do you have SP6 installed? Don't try to use Office controls, as you cannot distribute them. You app won't work if the user doesn't have Office (with the same version as you do) installed.
yes,yes, i'm pretty sure and i didnt use office controls i dont think anyway
-
Nov 24th, 2005, 09:56 PM
#5
Re: reference COMDL32.oxc
Do you have SP6? Can you install? You might need admin privileges to install it
-
Nov 24th, 2005, 10:00 PM
#6
Re: reference COMDL32.oxc
All I can say is zip and post your project...
-
Nov 25th, 2005, 12:28 PM
#7
Thread Starter
Fanatic Member
Re: reference comdlg32.ocx
ok providing you have the comdlg32.ocx in you system32 (which the the place i am at does) you can add it as a reference (project->references->browse ->activex controls ->comdlg32.ocx you can put the following code
but i'm not sure how to actually ues it correctly
-
Nov 25th, 2005, 12:51 PM
#8
Re: reference comdlg32.ocx
dark_shadow,
Once you include the reference in your project, you drop it on your form and it will appear as CommonDialog1. At that point you don't have to Dim it. You just use it as such:
VB Code:
On Error GoTo errHandler
CommonDialog1.Flags = cdlOFNHideReadOnly + cdlOFNPathMustExist + cdlOFNFileMustExist + cdlOFNLongNames + cdlOFNExplorer
CommonDialog1.CancelError = True
CommonDialog1.InitDir = DirName ' A default folder
CommonDialog1.Filename = Filename ' A default filename
CommonDialog1.Filter = "Template Script |*.tpl"
CommonDialog1.ShowOpen
cboTplFile.Text = CommonDialog1.Filename
cboTplFile.Tag = 1
SaveIni = True
Exit Sub
errHandler:
Select Case Err
Case 32755 ' Dialog Cancelled
DoEvents
Case Else
MsgBox "Unexpected error. Err " & Err & " : " & Error
End Select
-
Nov 25th, 2005, 02:35 PM
#9
Thread Starter
Fanatic Member
Re: reference comdlg32.ocx
when i reference it the control does not show up on the components bar so i cant "drop" it on the form
-
Nov 25th, 2005, 02:37 PM
#10
Re: reference comdlg32.ocx
-
Nov 25th, 2005, 02:38 PM
#11
Re: reference comdlg32.ocx
Did you reference it as a component.
-
Nov 25th, 2005, 02:42 PM
#12
Thread Starter
Fanatic Member
Re: reference comdlg32.ocx
i went to project->references-> browse-> then in the type of file drop down field i went to activeXcontrols and clicked comdlg32.ocx then hit ok
-
Nov 25th, 2005, 02:45 PM
#13
Thread Starter
Fanatic Member
Re: reference comdlg32.ocx
 Originally Posted by dglienna
yes the control shows up fine i know how to drop it in when you go to componets but you can also dim as CommonDialog when you reference the comdlg32.ocx and i would like to know how to use when its dimed
-
Nov 25th, 2005, 03:00 PM
#14
Re: reference comdlg32.ocx
Dim Somevar as CommonDialog1
Set Somevar = New CommonDialog1
-
Nov 25th, 2005, 04:21 PM
#15
Thread Starter
Fanatic Member
Re: reference comdlg32.ocx
alright thanks alot worked great
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|