[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 :confused: 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?
Re: reference COMDL32.oxc
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.
Re: reference COMDL32.oxc
Quote:
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
Re: reference COMDL32.oxc
Do you have SP6? Can you install? You might need admin privileges to install it
Re: reference COMDL32.oxc
All I can say is zip and post your project...
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
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
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
Re: reference comdlg32.ocx
Re: reference comdlg32.ocx
Did you reference it as a component.
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
Re: reference comdlg32.ocx
Quote:
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
Re: reference comdlg32.ocx
Dim Somevar as CommonDialog1
Set Somevar = New CommonDialog1
Re: reference comdlg32.ocx
alright thanks alot worked great