Chikura
Pilgrim
- Mark as New
- Subscribe
- Mute
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎Sep 19, 2007
02:25 AM
copy the DLL to system32
Hi,
Previously i was having problems when i tried to load a DLL from the SUPPORTDIR directly. IS was unable to load the DLL.
We solved it by copying that DLL first to the system32 directory and then loading the dll from there.
Ur Customaction should do following:
1) Check for existence of DLL in system32.
2) If it exists delete that DLL.
3) Copy that DLL from SUPPORTDIR to system32.
4) Load DLL
5) Do whatever u want,,,,,,,
.
.
)Unload DLL
)Delete the DLL from system32.
Hope it helps,
Santhosh
Previously i was having problems when i tried to load a DLL from the SUPPORTDIR directly. IS was unable to load the DLL.
We solved it by copying that DLL first to the system32 directory and then loading the dll from there.
Ur Customaction should do following:
1) Check for existence of DLL in system32.
2) If it exists delete that DLL.
3) Copy that DLL from SUPPORTDIR to system32.
4) Load DLL
5) Do whatever u want,,,,,,,
.
.
)Unload DLL
)Delete the DLL from system32.
Hope it helps,
Santhosh
klacounte
Pilgrim
- Mark as New
- Subscribe
- Mute
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎Sep 19, 2007
09:54 AM
Re: Serial number validation dll
Chikura wrote:
We solved it by copying that DLL first to the system32 directory and then loading the dll from there.
You can load a dll from any location as long as you specify the full path to the dll. Following this link for more info LoadLibrary Function. Copying the dll to the System32 directory works because that is in the dll search path but I would not recommend it. See this link for dll search order Dynamic-Link Library Search Order.
If your dll loads other dll's from that same directory then you'll need to call SetDllDirectory on XP SP1 or higher or SetCurrentDirectory on any other OS.
Nicolasb
Pilgrim
- Mark as New
- Subscribe
- Mute
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎Sep 19, 2007
12:53 PM
Re: Serial number validation dll
I tried your suggestion and well, I think I missed something somewhere.. I'm sorry, but I got more questions.
I put my file in the supportdir and I loaded the DLL using UseDLL in an Installscript CA. The UseDll function worked fine, but I couldn't call my function... I think an exception occurs when I call the function. Do you have an example code on how to call a function in an external dll. The example along with the UseDll example isn't enough for me. Here is my function definition : extern "C" __declspec(dllexport) int __stdcall TestDll( int pOut )
Also, I explored the idea of putting my dll in the binary table. But here, I don't see where to put it in the project. I did not find the folder.
Thanks guys!
I put my file in the supportdir and I loaded the DLL using UseDLL in an Installscript CA. The UseDll function worked fine, but I couldn't call my function... I think an exception occurs when I call the function. Do you have an example code on how to call a function in an external dll. The example along with the UseDll example isn't enough for me. Here is my function definition : extern "C" __declspec(dllexport) int __stdcall TestDll( int pOut )
Also, I explored the idea of putting my dll in the binary table. But here, I don't see where to put it in the project. I did not find the folder.
Thanks guys!
esiemiat
Occasional contributor
- Mark as New
- Subscribe
- Mute
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎Sep 19, 2007
01:33 PM
Re: Serial number validation dll
Did you prototype the DLL function before calling it. The prototype should look something like:
prototype MyDLL.MyFunction( INT, INT, INT );
Nicolasb
Pilgrim
- Mark as New
- Subscribe
- Mute
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎Sep 19, 2007
02:05 PM
Re: Serial number validation dll
You mean that the prototype for function
(??) What is the argument pOut and what is the return value of the function ? And why the third int ? I would have declared my function that way :
extern "C" __declspec(dllexport) int __stdcall TestDll( int pOut )in gaga.dll should be
prototype gaga.TestDll( INT, INT, INT );
(??) What is the argument pOut and what is the return value of the function ? And why the third int ? I would have declared my function that way :
prototype INT cdkc.TestDll( INT );
esiemiat
Occasional contributor
- Mark as New
- Subscribe
- Mute
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎Sep 19, 2007
02:42 PM
Re: Serial number validation dll
That was a sample from the help. The point was that you had to prototype your DLL function in InstallScript prior to calling it. Substitute you DLL name for MyDll, you function name for MyFunction, and list whatever your paramters are in the parameter list.
- « Previous
-
- 1
- 2
- Next »