dll fails when compiled with delphi 2010, but works with delphi 7

I may be doing good if someone can just point me to the right forum

I have not created a dll for some time and have not written one with 2010 before.  The dll I am creating will be called as a cfx function by either a ColdFusion or BlueDragon webserver.  I have written cfx DLLs in the past.

The function declaration is below, it is the standard declaration from ColdFusion or Bluegradon documention on creating a CFX.
procedure ProcessTagRequest(Request: TCFXRequest); export; cdecl;

Since this was the first time using 2010 I wrote a very basic function to build off that was not much more than "hello world".  It compiled without any problems, it registered with BlueDragon without problems.  It did not function, it did not cause any errors but it could not pass information back to BlueDragon, a pChar that contained multiple characters only passed back the first character.  Seems like a memory problem to me.

This is on a windows 7 computer.
After trying several things I started an old xp computer created a new dll with delphi 7, pasted the 2010 code directly into the new delphi 7 project (same name) and compiled.  No problem, registered the dll with ColdFusion.  The cfx functioned perfectly.  

Thinking it could be a problem with windows 7 or bluedragon I copied the delphi 7 dll to the windows 7 computer.  The delphi 7 dll also functioned perfectly on windows 7 and BlueDragon.

So the exact same code (straight copy paste) works when compiled with Delphi 7 regardless of operating system or webserver, but fails if compiled with 2010.

The 2010 dll id about 3 times larger than the delphi 7 dll.  293kb vs 89kb.

I know if someone hasn't created a cfx function this is rather vague.

Any ideas? maybe compiler directives?

Thanks
Bill Hannan
0
Bill
3/8/2012 12:35:43 AM
embarcadero.delphi.general 4258 articles. 0 followers. Follow

2 Replies
1527 Views

Similar Articles

[PageSpeed] 18

Bill Hannan wrote:
> I may be doing good if someone can just point me to the right forum
> 
> I have not created a dll for some time and have not written one with 2010 before.  The dll I am creating will be called as a cfx function by either a ColdFusion or BlueDragon webserver.  I have written cfx DLLs in the past.
> 
> The function declaration is below, it is the standard declaration from ColdFusion or Bluegradon documention on creating a CFX.
> procedure ProcessTagRequest(Request: TCFXRequest); export; cdecl;
> 
> Since this was the first time using 2010 I wrote a very basic function to build off that was not much more than "hello world".  It compiled without any problems, it registered with BlueDragon without problems.  It did not function, it did not cause any errors but it could not pass information back to BlueDragon, a pChar that contained multiple characters only passed back the first character.  Seems like a memory problem to me.
> 
> This is on a windows 7 computer.
> After trying several things I started an old xp computer created a new dll with delphi 7, pasted the 2010 code directly into the new delphi 7 project (same name) and compiled.  No problem, registered the dll with ColdFusion.  The cfx functioned perfectly.  
> 
> Thinking it could be a problem with windows 7 or bluedragon I copied the delphi 7 dll to the windows 7 computer.  The delphi 7 dll also functioned perfectly on windows 7 and BlueDragon.
> 
> So the exact same code (straight copy paste) works when compiled with Delphi 7 regardless of operating system or webserver, but fails if compiled with 2010.
> 
> The 2010 dll id about 3 times larger than the delphi 7 dll.  293kb vs 89kb.
> 
> I know if someone hasn't created a cfx function this is rather vague.
> 
> Any ideas? maybe compiler directives?
> 
> Thanks
> Bill Hannan

If it is working in D7 but not in D2010 then more than likely you need to go in 
and make hte string and PChar's to PAnsiChar and AnsiString to remain 
compatible.  Sounds like ColdFusion or BlueDragon is expecting ansi data to be 
passed back and forth and in D2010 Char, String etc are all Unicode data. 
Change the structures those two are expecting to match the data type they are 
expecting.

-- 
Jeff Overcash (TeamB)
       (Please do not email me directly unless  asked. Thank You)
And so I patrol in the valley of the shadow of the tricolor
I must fear evil. For I am but mortal and mortals can only die.
Asking questions, pleading answers from the nameless
faceless watchers that stalk the carpeted  corridors of Whitehall.
              (Fish)
0
Jeff
3/8/2012 1:46:01 AM
> 
> If it is working in D7 but not in D2010 then more than likely you need to go in 
> and make hte string and PChar's to PAnsiChar and AnsiString to remain 
> compatible.  Sounds like ColdFusion or BlueDragon is expecting ansi data to be 
> passed back and forth and in D2010 Char, String etc are all Unicode data. 
> Change the structures those two are expecting to match the data type they are 
> expecting.
> 
> -- 
> Jeff Overcash (TeamB)
>        (Please do not email me directly unless  asked. Thank You)
> And so I patrol in the valley of the shadow of the tricolor
> I must fear evil. For I am but mortal and mortals can only die.
> Asking questions, pleading answers from the nameless
> faceless watchers that stalk the carpeted  corridors of Whitehall.
>               (Fish)
Jeff,

That was it.

I had to make the change in cfxapid.pas credits below, a quick search and replace all, was all that was needed.
{=========================================================}
{  Cold Fusion extensions classes for Delphi (CFX_D)      }
{                                                         }
{  by Leonid Fofanov lfofanov@hotmail.com                 }
{ ========================================================}
cfxapid.pas  is available on Adobe's website (ColdFusion is an Adobe product)

Thanks
Bill Hannan
0
Bill
3/8/2012 2:53:37 AM
Reply:

Similar Artilces:

Code works in Delphi 7 but not in Delphi 2010 [Edit]
hello, i have a procedure that open's a file by passing the file name as the parameter to the executable. something like this {code} C : \ P r o g r a m F i l e s \ Da c k e r \ D r a c k e r . e x e " G : \ D E l p h i 7 \ D e l p h i 7 A p p _ l o g . t " {code} The source code is {code} procedure OpenFileWithExe var hReg: HKEY; Ret: Longint; RegDataType, RegDataSize: DWORD; CmdLine: array [0..560] of Char; Len: Integer; SInfo: TStartupInfo; PInfo: TProcessInformation; begin Ret := windows.RegOpenKeyEx(HKEY_CURRENT_USER, ...

Debugging DLL compiled with Delphi 7 in Delphi XE5
Dear Sirs/Madams, We are considering changing from Delphi 7 to Delphi XE5. Our project consists of a dll and an .exe file. I have begun converting the .exe file to Delphi XE5 and have successfully accessed the DLL compiled with Delphi 7. When I debug the DLL (using the "run parameters" and changing "host application" to the .exe file) in Delphi 7 I can set breakpoints etc. and they are triggered. However, when I attempt to debug the project in XE5, I get the following message: Module Load: xxx.dll. No Debug Info. Base Address: $015A0000. Process xxx.exe (2928) ...

dynamical DLL loading in delphi 7 & delphi 2010
Hello, i am loading a DLL dynamical in Delphi 7 and Delphi 2010: [delphi] var hDLL: THandle; pCode: Pointer; type TProcMainEntry = function: TForm; begin hDll := 0; if FileExists(Pfad + vpeDllName) then hDLL := LoadLibrary(PChar(Pfad + vpeDllName)) else SetLastError(2); if hDLL = 0 then RaiseLastOSError; pCode := GetProcAddress(hDLL, PChar(vpeFunction)); if pCode = nil then RaiseLastOSError; Result := TProcMainEntry(pcode)(); [/delphi] in delphi 7 there's a variable filled with data of the main application which used in the...

Delphi 7 versus Delphi 2010 compiler directive {$Q-}
Hi, Could it be correct that there's a bug in Delphi7 where the compiler directive {$Q-} and {$Q+} works completely the opposite? When trying to build an existing Delhi 7 project in Delphi 2010 i found this weird behaviour. In D7 {$Q-} set overflow cheking on and in Delphi 2010 off ????? Regards, Arno Brinkman ABVisie -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Firebird open source database with many powerful SQL features: http://www.firebirdsql.org http://www.firebirdsql.info General database developer support: http://www.databasedevelopmentforum.com Support list for ...

Using Delphi 7 and Delphi 2010
I had a project in Delphi 7. I worked on it in Delphi 2010. When I try to open the .dpr again in Delphi 7, the IDE toolbar widens across both monitors, and Delphi 7 locks up. It appears that Delphi 2010 modifies the .dpr in a way that makes Delphi 7 unable to open it again. All my forms & units appear to open fine in D7 after D2010, except for the warnings on the ExplicitHeight and ExplicitWidth properties being missing... I can easily recreate the .dpr, but is this expected behavior? Thanks. Tom Field wrote: > I had a project in Delphi 7. > > I worked o...

Migrating From Delphi 7 to Delphi 2010
We did not know which forum was the best for this question. We have been wanting to migrate from Delphi 7 to a later version for years but it appears to be a daunting task. We first looked at D2006 and that was a radical new world. We bought D2010 a couple of years ago and not done much with it because there are so many parts to our applications. We have done a few new applications in D2010 and they seem to work okay. D2010 has not been impressive, perhaps because of the strangeness compared to D7. Is is possible for us to do a phased sort of migration where we do a form at a time? ...

Calling Delphi 6 DLL from Delphi 2010
We have a Delphi 6 dll that has a PChar passed to it. The dll function then does a search and returns a PCHar. This works good using Delphi 6 to call and recieve the dll result. We have upgraded our calling program to Delphi 2010 and most of the time, the value is passed back just fine. However, we do have times when we get an access violation, when calling the dll. The dll does process the request. Below is the code. Has anyone had a similar issue using an older version Delphi Dll with Delphi 2010? I am sure that Unicode has something to do with it, but not sure how to fix th...

Delphi 7 to Delphi 2010
We have decided to move up some applications running under Delphi 7 to Delphi 2010. However, I was surprise to see that simply recompiling the application causes the application to be much slower than version 7. We have a lot of string transformation routines, some mathematical transformations, etc. When I mean slower, I mean up to two times slower than with Delphi 7, so it not a minor difference. (The EXE is also a lot bigger but I don't worry too much about that). Is there something I can do to obtain the same kind of speed I had in Delphi 7 but with Delphi 2010? ...

Why does this work fine in Delphi 2009, but not in Delphi 2010
I've been racking my head trying to figure this out and can't understand what is wrong, TFileStream.ReadComponentRes fails when I try to read a component containing a record, it works fine in Delphi 2009 and Delphi 2007, but fails with Delphi 2010 Here is the unit source and DFM *+//UnitSource+* unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TThresholdMode = (tm0,tm1,tm2,tm3,tm4,tm5); TThreshold = Record Mode:TThresholdMode; Filter,Start,Stop:Integer; end; ...

Pchar for PansiChar
hello, I use a DLL developed in D7 and not have the same sources. I will use Delphi 2010 and the functions do not work function TkmInitialize(LOGXMLDIR: PChar; TkmByExt: dWord): dWord; stdcall; external 'trackbuffer.dll'; function TkmCreateStream(FileName: PChar; Var Stream: dWord; Var Error: dWord): PChar; stdcall; external 'trackbuffer.dll'; function TkmLogEnd(Stream: dWord; MediaDuration, MediaPosition, MediaType: dWord; MediaName: PChar): dWord; stdcall; external 'trackbuffer.dll'; function TkmIsTkm(FileName: PChar): Bool; stdcall; external 'trackbuffer.dl...

Is dll developed in Delphi 6 works on Delphi 2?
I have a one dll, whose work is to creates a form with some normal vcl controls, print selected tables and email some reports. It was developed in Delphi 6. Can any other application which was developed in Delphi 2 use that dll.? If not, please let me know in which areas i need change. The dll work is only to print and email. With regards, Srikanth Varma Srikanth varma wrote: > I have a one dll, whose work is to creates a form with some normal > vcl controls, print selected tables and email some reports. It was > developed in Delphi 6. Can any other application which was d...

Delphi XE / Delphi 2010
Hello! I noticed that Embarcadero® Delphi® 2010 Version is not on the list of products on Embarcadero page. Or is it still possible to buy it? Will RAD Studio XE compile programs written in Delphi 2010 without problems.? Thanks. Am 13.09.2010 09:04, schrieb Petra Nemec: > Will RAD Studio XE compile programs written in Delphi 2010 without problems.? As always you will probably have to recreate the projects as the import is still a bit -- special. Christian Hello! Does anybody know if it is still possible to get a Delphi2010 trial version (if yes where)? ...

Delphi 7 to Delphi XE
Have been using Delphi 7 for many moons ( have got later versions but never upgraded to ) My first problem is: Component Palette. in XE it is a small toolbar docked in top right in Delphi 7 it gives a large view of all the components. I am struggling to be able to cope/access my components.in Delphi XE. Can I make the component pallette tool bar the same size as Delphi 7, or is there a fast way to view/choose all available components in XE, that I have not spotted yet? Kind Regards, Robert. Hi, What I know is that in Delphi 2010 and XE you can choose between t...

Delphi 2007 to Delphi 7
I've written a class in Delphi 2007 that is not supported in Delphi 7. What would be the best way to achive what I've done in Delphi 2007 in Delphi 7? Thanks, Tom type BondConstants = class { Bond Types } type BondType = record const TREASURY = 3; AGENCY = 0; CORP = 1; MUNI = 2; SBA = 5; MBS = 4; CMO = 6; end; { Day Count Methods } type DayCount = record const ACTUAL_360 = 2; ACTUAL_365 = 1; ACTUAL_ACTUAL = 1; d30_360 = 0; ...

Web resources about - dll fails when compiled with delphi 2010, but works with delphi 7 - embarcadero.delphi.general

Illinois Compiled Statutes - Wikipedia, the free encyclopedia
Decker, John F.; Kopacz, Christopher (2012). Illinois Criminal Law: A Survey of Crimes and Defenses (5th ed.). LexisNexis . § 1.01. ISBN 978-0-7698-5284-3 ...

compiled st - kilda to rosstown extension - Flickr - Photo Sharing!
Explore Cameron Stewart's photos on Flickr. Cameron Stewart has uploaded 431 photos to Flickr.

21 Foot Rule Less Talk and More action (compiled and shortened) - YouTube
http://www.21footrule.com It is one thing to read about the 21 foot rule, it is another to actually see it done. Many times people think that ...

Hillary and Bill Clinton compiled disloyalty 'hit list', new book claims
Hillary and Bill Clinton keep a detailed "hit list" of everyone who has crossed them during more than 20 years at the apex of American politics, ...

Steve Jobs videos compiled into ultimate collection
... New York Times on Twitter, a pretty extensive collection of Steve Jobs’ interviews, keynotes, product demos, and rare company video was compiled ...

NRA compiled secret gun registry on “tens of millions” of gun owners
If you really believe the government is Hitler, then why aren't they capable of stealing the NRA's gun registry? .

We’ve compiled a list of the best time-saving Android shortcuts
The best thing about Android is that if you don't like the way it does some things, you can change it to make it more convenient. A recent thread ...

"Within the past 24 hours, user-contributed link aggregator reddit.com compiled a 'secret list' of banned ...
"... including such reputable news sites as The Atlantic, Business Week, PhysOrg and ScienceDaily." Reddit is a site that claims to be all for ...

Thank goodness the NSA had the sense to put funnyman Art Buchwald on the watch list it compiled for President ...
... which turned to the FBI, and eventually the NSA "expanding the watch list to include domestic terrorist and foreign radical suspects" compiled ...


Resources last updated: 12/24/2015 7:56:07 AM