calling/loading c++ dll 
Author Message
 calling/loading c++ dll

I made a dll in c++ to do some calculations, and i call it from VBA ( for
excel XP, also tried it fro access and excel 2000)

Problem is that when i copy the dll to another PC and run the same vba code
i get "run time error 53, dll file not found", on the pc where the dll i
created everything works nice

I've tried to register the dll with regsvr32 and from the vba code, with
"regsvr32 myDll.dll" i get the error "the specified module could not be
found"

I used a "MFC DLL " project in visual studio .net to create the dll, in
basic i followed this example
http://www.*-*-*.com/ ++VBA.htm

Any ideas of what i should do to make the dll run nice on other pc's than
the one the dll i created on ?



Sat, 17 Dec 2005 00:18:56 GMT  
 calling/loading c++ dll

Quote:
>I made a dll in c++ to do some calculations, and i call it from vba ( for
>excel XP, also tried it fro access and excel 2000)

>Problem is that when i copy the dll to another PC and run the same vba code
>i get "run time error 53, dll file not found", on the pc where the dll i
>created everything works nice

Martin,

Your DLL will depend on others that you probably don't have on the
other PC. Use the Depends utility (www.dependencywalker.com) on the
DLL (on the other PC) to find what's missing.

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq



Sat, 17 Dec 2005 00:26:51 GMT  
 calling/loading c++ dll
Martin,

If you followed the steps in the link you provided you created a normal DLL
(Dynamic Link Library) with a list of exported functions. Regsvr32 does not
work with plain DLL's as they don't have the function called by RegSvr32 for
registring itself (DllRegisterServer) and is not using the OLE system. You
will need the Declare Function... statement in your VBA code and you should
install the DLL in the default path for that computer, like \WinNT,
\WinNT\System32 directory. When Windows loads a DLL (without a path
specified) it searches for the DLL in the following order; 1, the directory
the application is running from. 2, the current directory,  3, the System
directory. 4, the Windows directory. 5, directories that are listed in the
PATH environment variable. Your DLL should be installed in one of these
directories. I have not been working with VC++ 7 but if some of the runtime
DLL's in VC++ 7 is different from those in VC++ 6 you must also install
those DLL's on the target computer.

Regards,
Lars-Eric



Quote:
> I made a dll in c++ to do some calculations, and i call it from vba ( for
> excel XP, also tried it fro access and excel 2000)

> Problem is that when i copy the dll to another PC and run the same vba
code
> i get "run time error 53, dll file not found", on the pc where the dll i
> created everything works nice

> I've tried to register the dll with regsvr32 and from the vba code, with
> "regsvr32 myDll.dll" i get the error "the specified module could not be
> found"

> I used a "MFC DLL " project in visual studio .net to create the dll, in
> basic i followed this example
> http://civilu.ce.utexas.edu/stu/goodaljl/c++VBA.htm

> Any ideas of what i should do to make the dll run nice on other pc's than
> the one the dll i created on ?



Thu, 22 Dec 2005 00:10:40 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. VB 5.0 calling C++ 5.0 DLL that calls winsock.dll

2. Calling a C++ DLL function which takes an C++ object as parameter

3. call another DLL from within a C++ DLL

4. Calling external DLL gets error 48, unable to load DLL

5. Unable to load a C++ dll into my Visual Basic client

6. Calling VBA dll functions with C or C++

7. call C++ dll in VB.net

8. Debugging C++ DLL which is called from VB

9. Calling a C++ DLL using vb

10. Instability when calling a C++ DLL from VB.NET

11. calling C++ dll from VBScript within ASP

12. Calling a Visual Basic DLL from C++

 

 
Powered by phpBB® Forum Software