I have found the following source code
I have registered the registries (by double clicking them), but I cant find the DLL that it wants me to register.
Heres the ZIP file.
Can anyone please help me out.
Printable View
I have found the following source code
I have registered the registries (by double clicking them), but I cant find the DLL that it wants me to register.
Heres the ZIP file.
Can anyone please help me out.
Without unzipping the file (but reading the vbp file from inside of WinZip) I can tell you that there are no DLL's. However it contains two different type libraries (*.tlb) that you'll need to register. Extract them to your System32 folder and in the Start > Run dialog box type:
RegSvr32.exe IctxMenu.tlb
and
RegSvr32.exe IDataObj.tlb
After that you can open the project and compile it to an ActiveX DLL file (VB will automatically register that for you when you compile it). Now if you have added the registry entries by running the *.REG file you should be all set.
So you missing the DLL? I bet if you put the DLL name into google you will find a download of it
Thankyou.Quote:
Originally Posted by Joacim Andersson
I Love these forums.
also, just a quick question. Do I need to compile it to run it?
ALSO..
sorry i am a ameteur but my friend really needs this, (and I owe him basically haha),
but I have a procedure that uploads the file.
How would I change the "links" or the "procedures" that come up when you right click?
I guess you are geting the warning 'cause 'binary compatibility' is set in the project properties. Recompile the dll and it should work.
BTW, for more info on context menu see these pages:
Context Menu Handlers and Edanmo's Shell Extensions example
Edit: Oops ! I'm late again. :p
No, when i copied them to my system 32, and i ran the commands,
i get the following error:
" *.tlb is not an executable file and no registration helper is registred for this file type."
and iPrank, your never to late to help anyone. I apprecaite your help and everyone else who helped me.
VB6 should register them autometically as they are in the same folder. No problem here. :confused:
I thought you were talking 'bout the 'incompatibility' warning.
Are you using older VB ?
I am using VB 6.
when i open the project I file. .
i get the
"unable to set the version compatible component: " and it gives me the file path to the dll file. (the file path is right, but the folder has no dll)
when I am typing the command in, do I need to put in the whole file path?
Did you compiled the dll and replaced the old CLSID with the new one in the reg files ?
Ok,
This is what i did.
I clicked the reg files, and entred them in.
then I did copied the tlb files to system 32
and ran
RegSvr32.exe IctxMenu.tlb
and
RegSvr32.exe IDataObj.tlb
but I got the error where it says
I tried opening the project and I get an error :Quote:
" *.tlb is not an executable file and no registration helper is registred for this file type."
Quote:
Re: right click on windows. [hard]
--------------------------------------------------------------------------------
I am using VB 6.
when i open the project I file. .
i get the
"unable to set the version compatible component: " and it gives me the file path to the dll file. (the file path is right, but the folder has no dll)
Ignore that error! Compile the DLL and edit the REG file so it has the correct CLSID.
Sorry.
But how can I compile it when VB dosnt open it?
or does it open it? but since theres no form, it wont show a form?
also whats CLSID?
Any tutorial on that? (I will also do a search on that0
Ok, so i opened it in VB, and then I went to "file" and I saw,
"make contextmenu.dll"
and i made it into system 32 folder.
so now what about CLDIS?
This is what I found in the "module" comments:
now how do i do a registry search?Quote:
' to get the GUID compile the dll and then do a registry search for ContextMenu.cMenu.
'The registry entry you find will have the clsid, this is the number you want.
' Place this number in the registry file ContextMenu.reg located with this project.
'To test after you compile and after you reg it and after you place correct registry entires
'then right click on a file. To test you changes, you will have to close all instances of the explorer
'before you can recompile, if you have VERSION COMPATIBILITY set to Binary COMPATIBILITY then you can just
'open explorer again and right click the file.
guyz.. you dont even know how much I apprecaite this.
Also, this is the reg file:
Quote:
REGEDIT4
; ------ FOR YOUR OWN DLL'S -------------------------------------------------------------
; Replace {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} with a valid Classid entry for your dll.
; Also replace the * with the correct place you want it in, and the name of the
; context handler. Usually this stuff is done in a setup program, or by the exe itself.
; ---------------------------------------------------------------------------------------
[HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers\VBContext]
@="{4A657346-4C64-439B-8A09-E13CE0F7114F}"
; This line makes it so that your DLL is registered for Windows NT.
; Again, change around to your details
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Approved]
"{4A657346-4C64-439B-8A09-E13CE0F7114F}"="VB Context Menu"
Start RegEdit, click Edit > Find and search for ContextMenu.cMenu and you'll see a number looking simular to this: {83E6B0B6-6AE5-449B-8287-8F26E0254F7D} (but with another number). You'll have to replace the number in the REG file with the one you'll find.
Should I leave the
"[HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers\VBContext]"
alone?
Yes I found my new key, but should I leave the path or w/e alone?
also how would I go about compiling it?
Its not in "File" menu anymore.
If you haven't changed the project's name, then there is no need to change anything else.
Just replace the CLSID and run the reg file.
Edit: Also replace the * with the original reg key.
Thankyou iPrank, but how should i go about compiling it?
I thought you already had compiled it... Otherwise it would be impossible for you to see the CLSID in the registry since it is created when you compile the DLL.
ok my steps:
I copied the two tlb files to system 32.
then i ran the two codes from my run dialog. that gave me error
then i opened VB 6 and it gave me error. I ignored it.
I went to "file" menu and saw a "make context menu.dll".
I clicked that and put it in system 32.
I went to regedit.
I found the new code.
I opened up the two registry files in notepad. Editied the old key with new one.
I double clicked them so it enters it.
so.. now what? I press F5 to run it, but it dosnt show my menu.
The step where you clicked File and "Make context menu.dll" is where you compiled it... That what it means, you'll compiling the code into a DLL (or EXE, or OCX depening on what type of project there is).
It is a Shell Context Menu.
Right click on some files in explorer and see if anything new in in the context menu.
Nope. I checked that, thats why I thought I was doing something wrong.
When you right click on a file in Windows Explorer a new menu item named My NIFTY little Extension Chad should appear (if this code works as it should and you've made the correct changes in the REG file before double clicking it).
Read the sample chapter I linked in Post#5. At the bottom of that page read 'Registration and Operation' topic. Make sure you aren't doing anything wrong when registering.
Well it dosnt. so I am going to repeat the steps over.
Also, are my steps right though? is that the order?
and will it come automattically or do I need to run the code using F5 or Control F5.
Do NOT compile the project again unless you have set the Project Compatibility option. Otherwise you'll change the GUID (aka. CLSID) in the registry, and you don't want to do that. You don't have to run the project from VB. The system will (or should) call the code in your compiled DLL when you right click on any file that you have registered to be used with this context menu handler.
Ok.
THANKYOU.
I made the DLL again, got a new key, and changed them in reg. then I entered the reg again.
and now IT WORKS.
I REALLY APPRECIATE IT>!!!!!!
so now i have to work on what will happen when I click the proc.
do I have to change that in VB? or what?
Yeah... that context menu doesn't do much but shows a MsgBox from the look of it :). If you want to do something else you'll need to change the code in the IGotClicked1 Sub at the bottom of the cMenu class. However changing the code means that you'll need to recompile it, so before you do that follow these steps.
1. Copy the DLL that you created in your System32 folder to the folder where you'll have the source code (or to a subfolder).
2. Inside VB click Project > ProjectName Properties and select the Component tab. Check the Binary Compatibility option at the bottom and Browse to the copy of your DLL file.
3. The textbox should now show the path to the copy of your DLL, click OK to close the dialog box.
4. Do the changes you want to do in the project. Save the Project and Compile it again (File > Make DLL) and replace the origional DLL file in the System32 folder.
If you follow these steps you should not need to change anything in the Registry everything should work.
Thankyou.
If I am making a program for others to download and install, I would need to distribute the DLL right? And it will have to add the registry again right?
Yes... You should create a setup package that registers the DLL and that creates the Registry keys you want to use for the context menu... As long as you have the Binary Compatibility option set the GUID will not change even if the DLL is moved to another computer.
In that case, make a install package with a good installer. (like Installshield/InnoSetup).
InstallShild has a option where you can add your reg file. It will take care of registration.
In inno, i think you'l need to write the script manually.
What about the Package distribution that comes with VB?
Also I did the Project -> make bianry, but now where do I save my new DLL?
The system 32 or my folder with source code.
i cant to system 32 because it says "permission denied".
(probably because its being used?)
The P&D wizard is a very basic installer. It can't register your reg files.
I guess you are getting "permission denied", because your previous dll is still loaded in memory.
Wait a few minutes and/or unregister the previus dll with
Regsvr32.exe /u dllname.dll
then try again.
It still says that permission is denied .
but i think its unloadded because the right click meny has disspared.
Ok, well i saved the new DLL with my source code.
and everything still works now.
but i cant find the "menu" names and such. its not in the class file.. How would I go about changing that.
accutally uhh I am soo confused.
I saved the new DLL in my source code, but that didnt make the change i made.
But I cant save to system 32 because permission is denied.
Wow, I have done everything..
its just that when i update the class file or something, I cant make a new DLL.
it says permission denied.
I tried unregistering it like iPrank siad, but still no luck
I've searched google and found some interesting info. I hope they will help you.
Permission Denied error when compiling an ActiveX DLL - I hope it will solve your problem , VB dll/exe version compatibility , Dll permission denied , VB DLL Error 70 - Permission Denied in XP Pro
HAha thanks.
i googled my error too and i found that page, but I cant seem to get the steps.
Quote:
Here are all the steps to reproduce this:
1. Create an ActiveX DLL.
2. Add a standard EXE to the project group to test the DLL.
3. Add a reference in the standard EXE to the DLL.
4. Compile the DLL.
5. Recompile the DLL. You will now get this error.
*** 5a. Remove the DLL from the group. This resets the reference from the ActiveX DLL project to the DLL itself.
6. Test again. Things should be fine.
7. Re-add the DLL to the project group.
8. Recompile the DLL. You will now get this error.
Ok, not worrying about the DLL right now. i have another question. Im just absolutely stumped on this.
Ok, so I noteiced that there is no "form" with this script. But I need a form to upload.
Well i dont really need it, but I have my components dragged on there.
anyone know an FTP script with simple upload (just upload) to a web server?
How can I put in a form, and use it from the class file.
Project > Add Form
However this form is not shown by itself you'll need to load it (or simply call the Show method).
About the issue with the DLL being in use so you can't overwrite it. The main problem with creating shell extensions in VB is that it's so hard to debug it. The system will load your DLL when you have right clicked on a file in Windows Explorer and will keep it in memory until Windows is restarted (or atleast until you log out). What you must do is to restart your system.
Yea, just for testing purposes I log off and on (and i have disabled most startup programs like MSN, so it loads faster).
Ok, Joa, I tried putting a form in , but it didnt work.
Plus my FTP program (which i downloaded) has a usercontrol file in it.
do you know a simpler one (i have been searching for a couple of days now). I tried making my own using Inet, but like it creates folders and stuff, but for some reason does not send a file to the server.
(and it gives me no error).
This code does not work, (and I took it off the word document you made one day as help for this)
VB Code:
Private Declare Function InternetOpen Lib "wininet.dll" _ Alias "InternetOpenA" ( _ ByVal sAgent As String, _ ByVal nAccessType As Long, _ ByVal sProxyName As String, _ ByVal sProxyBypass As String, _ ByVal nFlags As Long) As Long Private Declare Function InternetConnect _ Lib "wininet.dll" Alias "InternetConnectA" ( _ ByVal hInternetSession As Long, _ ByVal sServerName As String, _ ByVal nServerPort As Integer, _ ByVal sUserName As String, _ ByVal sPassword As String, _ ByVal nService As Long, _ ByVal dwFlags As Long, _ ByVal dwContext As Long) As Long Private Declare Function FtpPutFile _ Lib "wininet.dll" Alias "FtpPutFileA" ( _ ByVal hFtpSession As Long, _ ByVal lpszLocalFile As String, _ ByVal lpszRemoteFile As String, _ ByVal dwFlags As Long, _ ByVal dwContext As Long) As Boolean Private Sub Form_Load() hINetSession = InternetOpen("MyFTPClient", 0, vbNullString, _ vbNullString, 0) If hINetSession = 0 Then MsgBox "Could Not Connect", vbOKOnly, "Error" Exit Sub End If hSession = InternetConnect(hINetSession, "72.36.250.114", _ "21", "fenix", "kittycat", INTERNET_SERVICE_FTP, 0, 0) If FtpPutFile(hSession, "c:\SSInst.txt", _ "www\shared.txt", 1, 0) = False Then MsgBox "The call to FtpPutFile failed." End If Unload Me End Sub
Put the following code in a BAS module:Now you would first call the Connect function followed by UploadFile and finally the CloseConnection.VB Code:
Private Declare Function InternetOpen _ Lib "wininet.dll" Alias "InternetOpenA" ( _ ByVal sAgent As String, _ ByVal nAccessType As Long, _ ByVal sProxyName As String, _ ByVal sProxyBypass As String, _ ByVal nFlags As Long _ ) As Long Private Declare Function InternetConnect _ Lib "wininet.dll" Alias "InternetConnectA" ( _ ByVal hInternetSession As Long, _ ByVal sServerName As String, _ ByVal nServerPort As Integer, _ ByVal sUserName As String, _ ByVal sPassWord As String, _ ByVal nService As Long, _ ByVal nFlags As Long, _ ByVal nContext As Long _ ) As Long Private Declare Function FtpPutFile _ Lib "wininet.dll" Alias "FtpPutFileA" ( _ ByVal hFtpSession As Long, _ ByVal lpszLocalFile As String, _ ByVal lpszRemoteFile As String, _ ByVal dwFlags As Long, _ ByVal dwContext As Long _ ) As Boolean Private Declare Function InternetCloseHandle Lib "wininet.dll" ( _ ByVal hInet As Long _ ) As Integer Public Enum eTransferType FTP_TRANSFER_TYPE_ASCII = &H1 FTP_TRANSFER_TYPE_BINARY = &H2 End Enum Private Const INTERNET_FLAG_EXISTING_CONNECT As Long = &H20000000 Private Const INTERNET_FLAG_PASSIVE As Long = &H8000000 Private Const INTERNET_SERVICE_FTP = 1 Private Const INTERNET_OPEN_TYPE_PRECONFIG As Long = 0 Private hSession As Long Private hINetSession As Long Public Function Connect( _ ByVal sRemoteHost As String, _ ByVal sUserName As String, _ ByVal sPwd As String, _ Optional ByVal nPort As Long = 21) As Boolean If (hSession + hINetSession) <> 0 Then CloseConnection End If hINetSession = InternetOpen("MyApplication", _ INTERNET_OPEN_TYPE_PRECONFIG, _ vbNullString, vbNullString, 0) If hINetSession Then hSession = InternetConnect(hINetSession, sRemoteHost, _ nPort, sUserName, sPwd, INTERNET_SERVICE_FTP, _ INTERNET_FLAG_EXISTING_CONNECT, 0) End If Connect = (hSession <> 0) End Function Public Sub CloseConnection() If hSession Then Call InternetCloseHandle(hSession) End If If hINetSession Then Call InternetCloseHandle(hINetSession) End If hSession = 0 hINetSession = 0 End Sub Public Function UploadFile( _ ByVal sLocalFile As String, _ sRemoteFile As String, _ enTransferType As eTransferType) As Boolean If hSession Then UploadFile = FtpPutFile(hSession, sLocalFile, sRemoteFile, enTransferType, 0) End If End FunctionVB Code:
If Connect("ftp.yourserver.com", "UserName", "SecretPassword") Then UploadFile "c:\myfile.dat", "/folderPath/myfile.dat", FTP_TRANSFER_TYPE_BINARY CloseConnection Else MsgBox "Unable to connect to the server" End If
Nope that just hangs it and i have to restart it.
the following is what i use and it works.
its preety big, but its simple I think because half of the stuff isnt being used.
I dont get it.. why does it stop responding?
I even take out the "upload".
If it connects it unloads the form, but still it hangs.