| |

VerySource

 Forgot password?
 Register
Search
Author: frank_jojo

anxious! Wait online. Questions about calling unmanaged .exe programs in C #?

[Copy link]

0

Threads

6

Posts

7.00

Credits

Newbie

Rank: 1

Credits
7.00

 China

Post time: 2020-5-8 19:00:02
| Show all posts
This thing, I think it may be a calling convention?
The plugin I wrote to MSN can't call the local file, otherwise it will go wrong
Reply

Use magic Report

0

Threads

4

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 Japan

Post time: 2020-5-15 13:00:02
| Show all posts
TO:freegreat
>> You write the method outside the class, it should be fine.
C ++ build error message:
error C2201: 'myAdd': must have external linkage in order to be exported / imported

>> Then you use depends to open the dll file you edited, in which you can view the entry function name.
I read that there is this entry add, but what can not be called
Reply

Use magic Report

1

Threads

7

Posts

8.00

Credits

Newbie

Rank: 1

Credits
8.00

 China

 Author| Post time: 2020-5-17 17:45:01
| Show all posts
TO:freegreat
extern "C" static _declspec (dllexport) double Add (double a, double b) {...}

[DllImport ("MathFuncsDll1.dll", EntryPoint = "The name you see in depends", CharSet = CharSet.Auto)]
public static extern double Add (double a, double b);
Reply

Use magic Report

1

Threads

7

Posts

8.00

Credits

Newbie

Rank: 1

Credits
8.00

 China

 Author| Post time: 2020-5-18 12:30:01
| Show all posts
Like it yourself, please master help.

I have a drawing program developed by others, developed with VC6.0. And there is code.

I now want to develop another set of programs, developed with .net. In this program, you need to use a drawing program in order to draw unique graphics. Therefore, I must call the drawing program in the .net program in order to draw.

Excuse me, are there any good solutions!
Reply

Use magic Report

0

Threads

4

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

Post time: 2020-5-20 11:30:01
| Show all posts
1) Modify the original program as follows:
extern "C" static _declspec (dllexport) double myAdd (double a, double b);
Error: error C2201: 'myAdd': must have external linkage in order to be exported / imported

2) Just remove the static

thank you very much!
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list