DLLs in RAD Studio XE vs RAD Studio 2007

We have a simple non-VCL DLL that we have used for a long time in RAD Studio 2007 projects.

We have recreated it (from scratch) as an XE DLL project.  Compiles just fine, creates the DLL and lib as before, but won't link to our XE app.

The only difference between the two is that the 2007 function take a char* arg, and the XE function takes a wchar_t*.

XE gives us an "unresolved external" when trying to link that function.  The DLL lib is clearly in the path. 

We are wondering if XE has changed the DLL process since 2007 ?

Appreciate any help

thanks

Kevin
0
Kevin
12/5/2011 9:04:58 PM
embarcadero.cppbuilder.ide 2180 articles. 1 followers. Follow

3 Replies
1161 Views

Similar Articles

[PageSpeed] 53

Kevin wrote:

> The only difference between the two is that the 2007 function take a
> char* arg, and the XE function takes a wchar_t*.
>
> XE gives us an "unresolved external" when trying to link that
> function.

What does the error message say the symbol actually is?  Which calling convention 
are you using on the exported function?  Is the function wrapped in an "extern 
C" block?

> We are wondering if XE has changed the DLL process since 2007 ?

New data types have been introduced, so it is possible that name mangling 
rules have changed.  That is why it is best to use "extern C" with the __stdcall 
calling convention (if you are not already) to avoid any name mangling issues.

--
Remy Lebeau (TeamB)
0
Remy
12/5/2011 9:36:04 PM
Remy;

Thanks for the tip;

We were using the code created by the IDE in "Add New Project".  It give this in the header:


#ifdef __BUILDING_THE_DLL
#define __EXPORT_TYPE __export
#else
#define __EXPORT_TYPE __import
#endif

bool __EXPORT_TYPE Validate(wchar_t* = NULL);


__BUILDING_THE_DLL was not defined in our XE environment, so the function was declared as __import.

So we just forced the type:

bool __export Validate(wchar_t* = NULL);

And it links correctly now.

Is this sufficient, or should we be more explicit as you indicate?

Thanks again for the tip.

Kevin
0
Kevin
12/5/2011 11:24:35 PM
Kevin wrote:

> We were using the code created by the IDE in "Add New Project". 
> It give this in the header:

That is needed to import/export the function, but that no effect on *how* 
the function is imported/exported.  I suggest the following approach:

MyDll.h:
{code:cpp}
#ifndef MyDllH
#define MyDllH

#ifdef __BUILDING_THE_DLL
#define __EXPORT_TYPE __declspec(dllexport)
#else
#define __EXPORT_TYPE __declspec(dllimport)
#endif

#ifdef __cplusplus
extern "C" {
#endif

__EXPORT_TYPE bool __stdcall Validate(wchar_t* = NULL);

#ifdef __cplusplus
}
#endif

#endif
{code}

> __BUILDING_THE_DLL was not defined in our XE environment, so
> the function was declared as __import.

You are supposed to define it in your DLL's source code before including 
the DLL's header file, eg:

MyDll.cpp:
{code:cpp}
#define __BUILDING_THE_DLL
#include "MyDll.h"

bool __stdcall Validate(wchar_t*)
{
    ...
}
{code}

Note that you will have to recompile your 2007 projects, as this affects 
what the linker looks for.  If that is not an option for this DLL, then at 
least add the "#define __BUILDING_THE_DLL" statement to the DLL source code 
(or add __BUILDING_THE_DLL to the project's Conditionals list in the Project 
Options), if nothing else.

--
Remy Lebeau (TeamB)
0
Remy
12/6/2011 12:01:28 AM
Reply:

Similar Artilces:

How to install RAD Studio XE + RAD Studio 2010 in the same computer?
How to install RAD Studio XE + RAD Studio 2010 in the same computer? -- Regards, Eko Indriyawan www.ekoindri.com Delphi makes me that a something impossible can be realized with possible way Le 21/09/2010, Eko Indriyawan a supposé : > How to install RAD Studio XE + RAD Studio 2010 in the same computer? install D2010 first and DXE next and everything should be fine. - Florent Hi Florent, Thank you very much for your suggestion. Let me try to follow it. -- Regards, Eko Indriyawan www.ekoindri.com Delphi makes me that a something impossible can be ...

Downgrading from RAD studio 2007 Architect to RAD studio 2009 Enterprise/Professional
My Indian reseller has informed me that downgrading (upgrading) from higher (RAD studio 2007 Architect) to lower version (RAD studio 2009 Enterprise/Professional)is not allowed Can some one confirm this, since i remember of seeing a post contrary to this Venkatesh (my name does not show up correctly in the newsgroup) Hi Venkatesh, > My Indian reseller has informed me that downgrading (upgrading) from > higher (RAD studio 2007 Architect) to lower version (RAD studio 2009 > Enterprise/Professional)is not allowed Of course this is allowed. You can upgrade from any ...

RAD Studio XE: the relevant links for RAD Studio, Delphi, C++ Builder, Prism, RadPHP [what's new, features, downloads...]
What's New in Delphi and C++Builder XE http://docwiki.embarcadero.com/RADStudio/en/What's_New_in_Delphi_and_C%2B%2BBuilder_XE RAD Studio, Delphi, C++Builder, Delphi Prism and RadPHP XE are available now! http://blogs.embarcadero.com/davidi/2010/08/30/40114/ audio - Dr. Dobbs's talks with Michael Rozlog about RAD Studio XE Release http://www.drdobbs.com/tv/index.jhtml?bctid=594150880001&bcpid=64699398001 Webinar: What's New in RAD Studio XE - An In-Depth Look with Mike Rozlog (Wed, Sep 1 7PM PDT / Thu, Sep 2 12:00 EST Australian) http://forms.embarcadero.com/f...

Can not install RAD studio 2010 after having RAD studio 2009
I had RAD Studio 2009 installed and unsuccesfully uninstalled it with an error message 2343. I then removed it with Windows cleanup tool and removed all references in registry as well as all files on hard disk including the once in SysWOW64. When trying to install Rad Studio 2010 I still get the message "For RAD Studio 2010 to co-exist with the version you are trying to install ......:". I can not find any trace on my computer of 2009 version so I'm at a dead end. How can I either force the installation or where does the install file look to lead it to belive I have 2009 insta...

RAD Studio 2010 vs. Visual Studio 2010
Well, Visual Studio 2010 is now available, I believe. And the reviews of it have been pretty positive. Though, its price has gone up. So, how does RAD Studio stack up to the latest from MS? On 2010-04-13 22:27:30 +0200, Paul Doland said: > Well, Visual Studio 2010 is now available, I believe. And the reviews > of it have been pretty positive. Though, its price has gone up. So, > how does RAD Studio stack up to the latest from MS? For one thing, next month RAD Studio 2010 will *include* Visual Studio 2010. ;) On Tue, 13 Apr 2010 14:06:44 -0700, marc hoffman <mh@spa...

RAD Studio 2007 IDE intermittent problems...
Here's some intermittent problem encountered using D2007: 1. Navigation through code (shortcut ctrl+click) does not link to proper declaration. That is, it does not perform as functions [alt+down arrow] and [structure toolwindow] to find the right procedure / function definition *(solution from CG: save all source code files in UTF-8 format)* - no results; 2. while object inspector position is on a specific property, another property seems to be modified. That is, modifying a property for a control (using object inspector toolwindow) and then switching to another control (while obj...

Codegear rad studio 2007 ide error
I sometimes get following ide error while I am editing any cpp file. I use Codegear Rad studio 2007 and win XP sp3. "Assertion failed: amount>= dest- startDest, file ek_flbuf.cpp, line 315." After ide displays this error, "Abnormal Program Termination" error is displayed. Is there any solution for this ide-based error. ...

RAD Studio XE IDE crashing ALL the time
We recently upgraded to RAD Studio XE from 2009, and unfortunately, it seems to be *crashing all the time*. By that, I mean every few minutes or so (unless I just sit and watch it). I am not doing anything very complicated, simple VCL Forms Dialog. It's got 3 text fields and a single button. It doesn't even do anything, click the button and is displays some text in the field. It's really just a "Hello World!" program. (Look, the thing is just 43 lines of code, including blank spaces). I could just be typing and it'll just go down on me. I get message saying it'...

BDS 2006 vs RAD Studio 2007
Would appreciate your thoughts about these two questions: 1) Because there have been so many comments about the stability of Delphi 2007 and since I have been using BDS 2006 I started to look at the 2007 version(s) that I have. Looks like I have both Delphi 2007 and RAD Studio 2007. I presume they are different. Am I right in thinking that RAD Studio 2007 is the 2007 version of BDS 2006? I don't remember what I did but I'm able to start BDS 2006 for Win32 or start BDS 2006 which loads all of the personalities. Neither of 2007 versions I have (if in fact they are ...

Conversion C + + Builder 2007 for Rad Studio XE 2
'm Converting our application from C + + Builder 2007 for Rad Studio XE 2. It is the following problem: StdInd.H occurs in the file the message: On the line: typedef __ int8 int8_t; [Bcc32 Error] stdint.h (20): E2141 Declaration syntax error    Full parser context      MPS44700.cpp (2): # include c: \ program files (x86) \ embarcadero \ rad I had this problem in previous conversions. Can anyone help me? thank you Marcio Tomazelli SMARAPD wrote: > StdInd.H occurs in the file the message: > > On the line: type...

Resource Compiler problems for RAD Studio XE IDE [Edit]
I am finally migrating a huge C++ Builder project from RAD Studio 2007 to RAD Studio XE, but have run into problems compiling .RC files that are part of the original project. If manually compiled using BRCC32.EXE from a COMMAND prompt, any of the resource files compiles fine. However, when the IDE generates the command line for BRCC32, it includes a massive (totally unneeded) set of include path information with multiple paths that are *not bracketed in quotes*. Predictably, this results in an error to the extent that the file C:\Files\Embarcadero\RAD.rc could not be found. The simpl...

Rad Studio 2007 IDE slowdown... anybody else experiencing this?
Hello, I'm experiencing this with Rad Studio 2007. When opening two Win32 instances(not sure about .NET side though) the IDE slows down to sluggishness more often than not and it's weird. Compiling, Intellisense, almost everything becomes unusable. However, even if I close one instance only it keeps being slowed down to a point that I can go smoking outside before it recovers and actually *does* what I had instructed it to do(be it show intellisense, compile or whatever). Anybody is experiencing this as well? Andrew ...

Special care for Installing Delphi XE and keeping RAD Studio 2007
Hi to all, I have a RAD Studio 2007 version that is in production, and I need to install Delphi XE in the same machine but I don't want my 2007 projects to be affected with this. I'm planning to migrate all projects to XE but it is going to take a while. For doing this is there any special care to take? Any tips about this will be appreciated. Nando. > {quote:title=Hernando Duque wrote:}{quote} > Hi to all, > > I have a RAD Studio 2007 version that is in production, and I need to install Delphi XE in the same machine but I don't want my 2007 projects t...

Dixie and R-Sexy? Delphi XE and RAD Studio XE
I'm used to saying acronyms such as D2010 as "Dee two thousand and 10" and D7 as "Dee seven". How about the following XE shortcut names: Delphi XE: DXE: *Dixie* RAD Studio XE: RSXE: *R-Sexy* Delphi Prism XE: *D-Pixie* Tough ones: RadPHP XE: ???? C++Builder XE: ???? Regards, Jarrod Hollingworth Complete Time Tracking http://www.complete-time-tracking.com/ > RAD Studio XE: RSXE: *R-Sexy* To ensure it is removed by content filtering tools? > {quote:title=Luigi Sandon wrote:}{quote} > > RAD Studio XE: RSXE: *R-Sexy* > > ...

Web resources about - DLLs in RAD Studio XE vs RAD Studio 2007 - embarcadero.cppbuilder.ide

Marketers Studio - David Berkowitz's Marketing Blog
Interactive marketing insight and trends from strategist, columnist, speaker, and marketer David Berkowitz

Abbey Road Studios - Wikipedia, the free encyclopedia
It was established in November 1931 by the Gramophone Company , a predecessor of British music company EMI , its present owner. It is most notable ...

Social Media Jobs: Adaptive Studios, Heleo, American Thoracic Society
This week, Adaptive Studios is hiring a social media community manager , while Heleo needs a social media manager . American Thoracic Society ...

Dilly Dally release studio version of Drake cover
by Andrew Sacher photo: Dilly Dally at Baby's All Right in 2015 (more by Amanda Hatfield) As you probably know if you've seen them live lately, ...

'The 40-Year-Old Virgin' was almost shut down after one week of shooting because the studio thought Steve ...
... While on "Conan" Tuesday night, Carell described the moment that nearly derailed the 2005 film completely. According to the actor, the studio ...

Former Viacom Exec Van Toffler Launches Studio With High Powered Help
Former Viacom Media Networks CEO Van Toffler characteristically offers a bold forecast and colorful description of the studio he just founded ...

Ex-Tarantino producer joins Activision Blizzard movie studio
Seeking new money-making avenues, Activision Blizzard announced it would start its own "film and television studio devoted to creating original ...

Amazon Studios' next original movie comes out later this year
Amazon is ready to make another feature film. Paterson is written by Jim Jarmusch and will star Adam Driver in the title role. Following Spike ...

Hollywood's Most Profitable Studios
Hollywood's Most Profitable Studios

Any Movie Studio Can Make Its Own Star Wars Movie Right Now
... is once again reigning supreme over pop culture. Disney paid $4 billion for the contents of George Lucas’ toybox. But really, any movie studio ...

Resources last updated: 1/16/2016 11:14:20 AM