Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DLL must be in the folder?
Message
 
 
To
27/12/2016 11:57:40
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01646117
Message ID:
01646121
Views:
44
>>Hi,
>>
>>I am getting an error on the line SetClrVersion() below (this is one of the functions in wwClientTool).
>>
>>
>>PROTECTED FUNCTION SetClrVersion(lcVersion)
>>DECLARE Integer SetClrVersion IN WWC_CLR_HOSTDLL string
>>SetClrVersion(lcVersion)
>>ENDFUNC
>>
>>
>>The error says
>>
>>could not find entry SetClrVersion in the DLL
>>
>>
>>The DLL is in the PATH.
>>
>>But when I place the DLLs in the folder where the program is executed, no error. Does it mean that DLL always MUST be in the folder for this call?
>
>Check where WWC_CLR_HOSTDLL is #defined, I guess somewhere in wconnect.h or some such file - it may contain a path. So either recompile the ww stuff to include a path you can use, or put it in some place where the COM mechanism can find it (windows system folder, or where you already put it - the app's folder).
>

I did compile the .prg and the compiler had not errors. But I will check this #define.

>In most of the cases, a COM object has no clue of any folders you may have used while making it; it's most probably instantiated with default folder somewhere in your private folders (%appdata% or thereabouts), and it may actually find a wrong version of the dll in one of these places. Since the apps own folder is searched before the other default locations, you already circumvented that mechanism in a way that works for you.
>

I didn't think that this code instantiates COM object (maybe I am mistaken but I thought that COM objects are no longer suggested to use).


>You may use _vfp.ServerName to get the full path to the location of your .exe or .dll, and then extract that path and use it to find other components that you install in that same folder or below it - which I've found is one reliable way to find those other files. Just don't make any assumptions on the current folder, because there are no guarantees to that. If your app is running under IIS, your DLL is created by the user to whom the application pool is assigned (in "run as" setting), and then it's that user's %appdata% or some such folder. You are better of if you (write your COM object so that you) don't care where that folder is.

I am no running this code under IIS, neither from an .EXE, but right from the VFP 9 IDE.

Thank you.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Reply
Map
View

Click here to load this message in the networking platform