-
[RESOLVED] DLLs: What functions they have, which ones are called by what program
I have a webcam which can be moved around (pan/tilt/zoom). The drivers give the option to do this, as well as when you're displaying an image from it (in any application) a little control window comes up, enabling you to move the cam or zoom in and out.
Someone has made a DLL that allows you to control its tilt and pan functions through an application. I want to make my own to allow for zooming too. Unfortunatly, i don't know how they did it, since the website with the source is down.
What i want to do is to try and work out how they got the functions etc. to call in that DLL.
Logitech has applications that allow you to control the cam, and has multiple DLLs in the same folder. I want to know what the app calls, or at least what functions (and parameters of said functions) are in each of those DLLs.
Thanks for any help! :D
-
Re: DLLs: What functions they have, which ones are called by what program
If its a com dll, it should be pretty simple. Add a reference to your vb project and launch the object browser.
-
Re: DLLs: What functions they have, which ones are called by what program
Sorry, i should have said, i'm using C++
I don't have VB installed either, so i can't find out what the functions and parameters are that way. :(
-
Re: DLLs: What functions they have, which ones are called by what program
I am not familiar with the VC++ interface. Secondly if its a C++ DLL as opposed to a COM DLL, the object browser will not be able to help you out.
-
Re: DLLs: What functions they have, which ones are called by what program
DLL's which have been documented should have type libraries associated with them. I will do some research as I believe there are some API's which enable you to read a DLL's type libraray.
-
Re: DLLs: What functions they have, which ones are called by what program
Ok, cool thanks adam. Thanks too abhijit, for the info. :)
-
Re: DLLs: What functions they have, which ones are called by what program
If these DLL's have type libraries you can use the following article, which shows you how to import them in C++
http://www.codeproject.com/tips/importtlbs.asp
You will need the program ID for the DLL. You can find this by searching the registry key HKEY_CLASSES_ROOT for the dll. For example, if I want to find the program ID for wshom.dll:
- Search the registry for wshom.dll. You should find it in a key called InProcServer32.
- The parent key the dll's class ID should contain a key called ProgID. The default value for this key is what you need.
- Look also for a key called VersionIndependentProgID and use this if it is present. In this case the program ID is wscript.network
- If the dll has a type library then there should also be a sub key called TypeLib
N.b: a dll may have several program ID's and type libraries.
MS also has a DLL called TlibInf32.dll which contains functions which enable you to programaticly extract information from type libraries. I have some VB code which uses these functions, let me know if you want to take a look and I'll upload it.
-
Re: DLLs: What functions they have, which ones are called by what program
Thanks for thelink, i'll check it out asap.
Is the VB code VB6 or .net? I don't have VB6 installed, so i wouldn't be able to compile it.
If you have a working application that can do something like that, it'd be great!
EDIT: I get the following error :(
error C3501: there is no typelib registered for ProgID 'BackWeb.ClientExt.1'
I cut & pasted that in. I don't need to copy the DLL to my application or anything do i?
Also, what will this do, it seems i still need to know the function names/parameters to use the DLLs i import, unless i'm mistaken???
EDIT2: Ah, didn't see that i need to look for a typelib key in the registary, they don't have any (tried a few DLLs), that means i'm stuck i guess??
-
Re: DLLs: What functions they have, which ones are called by what program
use spy++ to catch the messages it sends when zooming :thumb:
-
Re: DLLs: What functions they have, which ones are called by what program
Quote:
Originally Posted by |2eM!x
use spy++ to catch the messages it sends when zooming :thumb:
Would that work?? Great if it does, but i don't think so, since it catches/intercepts messages going TO the window. Plus it moves the camera via DLL calls (i assume) not by sending messages to another application/window.
-
Re: DLLs: What functions they have, which ones are called by what program
Whatever .exe is running it, you can see its dll calls thru spy++ (or at least thats what i thought)
-
1 Attachment(s)
Re: DLLs: What functions they have, which ones are called by what program
Quote:
Originally Posted by SLH
Thanks for thelink, i'll check it out asap.
Is the VB code VB6 or .net? I don't have VB6 installed, so i wouldn't be able to compile it.
If you have a working application that can do something like that, it'd be great!
EDIT: I get the following error :(
error C3501: there is no typelib registered for ProgID 'BackWeb.ClientExt.1'
I cut & pasted that in. I don't need to copy the DLL to my application or anything do i?
Also, what will this do, it seems i still need to know the function names/parameters to use the DLLs i import, unless i'm mistaken???
EDIT2: Ah, didn't see that i need to look for a typelib key in the registary, they don't have any (tried a few DLLs), that means i'm stuck i guess??
The code is VB6 but I have a compiled .ocx which when registered is scriptable from Windows Script Host. I've attached the ocx. If you do the following then the script should work too:
- Copy the .ocx file to the windows directory.
- Type the following into Start Menu -> Run
Code:
regsvr32 C:\winnt\typelib.ocx"
- Then run the VBScript and type the entire path of the DLL into the input box.
- It will create a directory called C:\documentation\ with a sub folder for each dll you type. This directory will contain a bunch of HTML files which pertain to each object in the DLL.
If any of your DLL's have type libraries, this script will find them :) - If you want to unregister the ocx after you are done you can type the following:
Code:
regsvr32 /u C:\winnt\typelib.ocx"
-
Re: DLLs: What functions they have, which ones are called by what program
Quote:
Originally Posted by |2eM!x
Whatever .exe is running it, you can see its dll calls thru spy++ (or at least thats what i thought)
Perhaps that is the case, i have only every used it for intercepting messages.
Unfortunatly i have MSVS 2005 Beta, which doesn't come with spy++
-
Re: DLLs: What functions they have, which ones are called by what program
Quote:
Originally Posted by visualAd
The code is VB6 but I have a compiled .ocx which when registered is scriptable from Windows Script Host. I've attached the ocx. If you do the following then the script should work too:
- Copy the .ocx file to the windows directory.
- Type the following into Start Menu -> Run
Code:
regsvr32 C:\winnt\typelib.ocx"
- Then run the VBScript and type the entire path of the DLL into the input box.
- It will create a directory called C:\documentation\ with a sub folder for each dll you type. This directory will contain a bunch of HTML files which pertain to each object in the DLL.
If any of your DLL's have type libraries, this script will find them :) - If you want to unregister the ocx after you are done you can type the following:
Code:
regsvr32 /u C:\winnt\typelib.ocx"
Excellent, cheers Adam. I'l give it a go.
-
Re: DLLs: What functions they have, which ones are called by what program
It says activeX can not create the object. Does that mean the ocx wasn't registered correctly? because i put it in c:\windows\ and did the regsvr32 command (it said it registered the ocx successfully).
I also tried running the script from the windows directory.
-
Re: DLLs: What functions they have, which ones are called by what program
Under VisualAD's instruction i used MS Access' object editor to view the DLLs TypeLibs. Unfortunatly none of the DLLs had anything usefull in them, but at least now i know. :)