Home > Software engineering >  Ocx call DLL
Ocx call DLL

Time:09-21

Wrote a ocx controls, call some DLL, some of them are registered DLL (called a. d. ll), but some of them are running need ocx DLL (B.d ll),
The question now is, such as C program calls the ocx controls, I must put B.d ll system directory or C programs running directory,
I don't want to put B.d ll system directory, but the problem is coming now I don't know what the program ocx will call me, also don't know where to put my B.d ll need,
The problem how to solve ah ~

CodePudding user response:

The ocx DLL only need and depend on. Ocx together is ok

CodePudding user response:

But B.d ll in ocx directory, prompt load B.d ll fail, I can successfully loaded in a C program running directory

CodePudding user response:

reference 1st floor lzlliuzunli response:
ocx DLL only need and depend on. Ocx together ok

But B.d ll in ocx directory, prompt load B.d ll fail, I can successfully loaded in a C program running directory

CodePudding user response:

Use Depends on your C program is also dependent on B.d ll

CodePudding user response:

reference 4 floor lzlliuzunli response:
use Depends on your C program is also dependent on B.d ll

Do not rely on ah, ocx in initialization to invoke B.d ll, but by the C program calls ocx, ocx will find B.d ll directory in the C program

CodePudding user response:

Is not scientific, ocx dependence should in ocx directory to find, you are not using LoadLibrary specified relative path of the current process?

CodePudding user response:

Prompt you for a minute, if you have a C on the remote computer, don't you want to put in the distant computer,
So the best way is in the system directory, including you. Ocx files should be in the system directory,
If you really don't want to put in the system catalog at this time, you can set your own directory for OCX, then set the absolute path in registry entries,
You referenced DLL if only for the use of OCX, can put in your expectations placed anywhere, but definitely not a C location, because you never know who is C,
. The best is like OCX in DLL directory or is their own special directory,
At this point in your OCX. Load the DLL, using absolute path load, the absolute path can be static, can also be a dynamic, but when you load, must know where she is,
If you can't use LoadLibrary manual loading, but the automatic loading, then using SetDllDirectory set loading paths,

CodePudding user response:

refer to 6th floor lzlliuzunli response:
is not scientific, ocx dependence should in ocx directory to find, you are not using LoadLibrary specified relative path of the current process?

To use loadlibrary, automatic loading, is a style with BCG library DLL, BCGPStyle2010Blue2210. DLL when the DLL is loaded ocx in C in the system directory or directory C, rather than in ocx directory to look for

CodePudding user response:

refer to 7th floor Saleayas response:
prompt you for a minute, if you have a C on the remote computer, don't you want to put in the distant computer,
So the best way is in the system directory, including you. Ocx files should be in the system directory,
If you really don't want to put in the system catalog at this time, you can set your own directory for OCX, then set the absolute path in registry entries,
You referenced DLL if only for the use of OCX, can put in your expectations placed anywhere, but definitely not a C location, because you never know who is C,
. The best is like OCX in DLL directory or is their own special directory,
At this point in your OCX. Load the DLL, using absolute path load, the absolute path can be static, can also be a dynamic, but when you load, must know where she is,
If you can't use LoadLibrary manual loading, but the automatic loading, then using SetDllDirectory set loading paths,

How well is that I check under the set ocx DLL loading list

CodePudding user response:

There is a problem, whether other programs are running through your C program to invoke the ocx, or direct call ocx, but no matter what way, as long as you call the main process of ocx, as long as your ocx dependent DLL library on the main process directory is ok,

CodePudding user response:

You agreed to, you tell the user needs to put the DLL to prevent with directory, ocx in user install package will be in accordance with the processing!

CodePudding user response:

At the beginning of dllmian set setdlldirectory try

CodePudding user response:

Ocx DLL used generally in call ocx directory, such as call ocx, ie used ocx DLL in ie directory to ensure no problem,

CodePudding user response:

Put DLL under the Windows/system32 can, a 64 - bit system corresponding to the position

CodePudding user response:

1, the solution is set in the ocx DLL loading paths setdlldirectory
2, and is the way of ocx using dynamic load the DLL
  • Related