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
chandrashekhar sharma
1.4k
304
6.9k
How to call c++ dll in wcf Service?
Dec 24 2015 1:06 AM
I have written simple method for math function in c and create dll as mathfunction.dll
bellow cose is mathfunction.dll.
#include <stdio.h>
extern "C"
{
__declspec(dllexport) int add(int a,int b)
{
return a+b;
}
__declspec(dllexport) int subtract(int a,int b)
{
return a-b;
}
}'
I try to consume mathfunction.dll in wcf service then throw error message.
'An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)'
Bellow code used in wcf service.
public int Sum(int value, int value1)
{
return add(value, value1);
}
[DllImport("MathFunction.dll", CallingConvention = CallingConvention.Cdecl)]
private static extern int add(int num1, int num2);
Reply
Answers (
1
)
How to call unmanaged c++ dll in wcf library?
Find latitude longitude within 100 km radius