473,387 Members | 1,606 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Problem with DLL created in Delphi

Dan
Hi all,

I have a DLL built in Delphi 7 that has a few functions for extracting data
from some b-tree database tables. Everything works great when called by a
test app written in Delphi, yet when the same functions are called from a C#
production application, a couple of the extracts are returning no data, or
fewer records than I receive when called by the test application.

Any ideas why this would be the case? I can't debug the DLL from Visual
Studio that I'm aware of, so it's essentially a "black box" as far as VS is
concerned, but when testing and debugging from Delphi, everything works
perfectly.

I'm stumped.

TIA,
Dan
Mar 7 '07 #1
3 1382
check the calling conventions in the Delphi dll make sure they are stdcall
and that should fix it.
"Dan" <pr*******@yahoo.comwrote in message
news:L5******************************@comcast.com. ..
Hi all,

I have a DLL built in Delphi 7 that has a few functions for extracting
data from some b-tree database tables. Everything works great when called
by a test app written in Delphi, yet when the same functions are called
from a C# production application, a couple of the extracts are returning
no data, or fewer records than I receive when called by the test
application.

Any ideas why this would be the case? I can't debug the DLL from Visual
Studio that I'm aware of, so it's essentially a "black box" as far as VS
is concerned, but when testing and debugging from Delphi, everything works
perfectly.

I'm stumped.

TIA,
Dan

Mar 7 '07 #2
Dan
Thanks Mark, but that doesn't appear to be the problem as all functions are
indeed defined as stdcall.

"Mark Anthony Gohara" <mg*****@partssource.com.comwrote in message
news:uu**************@TK2MSFTNGP06.phx.gbl...
check the calling conventions in the Delphi dll make sure they are stdcall
and that should fix it.
"Dan" <pr*******@yahoo.comwrote in message
news:L5******************************@comcast.com. ..
>Hi all,

I have a DLL built in Delphi 7 that has a few functions for extracting
data from some b-tree database tables. Everything works great when
called by a test app written in Delphi, yet when the same functions are
called from a C# production application, a couple of the extracts are
returning no data, or fewer records than I receive when called by the
test application.

Any ideas why this would be the case? I can't debug the DLL from Visual
Studio that I'm aware of, so it's essentially a "black box" as far as VS
is concerned, but when testing and debugging from Delphi, everything
works perfectly.

I'm stumped.

TIA,
Dan


Mar 7 '07 #3
You could convert the dll into a COM object and try it that way. Also have
you set the C# application to use unsafe code. Actually the assembly calling
the dll to use unsafe code.
"Dan" <pr*******@yahoo.comwrote in message
news:O-******************************@comcast.com...
Thanks Mark, but that doesn't appear to be the problem as all functions
are indeed defined as stdcall.

"Mark Anthony Gohara" <mg*****@partssource.com.comwrote in message
news:uu**************@TK2MSFTNGP06.phx.gbl...
>check the calling conventions in the Delphi dll make sure they are
stdcall and that should fix it.
"Dan" <pr*******@yahoo.comwrote in message
news:L5******************************@comcast.com ...
>>Hi all,

I have a DLL built in Delphi 7 that has a few functions for extracting
data from some b-tree database tables. Everything works great when
called by a test app written in Delphi, yet when the same functions are
called from a C# production application, a couple of the extracts are
returning no data, or fewer records than I receive when called by the
test application.

Any ideas why this would be the case? I can't debug the DLL from Visual
Studio that I'm aware of, so it's essentially a "black box" as far as VS
is concerned, but when testing and debugging from Delphi, everything
works perfectly.

I'm stumped.

TIA,
Dan



Mar 8 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

102
by: Skybuck Flying | last post by:
Sometime ago on the comp.lang.c, I saw a teacher's post asking why C compilers produce so many error messages as soon as a closing bracket is missing. The response was simply because the compiler...
1
by: Piotr Nabielec | last post by:
Hi, I have very big problem with importing delphi dll into C# project... I got a Velleman K8000 card with k8d.dll that makes all communication for me. Now I'm trying to import it into C#, but I...
22
by: glenn | last post by:
I have a COM Server that I've written based on information from the book ..NET and COM / the complete Interop Guide. I have gotten the project to compile and I've located the regasm.exe program...
2
by: Praveen K | last post by:
I have a problem in communicating between the C# and the Excel Interop objects. The problem is something as described below. I use Microsoft Office-XP PIA dll’s as these dll’s were been...
1
by: David Lozzi | last post by:
I'm creating new records in my aspx file, but after its created, I need the ID of the new record. The ID field is the primary key and increments automatically. Should this be completed in a proc?...
14
by: Christian Kaiser | last post by:
We have a component that has no window. Well, no window in managed code - it uses a DLL which itself uses a window, and this is our problem! When the garbage collector runs and removes our...
4
by: Jak | last post by:
I made a dll file,Delphi.dll, with Delphi7, the sourcecode is: library Delphi; uses SysUtils, Classes; {$R *.res} function GetStr(s:ShortString ):ShortString ;stdcall; begin result:= s;
3
by: t0x3e8 | last post by:
Hello I load an external library written in Delphi (I don't have any source code of this lib). I do it in this way: public static extern bool userExist(string userName, string password); ...
7
by: Ryanivanka | last post by:
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.