-
Content Count
3586 -
Joined
-
Last visited
-
Days Won
176
Everything posted by David Heffernan
-
stringreplace character in all string
David Heffernan replied to William23668's topic in RTL and Delphi Object Pascal
Can you show what the output of your code is. It should be easy to produce a minimal complete program, a console app, that demonstrates the behaviour that you are struggling with. -
Reading a binary file hangup without error
David Heffernan replied to William23668's topic in RTL and Delphi Object Pascal
But it's not text, you can't treat it as text, and there's nothing to learn. What you should learn is how text is encoded. Why not do that? -
Opinions about Pascal vs C/C++ IDE
David Heffernan replied to TimCruise's topic in Tips / Blogs / Tutorials / Videos
Both Matlab and R seem completely inappropriate for this usage scenario. But R is not graphical software. It's best thought of as a scripting language designed for statistical use.- 39 replies
-
- programming hardware
- rad studio
-
(and 1 more)
Tagged with:
-
Reading a binary file hangup without error
David Heffernan replied to William23668's topic in RTL and Delphi Object Pascal
You aren't going to be able to display the contents of a binary file in a rich edit control like this. If you want a hex editor, then display each byte as hex. -
How to get ThisFormClass (TForm1) from Form1
David Heffernan replied to Qasim Shahzad's topic in Algorithms, Data Structures and Class Design
It will work fine so long as you use the virtual constructor and all your classes override that correctly. If you passed in an anon method that creates and returns a newly minted form, that would allow other constructors to be used. To me this is pointless though. It's a really common pattern, it's only a handful of lines. I don't really see the benefit. I mean, if you were trying to centralise some logging or other aspect, then it would make sense. Otherwise I don't really see the benefit. Also the name sucks. Should include the fact that the form is shown modally.- 20 replies
-
- form creation
- refactoring
-
(and 3 more)
Tagged with:
-
How to set TBytes array to the file size ?
David Heffernan replied to William23668's topic in RTL and Delphi Object Pascal
Well you have all of the information you need in a byte array. The index into the array is the address, and the byte value at that index is your value. Job done. -
How to set TBytes array to the file size ?
David Heffernan replied to William23668's topic in RTL and Delphi Object Pascal
You already read every byte!! The real problem here is that you can't explain what you are trying to do. What do you mean about getting every address? An exe file isn't a list of addresses. -
How to set TBytes array to the file size ?
David Heffernan replied to William23668's topic in RTL and Delphi Object Pascal
Then why do you try to convert to a string as if it were UTF16? You seem very confused. Well, yeah, it probably isn't UTF16 is it? It looks like you tried 10 things at random and left them all in the code you posted. -
How to set TBytes array to the file size ?
David Heffernan replied to William23668's topic in RTL and Delphi Object Pascal
The size of the file is AFile.Size. You read the entire file into a byte array, but then go at the same stream with a binary reader. There are so many mistakes here. Do you want to read it into a byte array and covert to string. Or do you want to read it as binary. -
tImageCollection in COM DLL - EXE needs manifest ???
David Heffernan replied to A.M. Hoornweg's topic in Windows API
For example this 10 year old answer has example code https://stackoverflow.com/a/5133222/505088 I think I've made a few minor improvements to this over the years, but the code here works fine. -
tImageCollection in COM DLL - EXE needs manifest ???
David Heffernan replied to A.M. Hoornweg's topic in Windows API
Well you likely will break the existing app. It's easy to do what I described. -
tImageCollection in COM DLL - EXE needs manifest ???
David Heffernan replied to A.M. Hoornweg's topic in Windows API
Not if the comctl v6 manifest hasn't been activated in your thread. You'll have comctl v5.8. You need to activate the comctl v6 manifest whenever your DLL is called and deactivate whenever it returns. Every function should activate on entry, deactivate on exit. I do this in my Excel com add in. -
How do you acquire "Pictures" to be used in your project?
David Heffernan replied to TimCruise's topic in Tips / Blogs / Tutorials / Videos
Pictures or icons? Kind of a big difference. -
Opinions about Pascal vs C/C++ IDE
David Heffernan replied to TimCruise's topic in Tips / Blogs / Tutorials / Videos
Er, C handles floats fine, better than Delphi as it happens. Ha ha- 39 replies
-
- programming hardware
- rad studio
-
(and 1 more)
Tagged with:
-
Opinions about Pascal vs C/C++ IDE
David Heffernan replied to TimCruise's topic in Tips / Blogs / Tutorials / Videos
There's never been any point in using anything other than C to write device drivers on Windows or Linux. It's not like you can take advantage of OOP in the context of a device driver.- 39 replies
-
- programming hardware
- rad studio
-
(and 1 more)
Tagged with:
-
Opinions about Pascal vs C/C++ IDE
David Heffernan replied to TimCruise's topic in Tips / Blogs / Tutorials / Videos
That's a tool chain limitation rather than language though.- 39 replies
-
- programming hardware
- rad studio
-
(and 1 more)
Tagged with:
-
Hard to see how REST could achieve that. You likely need to find a programmer.
-
What does convert WordPress into Firemonkey app actually mean. Can you give more detail.
-
Yeah, you can't jump back in can you. You have to start again from scratch.
-
Based on historical experience this seems wildly optimistic!
-
It's really for you to decide. You have to test your app. We can't know what issues you will face. The big question to ask your self is what are the benefits and do they out weight the downsides which are primarily risk of new defects.
-
DUnitX: How can I load HTML files within unit test?
David Heffernan replied to JamieR's topic in General Help
You need a mock. There are lots of mocking frameworks around. Are you using one? -
Long term availability of Community Edition
David Heffernan replied to JkEnigma's topic in General Help
If anybody can tell us about the long term availability of the community edition would they also be so kind as to tell me about the long term availability of me. -
Interesting way to copy dynamic arrays.
David Heffernan replied to pyscripter's topic in RTL and Delphi Object Pascal
What would be nice would be if Emba could add a MakeUnique(arr) so that you could write code like with with clear intent -
Interesting way to copy dynamic arrays.
David Heffernan replied to pyscripter's topic in RTL and Delphi Object Pascal
Why would that be different?