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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dll integration 1

Status
Not open for further replies.

pcjunkey

Technical User
Nov 29, 2004
17
0
0
US
Hey guys, relatively new to VB, but I downloaded this dll to use in a wake on lan VB app....

We're using it in a corprate setting and it would be nice to not have to be required to install it...instead just run it from a floppy or usb or something, so how would I go about avoiding that, can I integrate the dll in my vb app or something?

thanks...
 
According to the page that you linked you don't even need to install it on the client machines.

The following code snippet runs the com service on a remote machine called DELPHI. Please note that both machines must have the com dll registered.

set WakeOnLan = createobject("WolCom.Wol","DELPHI")
WakeOnLan.TheMacAddress("A080641104AA")
WakeOnLan.TheIpNumber("10.43.43.102")
WakeOnLan.TheSubnetMask("255.255.255.0")
WakeOnLan.ThePortNumber("8900")
WakeOnLan.WakeMeUp

You can put the DLL on your app server and only register it on your clients. They will use DCOM to create an instance of the thing over the network.

So you could take a copy of the DLL around on a floppy and then use regsvr32 to register it with regsvr32.exe or you could make a little .reg text file and put it on your intranet site or send it to people via email.

Or did I misunderstand your question?
 
All I would really like to do Sheco is make it so that the the program is just one file, a single executeable, we're probably going to have to distribute this program with another custom app we make to end users who are not computer literate at all, including their sysadmins. I just want to make this as easy as possible....

Just curious if that is possible....also I'd like to take the VBS listed there, and convert it to VB6, are there any differences?

Thanks thus far.
 
If you want to make a single executable, may I suggest using Inno Setup. This freeware program will allow you to make a single Setup.Exe that installs your actual program, any supporting DLLs, INI files, registry entries, and any other files you might need.

You can download it at:
I assure you that an afternoon spent learning how to use this program will be time well spent if you want to distribute increasingly complex applications with a single EXE.

Also, in regard to converting the VBScript to VB6, you could run the code as-is or you could convert it to take advantage of the fact that VB6 can do early-binding of objects.

A more "proper" VB6 version of the above VBS would have a reference to the WolCom DLL checked under the menu item Project->References and the line Dim WakeOnLan As WolCom.Wol would be added at the top, right before the line Set WakeOnLan = CreateObject("WolCom.Wol","DELPHI")

I hope that makes sense.
 
Sheco-

I added the ref as you mentioned in the Project/Ref's

My code is now....

Code:
Private Sub cmd_wakeup_Click()

Dim WakeOnLan As WolCom.WOL

Set WakeOnLan = CreateObject("WolCom.Wol", "DELPHI")
WakeOnLan.TheMacAddress (txt_MAC)
WakeOnLan.TheIpNumber (txt_IP)
WakeOnLan.TheSubnetMask (txt_subnet)
WakeOnLan.ThePortNumber (txt_port)
WakeOnLan.WakeMeUp

End Sub

Where txt_MAC and txt_IP etc are simply input boxes.

When I run the app no matter what I do, I get,
"Run-time error '462:
The remmote server machine does not exist or is unavailable"

I know it does cause it is my own pc and I'm positive I have all the information correct.

Can you offer any more suggestions?

Thanks again

 
You are attempting to create the object on a server called DELPHI

You do have a machine called DELPHI don't you?



Take Care

Matt
If at first you don't succeed, skydiving is not for you.
 
Actually, "Delphi" is the name of the machine from the example code on that first link posted by pcjunkey so I doubt he is actually has his own machine with that name.

If you want only one copy of the object DLL to live on a server, and all the client machines to use that copy, then use this:
Code:
Set WakeOnLan = CreateObject("WolCom.Wol", "<<[i]Put The Machine Name Here[/i]>>")

If you are installing the DLL along with your other software on the client machines then do this:
Code:
Set WakeOnLan = CreateObject("WolCom.Wol")

or this:
Code:
Set WakeOnLan = New WolCom.Wol
 
Hmmmm, reading back over that I think it wasn't clear.

Where I wrote: "<<Put The Machine Name Here>>"

I SHOULD have written: "<<Put The Server's Machine Name Here>>"
 
sheco

From the way the pcjunkey posts his code
pcjunkey said:
My code is now....

Code:
Private Sub cmd_wakeup_Click()

Dim WakeOnLan As WolCom.WOL

Set WakeOnLan = CreateObject("WolCom.Wol", [COLOR=blue]"DELPHI"[/color])
I would suggest that pcjunkeyis using the server name of DELPHI.
sheco said:
Actually, "Delphi" is the name of the machine from the example code on that first link posted by pcjunkey so I doubt he is actually has his own machine with that name.

I am quite aware that delphi is the name used in demo code and whilst it could be a co-incidence... However, I haven't seen any indication from pcjunkey that they have taken this into account and modified teir code appropriately

Take Care

Matt
If at first you don't succeed, skydiving is not for you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top