Home > Software engineering >  MFC ActiveX call c # DLLS
MFC ActiveX call c # DLLS

Time:09-24

MFC ActiveX calling a no source code in c # DLL, can be successful on their computers, but on the other computer call DLL function failure, step through the discovery after obtaining the handle is wrong, but have to get out, also does not have an error, then get the inside of the DLL function is wrong, when the function is an error, check information said call c + + c # DLL to use other way, but I can't understand, other way is a bit used also in error everywhere,
 
HINSTANCE hmod=LoadLibrary (L "function. DLL");
If (hmod==NULL)
{
FreeLibrary (hmod);
}
The else
{
_GetSerNum=(GetSerNum) GetProcAddress call (hmod, "GetSerNum");
}


CodePudding user response:

Check whether the GetProcAddress call function is successful

CodePudding user response:

reference 1st floor paschen response:
check whether GetProcAddress call function success

Success, no error, but LoadLibrary and GetProcAddress call to obtain the value of the feeling is wrong,

CodePudding user response:

refer to the second floor of a big watermelon, reply:
Quote: refer to 1st floor paschen response:

Check whether the GetProcAddress call function is success

Success, no error, but LoadLibrary and GetProcAddress call to obtain the value of the feeling is wrong,

Why does it feel right, if successful collapse is usually the cause in the DLL, such as interface inconsistent result in unauthorized access

CodePudding user response:

 if (hmod==NULL) 
{
FreeLibrary (hmod);
}

Hmod is NULL, you even freeLibrary, isn't that the NULL pointer manipulation?

CodePudding user response:

reference paschen reply: 3/f
Quote: refer to the second floor of a big watermelon, reply:
Quote: refer to 1st floor paschen response:

Check whether the GetProcAddress call function is success

Success, no error, but LoadLibrary and GetProcAddress call to obtain the value of the feeling is wrong,

Why does it feel right, if successful collapse is usually the cause in the DLL, such as interface caused by inconsistent illegal access

When an error is within call DLL function, but the DLL I don't have the source code, how to troubleshoot problems,

CodePudding user response:





Call a function inside. CPP when error

CodePudding user response:

C + + calling assembly is not using LoadLibrary,
So, you're successful in your own machine is how?

CodePudding user response:

refer to 7th floor Saleayas response:
c + + call the assembly is not using LoadLibrary,
So, you're successful in your own machine is how?

I don't know how successful, before has not, then suddenly one day, I also don't know what to do, a machine can use it now, and the other is not,

CodePudding user response:

. Are you sure your DLL is c # assembly, rather than the COM components or the local dynamic link libraries,
Use other tools to check the,
At least you want to make sure of its export interface symbols,

CodePudding user response:

references a big watermelon, 5 floor response:
Quote: refer to the third floor paschen response:

Quote: refer to the second floor of a big watermelon, reply:
Quote: refer to 1st floor paschen response:

Check whether the GetProcAddress call function is success

Success, no error, but LoadLibrary and GetProcAddress call to obtain the value of the feeling is wrong,

Why does it feel right, if successful collapse is usually the cause in the DLL, such as interface caused by inconsistent illegal access

When an error is within call DLL function, but the DLL I don't have the source code, how to troubleshoot problems,

Sure you calling convention is correct, such as the DLL and the program is written in different languages, variables such as expressed in different programs are consistent, otherwise could lead to a collapse

CodePudding user response:

Look from your screenshot, GetProcAddress call call didn't succeed

CodePudding user response:

Don't be A language code is modified to B language code busywork,
Also don't use A language code to directly invoke B language code base, this complicated things so easy to get wrong,
Just make A, B language code of input and output is redirected to A text file, or modify A, B language code let it through text file input and output,
Can easily make A, B coordination between the two languages,
For example:
A will request data written to A file a.t xt, renamed after finish aa. TXT
B find aa. TXT, read its contents, call the corresponding function, and writes the results file b.t xt, after finish delete aa. TXT, then b.t xt renamed bb. TXT
Found A bb. TXT, read the content, after finish delete bb. TXT
Above can be replaced by any kind of A language or development environment, B can be replaced by any kind of with the development of A different language or development environment,
Unless A or B does not support to determine whether A file exists, file read and write and file name,
But who can name does not support to determine whether a file exists, file read and write and file name for the development of language or development environment?
Can put the temporary files on the RamDisk efficiency decrease wear disk,
Data structure is very complex, a text file format problems refer to a json or XML

The communication methods between the temporary text file sharing this process there are plenty of advantages, compared to other method only listed below I can think of now:
Loose coupling between process,
Can be on the same machine, process, also can cross machine, across the operating system, hardware platform, and even multinational,
, convenient debugging, and monitoring, only let the third party or artificial view the temporary text files,
Switch, convenient online service, need to delete or create the temporary text files,
, is convenient to realize distributed and load balancing,
Services to provide convenient, queue, queue is full and it is almost impossible to happen (unless the hard disk space full)
DE...

"Across different languages, machine, across the operating system, hardware platform, multinational, cross *. *" misery,
Back is "the use of Shared a plain text file information communication" of the shore!

CodePudding user response:

Oneself the top, the great god,

CodePudding user response:

What is the meaning of this, is a problem with this DLL

CodePudding user response:

Feel you the DLL is not.net
  • Related