|
|
Hello,
I'm trying to develop a dll for my application and what is good is that i have the code in pascal developed on Borland Delphi 6 BUT the problem is there are some objects which i can't define them in c++ .
So i need help for this migration and if there is someone can help me what is the best solution and objects in c++ relatives to this objects in Pascal :
TStringList
TMemoryStream
TStringStream
THandleStream
thank you.
|
|
|
|
|
TStringList is a linked list with string values.
TMemoryStream can be replaced by any other stream class or a byte array.
This statement is false.
|
|
|
|
|
I have searched all over for a proper manual - alas! I need to produce a Rave Report from an SQL statement in Delphi7, something like
SELECT * FROM tblTransaction WHERE TransDate>=[Starting Date] And TransDate<=[End Date]
ORDER BY Category, TransDate; (TransDate and Category are fields in the table)
The report must look like an MS Access report GROUPED by Category, then all the Transactions in that group (Category) ordered by TransDate, followed by a sub-total for the group and, finally, an overall TOTAL for all the transactions. The transactions are invoices with such information as supplier, date paid, detail, etc.
The SQL must be passed to Rave Reports from Delphi, as must be the ConnectionString to the database.
There are sites advertising examples of Rave for sale but, they are not specific and I do not want to spend unless I know it's what I'm looking for.
Hannes
|
|
|
|
|
Hi,
Need a clarification in Delphi 7
I have two applications running simultaniously.
One will feed the next with trigger files.
Here i want the second application to pick the oldest file in the list of files available.
Please suggest me an idea with example...
Thanks in advance...!! 
|
|
|
|
|
What kind of files your first applicateon feeds second application?
How is logic of comunication between that two applications?
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
Thnkx for the response...!!
First application is a report file generator, at the end of report generation it will create a trigger file with root path of those Report files. The second application will pick the trigger file and will Archive those report files to DB...
if i have ten trigger files present named 1.trg, 2.trg ... so on... The second application will pick the 1.trg and process it. After processing. it is not picking the 2.trg where as it starts picking 11.trg which the report gen was currently writing in. Where in i need the second application to pick 2.trg...
i have tried the following but no use...
*******************************************************
Type
FileRecTypePtr = ^FileRecType;
FileRecType =
Record
Time : String;
Name : String;
End;
pFileRecType = ^FileRecType;
Function FetchEOFFiles(SrcFoldName:String) : String;
Var
SearchRec1 : TSearchRec;
FilesList : TList;
FileRec : FileRectype;
FileRecPtr : pFileRecType;
Begin
FilesList := Tlist.Create;
If FindFirst(SrcFoldName + '\*.EOF', faAnyFile, SearchRec1) = 0 Then
Begin
FileRec.Time := FormatDateTime('yyyymmddhhnnss', SearchRec1.Time);
FileRec.Name := SearchRec1.Name;
New(FileRecPtr);
FileRecPtr^ := FileRec;
FilesList.Add(FileRecPtr);
While FindNext(Searchrec1) = 0 Do
Begin
FileRec.Time := FormatDateTime('yyyymmddhhnnss', SearchRec1.Time);
FileRec.Name := SearchRec1.Name;
New(FileRecPtr);
FileRecPtr^ := FileRec;
FilesList.Add(FileRecPtr);
End;
End;
Sysutils.FindClose(Searchrec1);
FilesList.Sort;
End;
***************************************************
|
|
|
|
|
I think your sort is wrong. Think you sort on filenames (strings), so not on numbers. It will sort:
File1
File10
File2
File20
To avoid this precede your filenames with zero's. Then it will sort:
File01
File02
File11
File20
I used only one preceding zero making a max. of 99 filenames, use more preceding zero's if you ll expect more files.
Rozis
|
|
|
|
|
|
|
Simple genetic algorithm sample needed in Delphi... Please Help...
|
|
|
|
|
What kind of algorithm do you need?
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
Hi all,
I want to send automatic mail from my Delphi application with attachment without invocation of any client tool like outlook. Actually My application runs as a windows service and every 5 minute generate some response files. I want those files to be mailed automatically. But how do I do that?
thanks n regards
Jeet
|
|
|
|
|
Have a look at the Indy components included with Delphi.
You can use these to do what you need. The documentation for the components should have some good examples for you as well.
|
|
|
|
|
Im not in with Delhi but what i do is: create an EML-file, open a socket and send the stuff. Actually it is not so difficult to create a socket that follows the SMTP-protocol...
If you like i can give you some code to do that (or look at the RFC's describing the SMTP-protocol)
Rozis
|
|
|
|
|
Hi Buddy,
Please refer to the nice article on sending email in background using Indy library.
http://delphi.about.com/od/indy/a/email-send-indy.htm
Cheers,
Ajay
|
|
|
|
|
Hi,
I'm controling excel successfully, but now I came up with a problem.
I use Excel97.pas due to compatibility reasons. With this I successfully control 100% of excel 97-2003 and 90% of excel 2007.
It is for complex export of data with Pivots and Charts. The only thing not working in 2007 is the build in charttypes but that is not so important, but help there would also be appreciated.
But now the problem:
I'm starting excel in a new instance. When I try to enable the events, however this fails wenn an other instance has the printpreview open. For now I present a message telling the user to close the preview, but I prefer to do without. I have not found any way to close the preview or any other way around it.
Thanks David
modified on Wednesday, June 10, 2009 12:36 PM
|
|
|
|
|
I use an ADOQuery, ADODataSource and DBGrid to populate a Read-only DBGrid from an Access table. I then use an ADOCommand to execute an SQL statement to either Update, Insert or Delete a record in the table. How do I get the DBGrid to automatically display the updated table? I have tried to Refresh or Update the DBGrid, also Close and Open, and Active=False and True on the ADOQuery, all to no avail.
I tried to define a TDataSource which I can Create before running the query and FreeAndNil afterwards but, I get an error 'Not enough parameters' when I do MyDataSource := TDataSource.Create. I think this approach could work?
Hannes
|
|
|
|
|
Are you generating programatically DataSource for DBGrid?
When you use Close then Open of DataSource object then it must display changes which you made from Update or Delete or Insert.
Otherwise provide more detailed your case.
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
All I have is an ADOQuery, an ADODataSource and a DBGrid. I tried to create the ADOQuery and DataSource programmatically but it did not work. I have not tried to do the same with the DBGrid. To my knowledge a DataSource does not have an Active, Close, Open or Refresh property, that's why I tried creating and freeing it but the data still did not change in the DBGrid.
Str := 'UPDATE tblTransaction SET tblTransaction.Category = "' + NewCat+ '", ' +
'tblTransaction.TaxDeductable="' + NewExp + '" ' +
'WHERE (((tblTransaction.Category) = "ZZZZ"));';
cmdCategory.CommandText := Str;
cmdCategory.Execute;
ShowData;
//and then this bit in the ShowData procedure
with qryCategory do
begin
Active := False; //I also tried Close and Open
ConnectionString := cnnStr;
SQL.Text := 'SELECT Category,Expense FROM tblCategory ORDER BY Category';
Active := True;
end;
//The DBGrid should now show this change
|
|
|
|
|
After you execute Update command then try to use refresh on this way.
Set ADODataSet1 as datasource to DBGrid,in desing mode set connection string and CommandText
ADODataSet1.Close;
ADODataSet1.CommandText:='SELECT Category,Expense FROM tblCategory ORDER BY Category';
ADODataSet1.Open;
Hope it will help you.
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
I deleted the ADOQuery and replaced it with an ADODataSet and the code is as you suggest:
with dsCategory do //now a DataSet
begin
Close;
ConnectionString := cnnStr; //cnnStr comes from Form1.
CommandText := 'SELECT Category,Expense FROM tblCategory ORDER BY Category';
Open;
end;
No change Even Refresh and Repaint does not work. The grid looks like its refreshing (flashes) but the modified data is not displayed.
|
|
|
|
|
Does DBGrid have corrected datasource object?
I will do simple example for you and I will send u by email.
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
That is very kind of you, thanks.
|
|
|
|
|
You can download sample here[^]
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|