Find Jobs
Hire Freelancers

Converting some Delphi Code to C++

$30-250 USD

Completed
Posted almost 10 years ago

$30-250 USD

Paid on delivery
Hi. I have the following code in a Delphi DLL which is working and shall be ported to C(++) - it is important that the DLL can deal with the IStream refernce. unit T_D2007_Impl; interface uses ActiveX, StrUtils, SysUtils, Classes, Math; type TPFLog = procedure(AMsg: PAnsiChar; ASeverity: Integer) of object; stdcall; var BYTESRETURNED, BYTESTRANSFORMED: Integer; BYTESLASTREAD: PLongInt; DLIBMOVE: Int64; STREAMSTAT: tagSTATSTG; INSTREAM: IStream; LOG: TPluginFrameworkLog; implementation // Helpers ... function StreamToString(AStream: IStream): AnsiString; var len: Int64; s: AnsiString; currentposinstream: Int64; begin [login to view URL](STREAMSTAT, STATFLAG_DEFAULT); DLIBMOVE := 0; [login to view URL](DLIBMOVE, STREAM_SEEK_CUR, currentposinstream); len := [login to view URL] - currentposinstream; SetLength(s, len); if len > 0 then [login to view URL](Pointer(s), len, BYTESLASTREAD); Result := s; end; // end of helpers function AddLoggingCallBack(ALoggingFunction: TPFLog): Boolean; begin try LOG := ALoggingFunction; Result := true; except Result := false; end; end; function SetInStream(const APointerToTheInStream: Pointer): Boolean; export; begin try INSTREAM := IStream(APointerToTheInStream); Result := true; except Result := false; end; end; procedure UpdateStreamStats(); begin DLIBMOVE := 0; [login to view URL](STREAMSTAT, STATFLAG_NONAME); end; function Read(var Buffer; Count: Longint): Longint; export; var len: Int64; instring2, sizestring, posstring, logstring: AnsiString; pc: PAnsiChar; begin UpdateStreamStats; len := [login to view URL] - BYTESTRANSFORMED; if len > 0 then begin sizestring := IntToStr([login to view URL]); posstring := IntToStr(BYTESTRANSFORMED); logstring := 'Starting to read and transform instring ' + posstring + '/' + sizestring + '.';; LOG(PAnsiChar(logstring), 5); instring2 := StreamToString(INSTREAM); BYTESTRANSFORMED := Length(instring2); instring2 := AnsiReplaceStr(instring2, AnsiString('XXX' + #13 + #10), AnsiString('')); instring2 := AnsiReplaceStr(AnsiString(instring2), AnsiString('{'), AnsiString('[')); instring2 := AnsiReplaceStr(AnsiString(instring2), AnsiString('}'), AnsiString(']')); pc := PAnsiChar(instring2); Move(pc^, Buffer, Length(instring2)); Result := Length(instring2); BYTESRETURNED := BYTESRETURNED + Result; posstring := AnsiString(IntToStr(BYTESTRANSFORMED)); logstring := 'Finished to read and transform instring ' + sizestring + '/' + posstring + '.'; LOG(PAnsiChar(logstring), 5); end else Result := 0; end; // end of export functions exports AddLoggingCallBack, SetInStream, Read; begin BYTESRETURNED := 0; BYTESTRANSFORMED := 0; byteslastread := nil; DLIBMOVE := 0; end.
Project ID: 6172136

About the project

6 proposals
Remote project
Active 10 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
Awarded to:
User Avatar
Hello, I have a lot of experience with both Delphi and C++, including COM/ActiveX technologies. I can translate your Delphi unit into clean and easy-to-read C or C++ code. You won't be disappointed. Thank you.
$100 USD in 2 days
5.0 (32 reviews)
4.8
4.8
6 freelancers are bidding on average $141 USD for this job
User Avatar
Hello. I have large experience in converting code from one programming language to another programming language.
$59 USD in 3 days
5.0 (427 reviews)
6.5
6.5
User Avatar
Hi, I'm Delphi/C expert with years of experience in various areas including conversion to and from pascal. Can you tell me do you have some project that uses this dll that could be used to verify that converted dll is working fine?
$257 USD in 15 days
5.0 (32 reviews)
5.6
5.6
User Avatar
Hello, is this all code that needs to be converted? My price is for the code that you had posted. If there are more units I might have to increase my bid a little bit.
$199 USD in 5 days
4.9 (21 reviews)
5.0
5.0
User Avatar
I am highly Expert in this field. I'll provide you satisfaction. So your time and money will be safe when you will award me project thanks. let's discuss more
$526 USD in 10 days
4.7 (13 reviews)
3.8
3.8
User Avatar
Hi.. I am Nikhil. I have working experience of 3+ year in C and C++ Development. I have done work on: 1. Data Structure like: Set, Vector, Linked list, Stack, Tree(Any type), Graph. 2. STL ( Standard Template Library) 3. Networking Socket, IO programming 4. File Handling and Parsing. Currently I have done similar projects for collage students like: 1. Implemented Chess Class 2. Implemented Classes for hotel management. I delivered him but Employer did not award me project. and Many more... Let start conversation so you get to know about my skills and ability. Please give me a chance to do work with you and I am promising you that you will not disappoint by me. I read your description and understood your requirements. I am very sure that I will do this within 1 to 2 days. I will write code with comments so you will understand it easily and I will also help you to solve any further query.. If you need any help after project then I will be here. Please give a chance to conversation with you. I am waiting for your positive response. Please initiate conversation at least. Thank you Very much. Nikhil
$155 USD in 3 days
4.9 (6 reviews)
2.9
2.9
User Avatar
Hello Do you need c++ Builder project or MSVS project? How shall we test the result? Regards, Yuriy
$77 USD in 5 days
4.7 (3 reviews)
2.7
2.7

About the client

Flag of GERMANY
Springe, Germany
4.8
3
Payment method verified
Member since Feb 26, 2014

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.