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

Register .net dll on client machine and use its methods

Status
Not open for further replies.

ashnam10

Programmer
Jul 18, 2007
24
IN
Hello All,

I want to use .NET dll in my VFP 9 program
In IDE mode I am able to generate tlb file and call it using object browser
i use following command to generate tlb and call it in object browser

regasm d:\myproject1608\MyPartnerASP.dll /tlb

On client Machine
I have done as follows
1) regasm d:\myproject1608\MyPartnerASP.dll /tlb ----tlb generated succesfully
2) TLb and dll both are in d:\myproject1608 folder
3) tlb and dll both i have tried putting in c:\windows\system32 and c:\windows\syswow64 folder
4) regsvr32 will not work


code fails at CREATEOBJECT("MyPartnerASP.Relay.ReadClientData")
OLE Error Code 0x80070002: The system cannot find the file specified


This works ok on development machine where I use the step Toos-->Object Browser-->Com Library-->MyPartnerASP.tlb

Any help would be very greatful

Thanks in Advance
 
At the risk of stating the obvious, is the .net framework installed on your target machine?

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.
 
Since the error isn't "Class not registered" you already have the COM registration, but you miss dependencies, so Griff has a good point.

The .net framework...the right version of it. It may even involve dependencies on other assemblies.

And yes, regsvr32 does not work, an assembly is registered as an assembly in the first place, using regasm, as you did. It has to be built with COM interop and then it also works via COM.

You might give the Bridge ( a try, but it will have the same dependency problems. It might give some more hints on what's missing. you can't make use of dependency walker here, to find such additional assemblies it needs, but it might tell you the CLR version necessary.

Bye, Olaf.
 
Hello,

I ensure that .net framework 4 and above is installed

Can you please guide me what care is to be taken when building dll so that I can pass on that information to the programmer.

As I am not familiar with .NET environment deploying any help would be very appreciated.

Like what options to be checked when building

Thanks



 
>I ensure that .net framework 4 and above is installed

If 3.0 or 3.5 were used, you also need 3.0 or 3.5 This is not a "latest version fits all" thing.

Bye, Olaf.
 
Hello,

Yes sir I have ensured that all the frame works are installed in the machine
In the client machine if
1) I install VFP 9
2) generate tlb using regasm
3) Even if I browse the tlb in Object Browser it shows the methods and classes

But what i want is to be able to call this method without IDE
A setup to register this file is required

Thanks for your support

 
You don't generate the tlb using regasm, the COm interop info leading to the tlb file already has to be in the DLL, or else you don't get COM interop. I pointed you to the necessary topics. This is just the table of contents...

regasm is the exe available everywhere to make the registration process. The limited Installshield Express coming with VFP has no capabiliteis to register assemblies via regasm, it provides no way for individual commands to execute during compilation, so either you upgrade to a full version or you go for something else, like Inno Setup.

Aside of that as far as I understood you, you did not even have access in one single test client case, so your learning curve still is at how to ensure all prerequisites for a successful usage of that assembly.

Bye, Olaf.
 
Hello Sir,

Yes Sir this is 3rd party dll which I need to integrate and supply in my vfp application.
So the dll is missing COM Interop Info as per your suggestion.

And I had a belief that if I could call it using object browser client machine would be just registering the dll.

Will need to check with how to user Inno Setup to register this dll on client machine

Thanks for your support and any other of your insights will be helpful


 
If this assembly is not built for COM interop registering with /tlb does not help. It never adds typelib info, it extracts it and shows what it registers. There must be some COM interop in this DLL, because otherwise, as I already said your CREATEOBJECT() would fail with "class not registered". something IS registered, so some typelib info is included in this assembly.

For absolutely native assemblies with no intention for COM interop, the wwDotnet Bridge I pointed to is extracting the class info and generating a COM wrapper on the fly. That means a bridge is done by having a proxy class VFP can call, which then in turn calls the assembly class. But this also has its limits.

If you donÄt succeed in one test installation manually doing regasm, Inno Setup also won't help you with that.

Bye, Olaf.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top