Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How register .DDLs from a VB application

Status
Not open for further replies.

hortensiam

IS-IT--Management
Feb 5, 2002
86
0
0
AR
Hi!,
I want to register some .dll s with a Vb application. This have to run in differents platforms (w98, xp, w2000, w2000 server,...)
does anybody help me ???
thanks,
 
Type "regsvr32" in the command prompt to see the syntax.

Then you can use the Shell method to register the dll.
 
Yes, but I need to know wich is the path of the system directory.?
 
I'm not exactly sure so you'll have to test this, but I think regsrv32 assumes the system directory. So if you use just the dll name when it's in the system directory, then you'll have no problems.
-Max
 
Also, check out Environ:

Code:
   Dim i As Integer
   For i = 1 To 100
      Debug.Print Environ(i)
   Next i

You can also use it as Environ("windir")

-Max
 
You dont actually need the path from /system32. The Shell method works with a full path like Shell "c:\myfolder\myfile.exe" or Shell "c:\program files\Microsoft...\Word.exe c:\desktop\myDoc.doc"
or
just writing the filename only. First it checks if the file.exe is in the app's startup path, and then if it exists in system32. If not any of these -> Exception.

If you goto Start->Run and write "cmd" the prompt will appear, e.g. for explorer "iexplore" etc
 
One more thing: just in case it isn't clear to you, you don't have to manually register dlls if they are included in an install package. The package will handle that for you. The responses are talking about ways to do this manually.

Bob
 
We've covered the self-registration technique a few times before:

thread222-597373
(which provides a link to the original Microsoft article on the subject that zarkon4 later used for his/her FAQ)

and the use of FSO's GetSpecialFolder has been covered a number of times over the last few years (no need to go to another site), eg:

thread222-687676

And we've also looked at using the Windows Shell Controls and Automation library (my preferred variant on the FSO library solution, because it knows about far more of the special folders than FSO does):

thread222-740362

Ah, the wonders of keyword searching ...

 
The Run command (Start->Run) accepts dropping files from Windows Explorer. So, if you select the DLL in the explorer and drag-drop it on to the Run dialog box, the "Open" Text box shows the complete file path.

To do this,
1. Type Regsvr32 in the Run box;
2. Select a dll/ocx/exe in the Explorer;
3. Drag and drop it on the Run box;

Means, you dont have to actually copy-paste/type the file path every time you register a component.

------------------------------------------
The faulty interface lies between the chair and the keyboard.
 
Sorry for the post above. I thought it will be appropriate to post a tip like that, but after posting it, i see it as not related to the original post somehow!

------------------------------------------
The faulty interface lies between the chair and the keyboard.
 
Using the global system variable %systemroot% in the path generally works. So "regsvr32 %systemroot%\system32\blah.ocx" should work on most systems.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top