60 438
Assignments Done
98,1%
Successfully Done
In April 2018

Answer to Question #38178 in Other Programming & Computer Science for eranjene sandun

Question #38178
DLL files are compiled, which means they are in machine code. If so how can a programmer invoke a function in DLL in a high level language like Java or C#?
Expert's answer
.NET framework has a set of compatibility tools for this purpose.
In C# you'll need to write the following code in order to get access to "someclass" inside "somelibrary.dll":
[DllImport("somelibrary.dll")]
public extern someclass();

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

Assignment Expert
09.01.14, 17:45

It is possible to use mix DLLs and EXEs built with different compilers, or even written in different languages, as long as some basic guidelines are followed. For an existing DLL, two issues need to be considered:

Was the DLL compiled with Cygwin? (If so, you may be out of luck if you want to use an EXE built with anything else.)
Which language was used to write the DLL? (It makes a considerable difference if C is used rather than C++.)

noviceprogammer
08.01.14, 17:35

so can we use any DLL regardless of the language it's written in?

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions