|
-
Jun 16th, 2003, 12:36 AM
#1
Thread Starter
Junior Member
registering ocx file automatically
Hello,
I am using Common Dialog box in my VB form. For that it use comdlg32.ocx file. If a Computer doesn't have this file, my exe generates an error .To solve the same, I have to copy comdlg32.exe file in the corrosping folder of that system.
I want that as my exe runs, it automatically register the same or any ocx file, so I dont have to copy the ocx file again and again.
Do anybody have any idea about this.
Thanx in advance,
Saurabh
-
Jun 16th, 2003, 01:37 AM
#2
Frenzied Member
oh1mie/Vic

-
Jun 16th, 2003, 03:04 AM
#3
Hyperactive Member
hi,
i don't understand why u r coping the .OCX file in ur project folder.
if u r making the project to be deployed on other computer which does not have (any) .OCX file, use Project and Deployment wizard to make the Setup file. This Setup file will include all the dependency information of ur proj. and install all the required components to the destination computer.
A man with nothing to live for has everything to fight for...
-
Jun 16th, 2003, 06:28 AM
#4
Thread Starter
Junior Member
That's user's requirement. They dont want to run setup files.
They need a small size exe in which they need everything.
Everytime I have to look my user's computer, to check whether the corrosponding ocx exist or not.
Thanx,
Saurabh
-
Jun 16th, 2003, 06:34 AM
#5
Thread Starter
Junior Member
Hi oh1mie,
I have used the code but didn't able to solve the problem.
It gives me this error:
Run time error '53':
File Not Found: cdo32.dll
whether I have to create the same file. I dont have any idea about this. Please, can anyone tell about this?
-
Jun 16th, 2003, 10:18 AM
#6
Frenzied Member
On that example cdo32.dll is registered component. Change that name to your own component, what you want to register.
oh1mie/Vic

-
Jun 16th, 2003, 11:45 PM
#7
Thread Starter
Junior Member
Sorry, but I am unable to solve it. I didn't work on dll's therefore I am unable to detect which file we should use or what changes I should make in the said code.
I am using Common Dialog box in my VB form. The name of this component in my application is cdgfileopen.
I am using this component to browse the local files in the system.
Can you help me?
-
Jun 17th, 2003, 04:15 AM
#8
Frenzied Member
Here is example for you:
VB Code:
Option Explicit
Private Const ERROR_SUCCESS = &H0
Private Declare Function Regcomdlg32 Lib "comdlg32.dll" Alias "DllRegisterServer" () As Long
Private Declare Function UnRegcomdlg32 Lib "comdlg32.dll" Alias "DllUnregisterServer" () As Long
Private Sub cmdUnRegister_Click()
If UnRegcomdlg32 = ERROR_SUCCESS Then
MsgBox "comdlg32.dll UnRegistered"
Else
MsgBox "comdlg32.dll UnRegistered fail"
End If
End Sub
Private Sub cmdRegister_Click()
If Regcomdlg32 = ERROR_SUCCESS Then
MsgBox "comdlg32.dll Registered"
Else
MsgBox "comdlg32.dll Registered fail"
End If
End Sub
oh1mie/Vic

-
Jun 18th, 2003, 10:19 AM
#9
Thread Starter
Junior Member
Hi,
It gives me an error saying:
Run-time error '453':
Can't find DLL entry point DLLRegisterServer in comdlg32.dll
while Debug the error it indicates on the line
---> If Regcomdlg32 = ERROR_SUCCESS Then
Saurabh
-
Jun 18th, 2003, 10:23 AM
#10
umm isn't the common dialog control component "COMDLG32.OCX"
-
Jun 18th, 2003, 12:20 PM
#11
Frenzied Member
Originally posted by kleinma
umm isn't the common dialog control component "COMDLG32.OCX"
Kleinma is right.
Do your VB work right ?
oh1mie/Vic

-
Jun 18th, 2003, 12:37 PM
#12
it is also possible to not use a component at all.. but ALL API code to generate the box (I think that DOES use comdlg32.dll) which doesn't need to be distributed anyway.. it is a windows system file
if you are a beginner... it will be pretty tough.. but I am sure it has already been coded and posted on here before...
if you HAVE to make an setup free application.. i would use as much API and as little ocx/dll files as possible...
of course you know that only newer windows OSes come with the VB runtime files included.. so if you try to run your app on an older version (not sure if 2k or me was the first) it will crash anyway
-
Jun 19th, 2003, 01:26 AM
#13
Hyperactive Member
hi if u already OCX file in the project folder then use
shell command to register the OCX file like:
VB Code:
Shell ("regsvr32 /s " & <filename>)
filename can be comdlg32.OCX
A man with nothing to live for has everything to fight for...
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
|