Board index » Visual Studio » problem using delphi dll in vc++

problem using delphi dll in vc++

Visual Studio51
hi,

I am using a delphi DLL in vc++,static linked with ".h"and "lib".

the export functions in DLL are "__stdcall",but the function doesn't

work well,it often returns some weird values.

when I add codes as follows,it suddenly works well. why??



DWORD returnAdd;

__asm

{

mov ecx,[ebp+4]

mov returnAdd, ecx

}



I am confused,if there is something wrong with stack,I have already

using "__stdcall",why it is still wrong?

I don't even know what those asm code do,I just add them to get some

status about stack.what else they do to the program that I don't know?



thank you .

Ryan


-
 

Re:problem using delphi dll in vc++

That asm code is not solution for your problem.



I think that the problem still exist.



To figure out problem exactly, first thing what you do is describe fault of

program and what is the real problem.







--

WebSite :

Realization of Dream { imagine your dream} - rodream.net">rodream.net



WebMail :

rodream@naver.com





"Ryanivanka" wrote:



Quote
hi,

I am using a delphi DLL in vc++,static linked with ".h"and "lib".

the export functions in DLL are "__stdcall",but the function doesn't

work well,it often returns some weird values.

when I add codes as follows,it suddenly works well. why??



DWORD returnAdd;

__asm

{

mov ecx,[ebp+4]

mov returnAdd, ecx

}



I am confused,if there is something wrong with stack,I have already

using "__stdcall",why it is still wrong?

I don't even know what those asm code do,I just add them to get some

status about stack.what else they do to the program that I don't know?



thank you .

Ryan



-