Advanced Delphi

Moderators: None (Apply to moderate this forum)
Number of threads: 333
Number of posts: 743

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
A dll from visual c Posted by delphilord on 16 Oct 2002 at 9:22 AM
Hi,
I have a dll writen in visual c.
Its function parameters are structs (records)
I made equal records in delphi by changing this way
C
struct{
int a
double b
unsignd char c
}
to
delphi
record=
a:smallint;
b:double;
c:byte
end;
The size are same
But I think sending parameter in pascal are c are different.And i have not source of dll to add PASCAL keyword for function
Reversing parameter order will solve my problem or not?
Report
Re: A dll from visual c Posted by zibadian on 23 Nov 2002 at 12:59 PM
: Hi,
: I have a dll writen in visual c.
: Its function parameters are structs (records)
: I made equal records in delphi by changing this way
: C
: struct{
: int a
: double b
: unsignd char c
: }
: to
: delphi
: record=
: a:smallint;
: b:double;
: c:byte
: end;
: The size are same
: But I think sending parameter in pascal are c are different.And i have not source of dll to add PASCAL keyword for function
: Reversing parameter order will solve my problem or not?
:
I don't think that for a record it matters much, because the record type declaration specifies the order in which the fields are listed in the memory. I suggest you just try to call the exported procedure from a small test project and see if the results are, what you expect them to be. In case of an error, try the reverse order.
Report
Re: A dll from visual c Posted by bloodyangel on 24 Jan 2003 at 3:27 AM
: Hi,
: I have a dll writen in visual c.
: Its function parameters are structs (records)
: I made equal records in delphi by changing this way
: C
: struct{
: int a
: double b
: unsignd char c
: }
: to
: delphi
: record=
: a:smallint;
: b:double;
: c:byte
: end;
: The size are same
: But I think sending parameter in pascal are c are different.And i have not source of dll to add PASCAL keyword for function
: Reversing parameter order will solve my problem or not?
:


Hi, You can try to add "stdcall" or "cdecl" keywords to function decleration in delph. For example :

procedure SomeFunction (a, b : somerecord) ; stdcall (or cdecl);


Report
Re: A dll from visual c Posted by delphilord on 24 Jan 2003 at 11:12 AM
: : Hi,
: : I have a dll writen in visual c.
: : Its function parameters are structs (records)
: : I made equal records in delphi by changing this way
: : C
: : struct{
: : int a
: : double b
: : unsignd char c
: : }
: : to
: : delphi
: : record=
: : a:smallint;
: : b:double;
: : c:byte
: : end;
: : The size are same
: : But I think sending parameter in pascal are c are different.And i have not source of dll to add PASCAL keyword for function
: : Reversing parameter order will solve my problem or not?
: :
:
:
: Hi, You can try to add "stdcall" or "cdecl" keywords to function decleration in delph. For example :
:
: procedure SomeFunction (a, b : somerecord) ; stdcall (or cdecl);
:
:
:
Thanks i will try




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.