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
Sunny Wang
NA
4
2.1k
c#read from remote PLC use cc link IE control
Jan 9 2015 6:28 AM
This is the first time for me in this application. link library is only for VC++, so I wrapped it into a library that can use in c#, and then import in c#, I 've tested the function in VC++ it works fine.but in C#, although the return value is 0, I can read nothing, the result is null. hope somebody can help me. thanks in advance.
here is the function in original library header file.
LONG WINAPI mdReceiveEx( LONG, LONG, LONG, LONG, LONG, LPLONG, LPVOID );
and I wrapped in C++
MELFUNC_API long MmdReceiveEx(long path,long netno,long stno,long devtyp,long devno,long size,short *data); long MmdReceiveEx(long path,long netno,long stno,long devtyp,long devno,long size,short *data)// {
long result=mdReceiveEx(path,netno,stno,devtyp,devno,&size,data);
return result; }
and import in c#
[DllImport(@dllname, CallingConvention = CallingConvention.Cdecl)]
static extern int MmdReceiveEx(int path, int netno, int stno, int devtyp, int devno, short size, ref short[] data);
and the function be called
int retval2 = MmdReceiveEx(151, 1, 2, 23, 0x00, sizetst, ref buf1);
the retval2 will be 0 and buf1 be null after executed. can anybody help me?
Reply
Answers (
0
)
what Control to used to display an dxf file contents
List that this enumerator is bound to has been modified. An