TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
byron wallace
NA
5
0
Calling Unmanaged DLL From C#
Jul 25 2007 11:38 AM
Hi all, I've inherited a code-base which uses existing DLLs that contain all of our statistical algorithms. In the .NET development environment, the DLLs execute fine and return as expected. Moreover, when I compile the .NET project to an .exe, I am able to run it locally on the same machine that the development was done on. However, when I attempt to port the executable (along with the DLLs, which I store in the same directory as the .exe) to other machines, the program crashes, with no error message, when the DLL is called (I verified this by removing the DLL call and compiling, and the program ran with no problem). In our Wrapper class (CoreAlgorithms.cs), I have the following code:
[DllImport(@"dcdflib.dll", EntryPoint = "cdft", ExactSpelling = false, CallingConvention = CallingConvention.Cdecl)] public static extern unsafe void cdft(int* which, double* p, double* q, double* mult, double* df, int* status, double* bound);
I then call this method as follows:
unsafe
{
CoreAlgorithms.cdft(&which, &p, &q, &mult, &df, &status, &bound);
}
Again, this works fine in .NET and my machine, but fails immediately on other machines. Does anyone have any idea as to I'm doing incorrectly here? Any help or pointers would be greatly appreciated. Thank you for your time.
Reply
Answers (
5
)
Sending online form to my email address...
Appending object names