

alogrep
Members-
Content Count
184 -
Joined
-
Last visited
Everything posted by alogrep
-
HI. I hoe there si sombody with Synapse experience willing to help. I am trying to send an email with an embedded image. The html is Trichview created. In the richview part, I add the image like thi (MMis the is TMimeMess object from synapse) for i := 0 to HTMLImages.Count-1 do begin MM.AddPartHTMLBinary(HTMLImages[i].Stream,HTMLImages[i].Name,'<'+HTMLImages[i].Name+'>',MultiPartRel); end; in the synpase part I have this funcion (by synapse) function TMimeMess.AddPartHTMLBinary(const Stream: TStream; const FileName, Cid: string; const PartParent: TMimePart): TMimepart; begin Result := AddPart(PartParent); Result.DecodedLines.LoadFromStream(Stream); Result.MimeTypeFromExt(FileName); Result.Description := 'Included file: ' + FileName; Result.Disposition := 'inline'; Result.ContentID := Cid; Result.FileName := FileName; Result.EncodingCode := ME_BASE64; Result.EncodePart; Result.EncodePartHeader; end; So the disposition IS "inline", but the recipient get the image as an attachment. I really have no idea of what "CID" (Content ID) should be, i i just pass "<filename>" Wher filename is the filename of the embedded image.
-
THanks Olli73. And I found that the error was I did not add the (pure) text before ading the html part. Do you know by the way if Synapse has a way of including a Return-path? It has a Replyto, but I can't find a return-path.
-
Hi. It is a few days that the IDE does not catch unhandled exceptions. For example, if i put a line with a division by zero, it just goes on. Before the system caught it and the app stopped after the error message. I have checked for any 'forgotten' Application OnException in my code, but I found none. The settings in Compile and Linking are shown in the attached picture. What else should I check, please?
-
OOps!. I got confused . What happens is this I have this bit of code begin n:=0; d:=100/n; if d>0 then n:=1; dm2.tabstable.indexname:='xyz'; The first error is ignored, no warning, no message. The second error is caught, but it does notshow the call stack, so I do not know WHERE it happens (in this case yes I know, but is a nightmare when it may happen God only know where)
-
Thanks to all. No, the division by zero was an exampte (and a test I actually didi). It is all exceptions (that are not handled) The more critical one is when I set a table to an index name that does not esxist. The app just exit, no wrnings.
-
HI. Suddenly I am unalbe to create a VCL New Project. When I launch it in the IDE it freezes for a long time. The task manager shows a strange list of proceses (see attached image. This is the project code: (form 3 does nothig, it only contains a stringgrid. Any idea? program Project4; uses Vcl.Forms, Unit3 in 'Unit3.pas' {Form3}; {$R *.res} begin Application.Initialize; Application.CreateForm(TForm3, Form3); Application.Run; end.
-
HI. My Onpaint is never triggered in one form. Any idea as to why this happens?
-
Thanks Remy. Yes and yes. I even reassign it at runtim (Formactivate, set to il then reasign).
-
HI. I had the adventurous idea of changing the Inactive code opacity in Tools->Editor->language->Error Insight from 30 to 40. Immediately any opacity was lost. Then I played around with values (50, 10, 40, et) and now the code inside an ifdef/endif is opaque (if not applicable) but any commented code remains without any opacity.(see attached picture) Any hint as to restore the proper opacity? Thanks
-
I have this setup but no files are saved in the __recovery directory. Do I need to setup something additionally?
-
HI. I don't know if I am on the right track. After a lot ot research, I came up with this scheme. I am stuck in get1Proc: I do not knoow how to get the handle of the control taht sent the message. mHook := SetWindowsHookEx(CM_VISIBLECHANGED ,@get1proc, hInstance, 0); function get1Proc(nCode, wParam, lParam : integer) : integer; stdcall; begin how do i get the handle of the control that sent this message to be used in Findcontrol()? end;
-
HI. I just can't get to change the text color of a statictext; I have this code: num:=TStaticText.create(self); num.parent:=self; num.parentcolor:=false; num.StyleElements:=[]; rect:=wc.boundsrect; num.caption:=' '+inttostr(lastnumnum)+' '; num.font.name:='Arial'; num.font.color:=clred; I have tried setting StyleElements to sefont, to seclient, and also left it alone (seclient, sefont, seborder).. THe texct color is always black. They have made this really hard to change! Anybody knows the "magic trick" to change the color on a runtime created statictext? P.S. if the statictext is created at design time, Style Elements is all set (3), AND IT WORKS LIKE A CHARM.
-
Thank you. it worked.
-
HI I hope someone can help. The docwiki states: EnumModules continues until the last module in the application is enumerated, or until the callback function returns False. Bu the code below omnly shws the Application name,. Where is my error? function GetModules(Instance: THandle; Data: Pointer): Boolean; var FileName: array[0..Max_Path] of Char; begin if GetModuleFileName(Instance, FileName, SizeOf(FileName)) > 0 then Tlistbox(Data).items.Add(FileName) else RaiseLastWin32Error; Result := True; end; EnumModules(GetModules, ListBox1);
-
Enum modules return ONLY the application, no other packages
alogrep replied to alogrep's topic in VCL
Thanks Remy. I am talking aboutn the Component ->Install Packages list. Is there a way to get a list of them to print or to save to a file? -
HI. I hope someone can give me a hint here. Printque is a Form created in the Main Thread, just before calling this thread. Its Formcreate contains this line: Tstuckthread.Create(Tprintqueue(self),printernames); The problem is in the showform procedure at the line .A.show It gives no error, but the app becomes unresponsive. The main form is hidden, and I have to stop the app.I Tstuckthread= class(TThread) private FForm: TFORM; L:tSTRINGLIST; function STUCK(title:string;l:Tstringlist): boolean; procedure listjobs(allprinters: string); protected public constructor Create(ownerForm:TFORM;printernames:string; ARUNS: INTEGER=0); destructor Destroy; override; procedure Execute(); override; procedure showform; published end; constructor Tstuckthread.Create(ownerForm: TFORM;printernames: string;ARUNS: INTEGER=0); begin L:=tSTRINGLIST.CREATE; FForm:= ownerForm; Self.FreeOnTerminate := True; inherited Create; end; destructor Tstuckthread.Destroy; begin inherited; L.FREE; end; procedure Tstuckthread.Execute; begin done :=FALSE; while not Terminated AND NOT done do begin <get printjobs list and save it in L......> if L.count>0 then BEGIN /// fine HERE Tprintqueue(FForm).MEMO1.LINES.ASSIGN(L); // fine HERE Synchronize(SHOWForm); SLEEP(500); END; DONE:=TRUE; end; end; And here is the showform() procedure; procedure Tstuckthread.showform; VAR A: Tprintqueue; begin A:=Tprintqueue(FForm); TRY IF NOT A.VISIBLE THEN A.show; // PROBLEM HERE. EXCEPT a.free;// 4 testing. It never gets there. END;
-
Thank you very much Remy. That was it. Problem solved.
-
Sorry. This line was wrong. Printque is a Form created in the Main Thread, just before calling this thread. shold have been Printque is a Form created in the Main Thread,
-
HI. my package builds ok. But trying to install results in the error The specified module could not be found. I read all the posts I could find on this. it is almost impossible to find the real problem. Could this info get to shade some light? In Process monitor i see these 2 lines with Result NAME NOT FOUND (each repeated twice) C:\Users\1\AppData\Roaming\Embarcadero\BDS\23.0\UserTools.proj C:\HMXE_A\MYCOMPONENTS\mine2.deployproj tHE DPK IS C:\HMXE_A\MY COMPONENTS\MINE2.DPK And the mine2.bpl IS there. P.S. Dependexny walker gives me many many errors on microsoft dlls ???
-
II I have table1.Edit and it stays there indefinitely on one PC, when I do the same (on exactly the same record on another PC, it does not give me any error: it just goes on and I can even POST it. This happens in the last few hours. Until then It worked fine. I was trying to see why in the oneditError, although I had Action= dsAbort it still showed a message, although the documentation says and it would not. In that message window there was a checkbox "Ignore this error in the future" (or something to that effect) that I marked, Since then the lock timeout error does not get triggered. Any help rom anybody, please?
-
Thanks Peter. I find it strange that a question answered at runtime makes a persistent change in the IDE options. Anyway I went further and found out the method of setting those options on the breakpoints-> Advanced. To me it sounds obvious that the debugger intercept the exception before the try/except block. It does not seem so obvious to me that there is ONLY an option to ignore the exception (then it does not even trigger the OnEditError, for example). I would have expected a sub-option: catch it but do not show notification to the end-user. ..
-
WMIService (PrintJobInfo) spanws to the CPU window , ot trigger exceptio.
alogrep posted a topic in VCL
THI. I have the piece of code show below. when it gets to the line FWMIService := FSWbemLocator.ConnectServer it simply opwns the CPU window and does never get tot except section. Running Delphi 12.1 on win 64bit. (The second piece of code shows how the procedure is called). Any idea anybody? procedure GetWin32_PrintJobInfo; const WbemUser =''; WbemPassword =''; WbemComputer = 'localhost'; wbemFlagForwardOnly = $00000020; var FSWbemLocator : OLEVariant; FWMIService : OLEVariant; FWbemObjectSet: OLEVariant; FWbemObject : OLEVariant; oEnum : IEnumvariant; iValue : LongWord; str:String; begin; FSWbemLocator := CreateOleObject('WbemScripting.SWbemLocator'); try FWMIService := FSWbemLocator.ConnectServer('192.168.1.70', 'root\CIMV2', WbemUser, WbemPassword); except on E:EOleException do writeln(e.message); on E:sysutils.Exception do writeln(e.message); end; begin try CoInitialize(nil); try GetWin32_PrintJobInfo; finally CoUninitialize; end; except on E:EOleException do Writeln(Format('EOleException %s %x', [E.Message,E.ErrorCode])); on E:Exception do Writeln(E.Classname, ':', E.Message); end; -
HI. I have this scheme (pseudocode) rery+0 repeat starttransaction; try table1.edit;. change table1; table1 post; commit; except on E: SysUtils.Exception do begin Rollback; table1 cancel inc(retry); if retry>=3 then showmessage & exit else sleep(500); end; end; until retry>=3; end; In table1 OnPostError I have begin ACTION:=DAaBORT; end; Why do I get the error message (regarding a conflict with other users)? That defeats the purpose of the start transaction/commit/rollback setup. DaAbort should NOT show the message, correct? My intent is to retry the edit/post operation 3 times, but if a message shows up with one user, by the time it reads it and closes it, other concurrent users get a timeout error.
-
Hi I have some legacy units with lots of glyph loaded with tpngoject. In my old Delphi the images are show well. In 10.4, they are simply ignored, not shown. If I inspect the DFM loaded in 10.4 the DATA section of the glyph is not present. Is there any way to make those units in 10.4 easier (or faster) than reload the images 1 by 1? ( I would also like to preserve the original unit to be used with the older version). Thanks.