Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3143
  • Last Modified:

Cannot load library error 126

Hi all!

 

I have a big problem.

I developed a DLL file for MetaTrader via Visual Studio Express 2010 C++.

Metatrader is a forex trading program which is programmable and can use any DLL file by import function.

I have used the VS express on Windows 7 x64 op system.

The express can not use x64 (as I know) so everything is built as x86 (32bit), I have checked it via Properties (management).

The problem: I built DLL file on my machine and it is working perfectly under MetaTrader but only on my machine. (perhaps VS copied some needed files)

When I tried it on other machine (WIn XP (x86)) then I got an error message: cannot load library error 126

Dependency Walker shows the following DLLs are missing (only on WIN XP machine):

 

WER.DLL

NCRYPT.DLL

BCRYPT.DLL

IESHIMS.DLL

I downloaded them and put to experts/libraries (next to my dll file).

(metatrader can find any DLL which copied to this 'libraries' )

The problem still exists.

I changed the Use of MFC from shared to static in VS and rebuilt the DLL.

VS settings:

Properties/Configuration Properties/General/Use of MFC=Use MFC in a Static Library
Properties/C++/Code Generation/Runtime Library=(/MDd)

I set these ones what I gathered of forums, etc...

The problem still exists. (DLL files are missing further)

I think it is a compier setting problem but I do not know what.

Do you have any advice for me?

Thanks!

 

Br,

Carlos
0
Carlos1976
Asked:
Carlos1976
  • 3
  • 2
  • 2
1 Solution
 
sarabandeCommented:
the dlls were looked for in the folder where the application executable resides, then in windows and system32 folders, then in folders of path environment variable.

though called 'library' the library paths of visual studio are for object libraries only, not for dlls.

Sara
0
 
AndyAinscowCommented:
>>Visual Studio Express

Three points.
1)  As far as I understand it there isn't built in support for MFC, so I don't understand how you are using the options concerning MFC in the build.
2)  Also you might be in breach of your licence agreement with trying to distribute something to other PC's
3)  Just copying dll's (which you  might or might not be allowed to distibute - another potential breach of licence) isn't a good way to distribute your application - some need registering for instance.
0
 
sarabandeCommented:
you may download VS2010 runtime at the target computer. it is free. installing it should solve the dll issues.

Sara
0
Restore individual SQL databases with ease

Veeam Explorer for Microsoft SQL Server delivers an easy-to-use, wizard-driven interface for restoring your databases from a backup. No expert SQL background required. Web interface provides a complete view of all available SQL databases to simplify the recovery of lost database

 
Carlos1976Author Commented:
Thanks Sara and Andy,

Well the customers who will use this DLL file will not install the VS2010 runtime, but thanks for this useful information Sara. I will try it on my other PC. :-)

Andy, to create product in VS Express is legal even if the product will be sold or other computer will use. But I got info that Express adds some interesting part to your application (which was created by it) on the way that you can not use on other PC. I do not know and was surprised but maybe.
I use MFC realted part in my main dll code so the MFC is used and I set the MFC static libray so my DLL should include the corresponding MFC part as static.

I do not know the answer yet but thanks for help both of you!
If you have any idea juts share it with me, please!

BR,
Carlos
0
 
Carlos1976Author Commented:
Hi Andy again,

A little bit completion for selling.
I can sell but only if I give the source code too.
It menas that probably I have to see other program than VS Express.
Can you advice me a similar program, please?

Thanks!

Carlos

0
 
AndyAinscowCommented:
VS professional, same environment, you can distribute, MFC should be fully supported.  (Even comes with a licence for a version of Install Shield which you can download - so you get a program you can use to create installations)
0
 
sarabandeCommented:
when the customers do not install vs2010 runtime, you could do it with your setup.

i checked my xp system for your dlls and they were missing. seems they were part of ie8 (which i haven't installed). you can freely download them from various sides. check the copyright whether they can distributed.

Sara
0

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

  • 3
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now