Results 1 to 8 of 8

Thread: CreatObject problem

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2002
    Posts
    5

    CreatObject problem

    HI, I have a visual basic ActiveX dll (prog.dll) with a class (Class1.cls) and want to run it on an NT machine, i also have a visual basic EXE which i want to run on another machine and it calls functions within Class1 of prog.dll. i tried
    CreateObject("prog.Class1", "ServerName")
    but it throws an error: that it can't find the server. WHAT should i do???
    i have also regsvr32.exe prg.dll on the server!!
    do i have to include a reference of the dll in the exe??

  2. #2
    PowerPoster Arc's Avatar
    Join Date
    Sep 2000
    Location
    Under my rock
    Posts
    2,336
    Make sure you have the correct Servername. Servername is the name of the Computer where the Obj is. If the Obj is on your computer then just leave that argument off like this

    Set MyOBject = CreateObject("prog.Class1")

    Else

    Set Myobj = CreateObject("prog.CLass1", "OEMCOMPUTER")

    Where OEMCOMPUTER is the name of the computer on the network. OEMCOMPUTER is the name of my computer, you would have to change that ofcourse.
    Last edited by Arc; Apr 25th, 2002 at 10:31 PM.
    -We have enough youth. How about a fountain of "Smart"?
    -If you can read this, thank a teacher....and since it's in English, thank a soldier.


  3. #3
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    I think you have to register a dll with DCOM to use it on another computer. Or maybe there is an option when you compile this that does it also. Because even though the dll doesn't have to reside on the machine using it, it does have to be registered on that machine.

  4. #4
    PowerPoster Arc's Avatar
    Join Date
    Sep 2000
    Location
    Under my rock
    Posts
    2,336
    Why would the DLL have to be registered on the machine that is calling it? Isnt all the work being done on the foriegn computer? Seems to me if the other computer is the only one using the DLL then your computer doesnt need to register it. After all isnt your computer only recieving the info back from the DLL and not actually doing any processing?


    i've never done it so i'm just guessing
    -We have enough youth. How about a fountain of "Smart"?
    -If you can read this, thank a teacher....and since it's in English, thank a soldier.


  5. #5
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Well I'm not 100% sure that it does but I remember reading something about it. I've only done that (used a dll on another machine) once before and I don't remember how I did it but I believe I had to register it with DCOM on the target machine. I have 2 machines here I'll find out for sure for us.

    Where is Jim McNamara he'll know, that guy knows everything.
    Last edited by Edneeis; Apr 26th, 2002 at 12:15 AM.

  6. #6
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Well I tested it and got an 'Object not registered on Local Machine' error. Now I'm going to try registering it with DCOM and see if the error goes away.

  7. #7
    PowerPoster Arc's Avatar
    Join Date
    Sep 2000
    Location
    Under my rock
    Posts
    2,336
    While yer at it explain what DCOM is and how to use it
    -We have enough youth. How about a fountain of "Smart"?
    -If you can read this, thank a teacher....and since it's in English, thank a soldier.


  8. #8
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Well DCOM is basically remote COM as far as I understand it, but it appears that I don't understand it too well. Well I got confused poked around a bit, searched the net, and got to work (almost). I added the dll on the 'server' machine as a COM+ app in the component services (we need a tutorial on this) and then started it and exported it (which creates a little .msi file). I then installed the msi thing and it set it up on the client machine for DCOM (since I couldn't figure out how to do it manually, this seems like it was much easier on win 9x). Then it stopped giving me that error but then I got a permission error.

    Hmm well this permission denied deal has begun to bother me now.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width