Delphi XE2 DLL can't be used in C# application [Edit]

For testing I am trying to call a Delphi XE2 DLL (see code) in a C# application (developed in Visual C# 2010 Express).

procedure CLP; stdcall; export;
begin
  showmessage('TEST');
end;

exports CLP;

However when trying to add the DLL as reference to a C# project the following message appears:
"A reference to 'D:\temp\test.dll' could not be added. Please make sure that the file is accessible, and that is a valid assembly or COM component."

When the same DLL is compiled under Delphi 2010 it works without any problem. 

Any suggestions how to solve the problem are appreciated.

Edited by: Mike B. on Apr 10, 2012 2:13 PM
0
Mike
4/10/2012 12:13:44 PM
embarcadero.delphi.nativeapi 1236 articles. 1 followers. Follow

1 Replies
1806 Views

Similar Articles

[PageSpeed] 50
Get it on Google Play
Get it on Apple App Store

My mistake.

Had to use DLLImport.

Edited by: Mike B. on Apr 11, 2012 8:34 AM
0
Mike
4/11/2012 6:34:13 AM
Reply:

Similar Artilces:

Delphi 6 to Delphi XE2: can't find required package.
We have a Delphi 6 Project Group that we like to work on in Delphi XE2. When trying to build the project, we get the DCC Fatal Error E2202: Required package 'cds' not found. With Delphi 6 we've used the following tools: - JVCL340 & JCL221 - devExpress QuantumGrid 6 - QuickReport (default in Delphi 6) - Visoco Sybase Driver, Devart Oracle en MSSQL drivers With Delphi XE2 (update 3 installed) we're using the following tools and settings for now (after removing Delphi 6 in an attempt to make it work) : - JVCL345 & JCL231 (http://jvcl.delphi-jedi.org/) - devExpr...

can't load any 64 bit C++ Builder dll from Delphi, XE3
Hi, We can't load any 64 bit dll from our 64 bit app. We have removed all user dll references from the app, without the dll the app successfully starts in 64 bit. The app works in 32 bit mode with many 32 bit user dll-s. We have made a small dll and a small app both in 64 bit. This works. But when we trying to load this small dll in the big app (the big app is ~700,000 line). The debugger reports the following messages and the Event Log stays at loading this small dll. //// [203948A4]{dbkdebugide170.bpl} Debug.TDebugKernel.msgBox (Line 5927, "Debug.pas" + 30) + $0 ...

Delphi XE2/XE3 Can't connect a TSQLConnection from secondary threads [Edit]
I'm porting code from D2009 to Delphi XE3 (just verified the same applies to XE2). In XE3, I just found out that if I create a TSQLConnection and connect to a MSSQL database from a thread that is not the main thread, it will give me the infamous "DBX Error: Driver could not be properly initialized. Client library may be missing, not installed properly, of the wrong version, or the driver may be missing from the system path." message. If I run exactly the same code from the main thread, all is fine. This is a sample code, in this case with just a button on a form, nothing fanc...

Delphi XE2/XE3 Can't connect a TSQLConnection from secondary threads [Edit]
This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. --JivePart=_78da1.zeB8CwDOH5aMJzMl Content-Type: text/plain; charset="Utf-8" I'm porting code from D2009 to XE3 (just verified the same applies to XE2). In XE3, I just found out that if I create a TSQLConnection and connect to a MSSQL database from a thread that is not the main thread, it will give me the infamous "DBX Error: Driver could not be properly initialized. Client library may be missing, not installed properly, of the wrong...

can't load any 64 bit C++ Builder dll from Delphi, XE3
This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. --JivePart=_80a66.zeB8CwDOH5aMJzMl Content-Type: text/plain; charset="Utf-8" can't load any 64 bit C++ Builder dll from Delphi, XE3 - Attachment --JivePart=_80a66.zeB8CwDOH5aMJzMl Content-Type: application/octet-stream; name="dlltest.zip" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="dlltest.zip" UEsDBBQAAgAAAJylNkIAAAAAAAAAAAAAAAAIAAAAZGxsdGVzdC9QSwMEFAACAAgAlD0uQoq2CiN+ A...

Can't use RAD Studio XE2 (C++) and SQL Server Express 2012 [Edit]
I have been using SQL Server Express 2005 and RAD Studio 2009 with no problems in a 32bit version of Windows 7 I have upgraded to RAD Studio XE2 and SQL Server Express 2005 and 64bit Windows 8 and get the following error... "DBX Error: Driver could not be properly initialized. Client library may be missing, not installed properly, or the wrong version, or the driver may be missing from the system path" dbxconnections.ini is in C:\Users\Public\Documents\RAD Studio\9.0\Bpl (which is in the path) dbxdrivers.ini is in the same directory and lists sqlncli11.dll as the VendorLib,...

Can't use RAD Studio XE2 (C++) and SQL Server Express 2012 [Edit]
I have been using SQL Server Express 2005 and RAD Studio 2009 with no problems. I have upgraded to RAD Studio XE2 and SQL Server Express 2005 and get the following error... "DBX Error: Driver could not be properly initialized. Client library may be missing, not installed properly, or the wrong version, or the driver may be missing from the system path" dbxconnections.ini is in C:\Users\Public\Documents\RAD Studio\9.0\Bpl (which is in the path) dbxdrivers.ini is in the same directory and lists sqlncli11.dll as the VendorLib, which is in C:\Windows\System32. Any ideas? ...

Using 'SetConsoleCtrlHandler' to correctly Terminate application (Delphi XE2)
Hello everyone, I'm using 'SetConsoleCtrlHandler' to correctly Terminate my console application (at least I'm trying to). So far it seems to work when the user presses Ctrl+C / Ctrl+Break. However, when the user presses the top-right cross (to close the Window), I receive the message/callback, but the working proces/thread isn't shutdown in an correct matter. The help for 'SetConsoleCtrlHandler' (MSDN) states, the callback event might be called from a different thread, then the actual (console)process is running. So how do a wake up/sync with the...

Using 'SetConsoleCtrlHandler' to correctly Terminate application (Delphi XE2)
Hello everyone, I'm using 'SetConsoleCtrlHandler' to correctly Terminate my console application (at least I'm trying to). So far it seems to work when the user presses Ctrl+C / Ctrl+Break. However, when the user presses the top-right cross (to close the Window), I receive the message/callback, but the working proces/thread isn't shutdown in an correct matter. The help for 'SetConsoleCtrlHandler' (MSDN) states, the callback event might be called from a different thread, then the actual (console)process is running. So how do a wake up/sync wit...

Using 'SetConsoleCtrlHandler' to correctly Terminate application (Delphi XE2)
Hello everyone, I'm using 'SetConsoleCtrlHandler' to correctly Terminate my console application (at least I'm trying to). So far it seems to work when the user presses Ctrl+C / Ctrl+Break. However, when the user presses the top-right cross (to close the Window), I receive the message/callback, but the working proces/thread isn't shutdown in an correct matter. The help for 'SetConsoleCtrlHandler' (MSDN) states, the callback event might be called from a different thread, then the actual (console)process is running. So how do a wake up/sync with the...

Starting 2 TThread 's directly after each other doesn't work in delphi xe2 [Edit]
(SOLVED: iLog was not thread safe.) ----- Hello, I have a very simple thread: (note: iLog just logs output -- threadsafe; not included here.) {code} unit mySimpleThread; interface uses System.Classes, System.SysUtils, System.Types, System.UITypes, System.Variants; type TmySimpleThread = class(TThread) public constructor Create(); destructor Destroy; override; private procedure Execute; override; end; implementation constructor TmySimpleThread.Create(); begin inherited Create(True); iLog('TmySimpleThread created'); end...

Delphi (2007 ...XE2) WSDL importer can't "unwrap" WSDL's from Remobjects
Hello all, I'm having a lot of problems importing WSDL's from SOAP services created by Remobjects SDK. The Delphi WSDL importer can't "unwrap" the parameter types, I get errors like: "Cannot unwrap: - Input element wrapper name does not match operation's name - More than one strictly out element was found" RemObject's own service builder can unwrap the parameters, only Delphi's importer can't. I attach an example here, can anyone tell me what's wrong with it? Kind regards, Arthur -------------------------------------...

Delphi 2010 can't upgrade Delphi 2007 projects
If I open any of my Delphi 2007 projects in Delphi 2010 it prompts me that it will upgrade it. Unfortunately, that leaves Delphi 2010 to give errors about not knowing where to find system and other core units. On the other hand, if I delete all the BDS project files and only leave the .dpr, Delphi 2010 can successfully open and compile my project. However, besides that quirk, I have another problem. I need to have both a working Delphi 2007 project and Delphi 2010, so I can compile using both without being prompted each and every time about upgrading project :) So... Any ideas to what m...

Can't terminate an application in the 'except' portion of a 'try..except' [Edit]
I'm a long time Delphi 5 user, recently switched to Delphi XE... and I'm having trouble getting a program to terminate if an exception is raised. Here's the code: procedure TForm1.FormCreate(Sender: TObject); begin try DFCom.Open except showmessage('Invalid Com Port number'); application.Terminate; end; end; In this code, 'DFCom' is an async serial port device. If the exceptino occurs, I want to notify the user via the 'showmessage' mechanism, and then abort the program. When I run this (with an invalid port number assigned to...

Web resources about - Delphi XE2 DLL can't be used in C# application [Edit] - embarcadero.delphi.nativeapi

Application - Wikipedia, the free encyclopedia
Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...

Second visa application 'likely' to be approved
The family of a terminally ill Pakistani student can 'hopefully come to Australia sooner rather than later' says Immigration Minister Peter Dutton. ...

Tashfeen Malik's visa application under scrutiny - Business Insider Deutschland
The US government has released the visa application for Tashfeen Malik, who along with her husband killed 14 people in an attack in San Bernardino, ...

Panasonic Develops a Stretchable Resin Film and Its Application Materials for Stretchable Electronics ...
A stretchable film is developed. This film stretches to 2.5 times the original length and then returns to the original form. A conductive paste ...

MBA: Mortgage Applications Increase in Latest MBA Weekly Survey, Purchase Applications up 37% YoY
From the MBA: Refinance, Purchase Applications Both Up in Latest MBA Weekly Survey Mortgage applications increased 7.3 percent from one week ...

Cal State Schools Get Record Number Of Applications For 2016 Term
Schools in the California State University system received a record number of applications for the upcoming 2016 fall term, with more than 830,000 ...

German-Based Spirea Promotes Decentralized PV Applications In Uruguay
... Its technical operations specialist, Laurie Lawrence, pointed out that Uruguay [&hellip German-Based Spirea Promotes Decentralized PV Applications ...

Visa application of San Bernardino shooter released
CNN Visa application of San Bernardino shooter released CNN (CNN) The visa application of one of the San Bernardino shooters was released ...

Panasonic touch panel production to be solely for vehicle applications by 2020, says report
Panasonic is aiming to transfer its touch panel production completely to vehicle applications by 2020 in order to meet increasing demand for ...

Pre-K Applications Begin Jan 25, a Month Earlier Than Last Year, City Says
The DOE has moved the process up to Jan. 25 on the heels of a similar schedule shift for kindergarten. MANHATTAN — The application period for ...

Resources last updated: 12/31/2015 9:16:55 PM