asi
asked on
TstringList can not assign
Hello,
I create a dll with delphi and try to connect to the Dll by delphi application
One of the function in the Dll has parameter from type TStringList.
When i try to use this function i get an error :
"TstringList can not assign to TstringList"
i use StrList1.assign(StrList2)
and every unit has the ShareMem unit,
why ?
reagrds
Asi
I create a dll with delphi and try to connect to the Dll by delphi application
One of the function in the Dll has parameter from type TStringList.
When i try to use this function i get an error :
"TstringList can not assign to TstringList"
i use StrList1.assign(StrList2)
and every unit has the ShareMem unit,
why ?
reagrds
Asi
ASKER
finally i find out the Vcl objects cannot pass to Dll ...
10x to me
10x to me
you should be able to post objects between an exe and a dll without any problem. Problems only occur if you start using strings over 255 characters.
Are the string lists in the dll or in the exe?
Try using Form1.StringLIst.Assign(Fo rm2.String List);
Replacing Form# with your form names....
Try using Form1.StringLIst.Assign(Fo
Replacing Form# with your form names....
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
and if i want to get from a Dll Tdataset ? the same ... ?
If the object you are trying to use across the "DLL boundary" does not make any awkward use of internal workings of the compiler (as the case I outlined) or some global vars then you might get away with it. The sad fact is that when you run a method of any object from within the DLL, code inside the DLL gets run and when you call the same method on the same object from within the EXE _other_identical_piece_of_ code_ will run. Things can go very well as long as that code does not make use of any globals (and the VT is such a "hidden" global).
When you run into globals you _will_ have to switch to runtime libs. The database subsystem of the VCL is built on global stuff (see the Session or the Sessions variables) so you will have a very hard time to DLL-ize database code without runtime packages.
When using RT packages every module (EXE and all involved DLL's) is expected to use the same vclxxx.dpl, meaning that all the globals I mentioned above are in the same place (a.k.a. in those DPL's)
F.
When you run into globals you _will_ have to switch to runtime libs. The database subsystem of the VCL is built on global stuff (see the Session or the Sessions variables) so you will have a very hard time to DLL-ize database code without runtime packages.
When using RT packages every module (EXE and all involved DLL's) is expected to use the same vclxxx.dpl, meaning that all the globals I mentioned above are in the same place (a.k.a. in those DPL's)
F.
Question(s) below appears to have been abandoned. ADMINISTRATION HAS BEEN ADVISED AND WILL BE CONTACTING YOU SHORTLY. There are a total of 57 open questions for you, any not shown here have ZERO comments added, so you can delete them directly.
Your options are:
1. Accept a Comment As Answer (use the button next to the Expert's name).
2. Close the question if the information was not useful to you. You must tell the participants why you wish to do this, and allow for Expert response.
3. Ask Community Support to help split points between participating experts, or just comment here with details and we'll respond with the process.
4. Delete the question. Again, please comment to advise the other participants why you wish to do this.
For special handling needs, please post a zero point question in the link below and include the question QID/link(s) that it regards.
https://www.experts-exchange.com/jsp/qList.jsp?ta=commspt
Please click the Help Desk link on the left for Member Guidelines, Member Agreement and the Question/Answer process. https://www.experts-exchange.com/jsp/cmtyHelpDesk.jsp
Please click you Member Profile to view your question history and keep them all current with updates as the collaboration effort continues, to track all your open and locked questions at this site. If you are an EE Pro user, use the Power Search option to find them.
To view your open questions, please click the following link(s) and keep them all current with updates.
https://www.experts-exchange.com/questions/Q.11624838.html
https://www.experts-exchange.com/questions/Q.11837819.html
https://www.experts-exchange.com/questions/Q.12000718.html
https://www.experts-exchange.com/questions/Q.20015588.html
https://www.experts-exchange.com/questions/Q.20033766.html
https://www.experts-exchange.com/questions/Q.20060547.html
https://www.experts-exchange.com/questions/Q.20086506.html
https://www.experts-exchange.com/questions/Q.20087146.html
https://www.experts-exchange.com/questions/Q.20096878.html
https://www.experts-exchange.com/questions/Q.20099988.html
https://www.experts-exchange.com/questions/Q.20103524.html
https://www.experts-exchange.com/questions/Q.20105868.html
https://www.experts-exchange.com/questions/Q.20124168.html
https://www.experts-exchange.com/questions/Q.20126164.html
https://www.experts-exchange.com/questions/Q.20126258.html
https://www.experts-exchange.com/questions/Q.20127406.html
https://www.experts-exchange.com/questions/Q.11610958.html
https://www.experts-exchange.com/questions/Q.20136024.html
https://www.experts-exchange.com/questions/Q.20137249.html
https://www.experts-exchange.com/questions/Q.20147343.html
https://www.experts-exchange.com/questions/Q.20162739.html
https://www.experts-exchange.com/questions/Q.20163581.html
https://www.experts-exchange.com/questions/Q.20165158.html
https://www.experts-exchange.com/questions/Q.20167166.html
https://www.experts-exchange.com/questions/Q.20177854.html
https://www.experts-exchange.com/questions/Q.20185774.html
https://www.experts-exchange.com/questions/Q.20185782.html
https://www.experts-exchange.com/questions/Q.20211426.html
https://www.experts-exchange.com/questions/Q.20211827.html
https://www.experts-exchange.com/questions/Q.20229407.html
https://www.experts-exchange.com/questions/Q.20231198.html
https://www.experts-exchange.com/questions/Q.20238567.html
https://www.experts-exchange.com/questions/Q.20238568.html
https://www.experts-exchange.com/questions/Q.20238571.html
https://www.experts-exchange.com/questions/Q.20240061.html
https://www.experts-exchange.com/questions/Q.20241871.html
https://www.experts-exchange.com/questions/Q.20242268.html
https://www.experts-exchange.com/questions/Q.20244256.html
https://www.experts-exchange.com/questions/Q.20246106.html
https://www.experts-exchange.com/questions/Q.20250445.html
https://www.experts-exchange.com/questions/Q.20251868.html
https://www.experts-exchange.com/questions/Q.20254886.html
https://www.experts-exchange.com/questions/Q.20254704.html
https://www.experts-exchange.com/questions/Q.20255422.html
https://www.experts-exchange.com/questions/Q.20261740.html
https://www.experts-exchange.com/questions/Q.20262552.html
https://www.experts-exchange.com/questions/Q.20262985.html
https://www.experts-exchange.com/questions/Q.20265275.html
https://www.experts-exchange.com/questions/Q.20270259.html
https://www.experts-exchange.com/questions/Q.20270694.html
https://www.experts-exchange.com/questions/Q.20270687.html
https://www.experts-exchange.com/questions/Q.20271885.html
To view your locked questions, please click the following link(s) and evaluate the proposed answer.
https://www.experts-exchange.com/questions/Q.20171579.html
https://www.experts-exchange.com/questions/Q.20178687.html
https://www.experts-exchange.com/questions/Q.20265222.html
https://www.experts-exchange.com/questions/Q.20265219.html
https://www.experts-exchange.com/questions/Q.20269116.html
PLEASE DO NOT AWARD THE POINTS TO ME.
------------> EXPERTS: Please leave any comments regarding your closing recommendations if this item remains inactive another seven (7) days.
Thank you everyone.
Moondancer
Moderator @ Experts Exchange
P.S. For any year 2000 questions, special attention is needed to ensure the first correct response is awarded, since they are not in the comment date order, but rather in Member ID order.
Your options are:
1. Accept a Comment As Answer (use the button next to the Expert's name).
2. Close the question if the information was not useful to you. You must tell the participants why you wish to do this, and allow for Expert response.
3. Ask Community Support to help split points between participating experts, or just comment here with details and we'll respond with the process.
4. Delete the question. Again, please comment to advise the other participants why you wish to do this.
For special handling needs, please post a zero point question in the link below and include the question QID/link(s) that it regards.
https://www.experts-exchange.com/jsp/qList.jsp?ta=commspt
Please click the Help Desk link on the left for Member Guidelines, Member Agreement and the Question/Answer process. https://www.experts-exchange.com/jsp/cmtyHelpDesk.jsp
Please click you Member Profile to view your question history and keep them all current with updates as the collaboration effort continues, to track all your open and locked questions at this site. If you are an EE Pro user, use the Power Search option to find them.
To view your open questions, please click the following link(s) and keep them all current with updates.
https://www.experts-exchange.com/questions/Q.11624838.html
https://www.experts-exchange.com/questions/Q.11837819.html
https://www.experts-exchange.com/questions/Q.12000718.html
https://www.experts-exchange.com/questions/Q.20015588.html
https://www.experts-exchange.com/questions/Q.20033766.html
https://www.experts-exchange.com/questions/Q.20060547.html
https://www.experts-exchange.com/questions/Q.20086506.html
https://www.experts-exchange.com/questions/Q.20087146.html
https://www.experts-exchange.com/questions/Q.20096878.html
https://www.experts-exchange.com/questions/Q.20099988.html
https://www.experts-exchange.com/questions/Q.20103524.html
https://www.experts-exchange.com/questions/Q.20105868.html
https://www.experts-exchange.com/questions/Q.20124168.html
https://www.experts-exchange.com/questions/Q.20126164.html
https://www.experts-exchange.com/questions/Q.20126258.html
https://www.experts-exchange.com/questions/Q.20127406.html
https://www.experts-exchange.com/questions/Q.11610958.html
https://www.experts-exchange.com/questions/Q.20136024.html
https://www.experts-exchange.com/questions/Q.20137249.html
https://www.experts-exchange.com/questions/Q.20147343.html
https://www.experts-exchange.com/questions/Q.20162739.html
https://www.experts-exchange.com/questions/Q.20163581.html
https://www.experts-exchange.com/questions/Q.20165158.html
https://www.experts-exchange.com/questions/Q.20167166.html
https://www.experts-exchange.com/questions/Q.20177854.html
https://www.experts-exchange.com/questions/Q.20185774.html
https://www.experts-exchange.com/questions/Q.20185782.html
https://www.experts-exchange.com/questions/Q.20211426.html
https://www.experts-exchange.com/questions/Q.20211827.html
https://www.experts-exchange.com/questions/Q.20229407.html
https://www.experts-exchange.com/questions/Q.20231198.html
https://www.experts-exchange.com/questions/Q.20238567.html
https://www.experts-exchange.com/questions/Q.20238568.html
https://www.experts-exchange.com/questions/Q.20238571.html
https://www.experts-exchange.com/questions/Q.20240061.html
https://www.experts-exchange.com/questions/Q.20241871.html
https://www.experts-exchange.com/questions/Q.20242268.html
https://www.experts-exchange.com/questions/Q.20244256.html
https://www.experts-exchange.com/questions/Q.20246106.html
https://www.experts-exchange.com/questions/Q.20250445.html
https://www.experts-exchange.com/questions/Q.20251868.html
https://www.experts-exchange.com/questions/Q.20254886.html
https://www.experts-exchange.com/questions/Q.20254704.html
https://www.experts-exchange.com/questions/Q.20255422.html
https://www.experts-exchange.com/questions/Q.20261740.html
https://www.experts-exchange.com/questions/Q.20262552.html
https://www.experts-exchange.com/questions/Q.20262985.html
https://www.experts-exchange.com/questions/Q.20265275.html
https://www.experts-exchange.com/questions/Q.20270259.html
https://www.experts-exchange.com/questions/Q.20270694.html
https://www.experts-exchange.com/questions/Q.20270687.html
https://www.experts-exchange.com/questions/Q.20271885.html
To view your locked questions, please click the following link(s) and evaluate the proposed answer.
https://www.experts-exchange.com/questions/Q.20171579.html
https://www.experts-exchange.com/questions/Q.20178687.html
https://www.experts-exchange.com/questions/Q.20265222.html
https://www.experts-exchange.com/questions/Q.20265219.html
https://www.experts-exchange.com/questions/Q.20269116.html
PLEASE DO NOT AWARD THE POINTS TO ME.
------------> EXPERTS: Please leave any comments regarding your closing recommendations if this item remains inactive another seven (7) days.
Thank you everyone.
Moondancer
Moderator @ Experts Exchange
P.S. For any year 2000 questions, special attention is needed to ensure the first correct response is awarded, since they are not in the comment date order, but rather in Member ID order.
Admin notified of User neglect. Force-accepted by
Netminder
Community Support Moderator
Experts Exchange
Netminder
Community Support Moderator
Experts Exchange
Hello,
Try declaring sharemem in the project source of your exe and dll rather than in every unit. You also need to ensure that it is declared first.