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!

I solve problem with use COM object on another computer

Status
Not open for further replies.

alexsubscriber

Technical User
Sep 9, 2003
12
0
0
MD
Let's have 2 computers
ComputerA - installed Visual Fox Pro 6.0
ComputerB

Task.
Create dll on
ComputerA and use this dll on
ComputerB

Solution:
on ComputerA we MUST do next steps:
1.Install VisualStudio ServicePack 3 or higher
2.Install Setup Factory 6.0 - suf60ev.exe
3.Install Visual FoxPro6.0 Service Pack 5.0 -
visualfoxpro6sp5_rts.exe
4. ATTENTION! In Visual FoxPro 6.0 create dll as SINGLE THREADED COM SERVER (dll) -
(If you create dll as simple COM dll, after this dll can't work)

after this previous steps on ComputerA we have myCOM.dll (SINGLE THREADED COM SERVER)

On ComputerB registrate myCOM.dll. To do this follow this steps on ComputerB:
1.Copy myCOM.dll to any folder, e.g. \myFolder2.Copy VFP6R.DLL , VFP6RENU.DLL files to folder \myFolderFiles VFP6R.DLL , VFP6RENU.DLL we can get from folder where you we installed Visual FoxPro6.0 Service Pack 5.0 on ComputerA
2.Registrate myCOM.dll , e.g.
regsvr32 c:\myFolder\myCOM.dll

Now we can use myCOM.dll on HostB

Enjoj :)
Thank you


 
alexsubscriber

4. ATTENTION! In Visual FoxPro 6.0 create dll as SINGLE THREADED COM SERVER (dll) -
(If you create dll as simple COM dll, after this dll can't work)



I have been using a multi-thread DLL (that generates XML files) on a server for a while now. Can you comment as to why you would make the above statement?

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Ok, maybe multi-threades is better. I didn't try.
My task/target was to call method from dll on other computer

:)
 
alexsubscriber

You may end up where two computers cannot access the same DLL at the same time.


Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
You want to say that if many clients in the same time try to use remote myCOM object (witch is SINGLE THREADED COM SERVER) then they get error. As result you advise me to crete MULTI-THREADED COM SERVER, do.

Am I correct understand you?



 
alexsubscriber

Not exactly. Here is an explanation:
SingleUse Objects in DLL Servers
The Instancing property is ignored for multithreaded .dlls and is only read for the Vfp7r.dll run time. Servers built for use with the vfp7t.dll library are always MultiUse regardless of their setting. In general, you should always set the Instancing property to MultiUse for vfp7r.dll in-process servers. If you set it to SingleUse, only one instance of an object from that server can be created. You will get an error if you try to instantiate more objects. Only under rare circumstances would you want to use the SingleUse setting. In fact, Microsoft Transaction Server components require the MultiUse setting. SingleUse objects often require more memory overhead than multiple objects in a multithreaded component.

There are reasons, however, for which you might want to use SingleUse objects. For example, you can isolate high-risk activities in separate processes with SingleUse objects. If the object suffers a fatal error, other processes are not affected. By contrast, a fatal error in a multithreaded component terminates all threads.




Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Mike

Are VFP com dlls similar to VB com dlls, in that, the dll itself is single threaded. Putting into MTS and using MultiUse is what provides the multi-threaded capabilities.

John
[lightsaber]
 
Hoosier121

Are VFP com dlls similar to VB com dlls, in that, the dll itself is single threaded. Putting into MTS and using MultiUse is what provides the multi-threaded capabilities.

I'm not an expert with DLLs and specifically with VB DLLs, but I got caught once with a single-thread VFP dll when two computers tried to access it, I switched to multi-threaded type, and the situation corrected itself.



Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top