Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Doubts about DLLs and Custom Classes
Message
From
30/05/2001 13:52:01
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00512787
Message ID:
00512792
Views:
10
When you build a COM component, an entry gets made in the registry that specifies it's public methods, events, and properties (it's public interface), and the physical location of the DLL on disk. So, when you move the DLL, it can't be found. You can fix this however.

1. Unregister the old DLL, from the Command Prompt, REGSVR32 /u MyCOM.DLL
2. Move the DLL and it's associated .TLB and .VBR files to the new location.
3. Reregister the DLL, from the Command Prompt, REGSVR32 MyCOM.DLL

When you copy the DLL to another computer, you need to copy the associated .TLB and .VBR files with it and then register it as in step 3 above. You will also need the Fox runtime files on the other computer.


>Hi everybody,
>This is my problem :
>I'm developing an application in VFP and I have some prgs I don't want to be public but I want them to be accessible for other applications maybe.
>So I copied a PRG to another directory and modified it to look something like this:
>
>*** PRGDLL.PRG *****
>
>define class ABCCrypt as CUSTOM OLEPUBLIC
>
>procedure ABCEncrypt(Key, Text )
> // all the function code
>endproc
>
>procedure ABCDecrypt(Key, Text )
> // all the function code
>endproc
>
>enddefine
>
>then I compile it with other PRG like this :
>
>build project MyProy RECOMPILE FROM PrgDll.PRG
>BUILD DLL ABCCrypt FROM MyProy
>
>it creates ABCCrypt.dll, ABCCrypt.VBR, ABCCrpyt.tlb
>then I can call this function like this:
>
>o = createobject("ABCCrypt.ABCCrypt")
>o.ABCEncrpyt(pass, @text )
>
>I tried it and works fine.... now my doubts are:
>1) I don't really know why it works sometimes and sometimes not.... is it enough to copy the .dll to the application dir ? or do I need something else?
>I saw an example that it needed to copy .VCT and .VCX also... but I don´t have them... do I need them?
>The error I get if I move the dll to the app dir is : "Estado de COM desconocido"... something like "COM not found"
>
>2) When I distribute the app in other machines, it says "ABCCrpyt.ABCCrpyt class not found" ..... why is this if I have the dll in that machine ?
>
>I guess it's enough by now....
>thanks all
>fabian
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform