Сообщение от GoodWin
Т.Е. у тебя работает, а пример показать не трудно... плиз
|
Вот работает, только, как я уже говорил, адрес Part в длл не совпадает с блицевским.
Const MAX% = 10
Type Part
Field x
Field y
End Type
Type EM
Field count%
Field s.Part[MAX%]
End Type
c.EM = New EM
m = MilliSecs()
For a = 1 To 1000000
For i = 1 To 10
c\s[i] = New Part
c\s[i]\x = 3
c\s[i]\y = 4
Next
Next
m = MilliSecs() - m
Print "M = " + m
For i = 1 To 10
Print "c\s[" + i + "]\x = " + c\s[i]\x + " c\s[" + i + "]\y = " + c\s[i]\y
Next
WaitKey()
m = MilliSecs()
Update(c)
m = MilliSecs() - m
Print "M = " + m
For i = 1 To 10
Print "c\s[" + i + "]\x = " + c\s[i]\x + " c\s[" + i + "]\y = " + c\s[i]\y
Next
WaitKey()
Delete Each Part
Delete Each EM
End
#define BBDECL extern "C" _declspec(dllexport)
const int MAX = 10;
struct Part {
int x;
int y;
};
struct EM {
int count;
Part c[MAX];
};
BBDECL void _stdcall Update(EM* v)
{
for (int a = 1; a <= 1000000; a++) {
for (int i = 1; i <= 10; i++) {
v->c[i].x = 1;
v->c[i].y = 2;
}
}
}