Jump to content

JeanCremers

Members
  • Content Count

    26
  • Joined

  • Last visited

Community Reputation

1 Neutral

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. JeanCremers

    communicate between 2 progs with sendmessage.

    Thanks a bunch again Remy, i've got it working like a charm.
  2. JeanCremers

    communicate between 2 progs with sendmessage.

    Thanks Remy. I'm getting EOSError 'System Error. Code 1411, Class does not exist.' This is c++builder 6 🙂 Edit, i also tried void __fastcall TAstroClockMainForm::ApplicationEvents1Message(tagMSG &Msg, bool &Handled) { if (Msg.message == WM_APP) Application->MessageBox("", "", MB_OK); } and HWND hwnd = FindWindow("TAstroclockMainForm", NULL); if (hwnd) SendMessage(hwnd, WM_APP, 0, 0);
  3. Ok, so one prog does for instance HWND hwnd = FindWindow(NULL, "myprog"); if (hwnd) SendMessage(hwnd, WM_USER, 0, 0); And what exactly should the other prog do? I have this, but it's not working. in form constructor Application->HookMainWindow(&AppHook); bool __fastcall TMainForm::AppHook(TMessage &Message) { if (Message.Msg == WM_USER) { Application->MessageBox("", "", MB_OK); return true; } return false; } But i'm not getting any msg there. Thanks.
  4. JeanCremers

    IsZero or SameValue

    Can't do, i need type double, its for a script language and it has no currency type, but it has double. And this works for my needs.
  5. JeanCremers

    IsZero or SameValue

    I'm ok with my current solution, it does what i need it to do.
  6. JeanCremers

    IsZero or SameValue

    ps, it's not only meant for doing 0.1 , it should also handle other values.
  7. JeanCremers

    IsZero or SameValue

    I'm doing something like this, for my purposes it works fine. double r = 0.1, inc = 0.1; String S; for (int i = 0; i < 80; i++) { S = FloatToStr(r); r = StrToFloat(S) + inc; ListBox1->Items->Add(S);
  8. JeanCremers

    IsZero or SameValue

    Why not use a string? FloatToStr(0.1) always makes "0.1", so it avoids the rounding error.
  9. JeanCremers

    IsZero or SameValue

    🙂 Thanks. I tried the multiply/divide trick, but not with 10 but with 100000 and ran into similar problems. Converting to a string and back to a float at least seems to work against the cumulative issue.
  10. JeanCremers

    IsZero or SameValue

    So i thought 0.1 was representable in floating point, obviously not. How do i use IsZero() or SameValue in a situation like this. updownbuttonclick(TObject *Sender, TUDBtnType Button) { value += (Button == btNext ? 0.1 : -0.1); } What i'm doing now is convert value to a string and then back to fp, this eliminates the cumulative rounding error. How to tackle this with one of those math functions? Thanks.
  11. JeanCremers

    floating point error, [solved].

    Duh, i thought 0.1 was representable in FP. Thanks, now i don't have to worry myself to death anymore.
  12. JeanCremers

    floating point error, [solved].

    Hm, after reading your links i'm not so sure anymore. But i do get 0.1 - 0.1 = 0 most of the time, only sometimes not.
  13. JeanCremers

    floating point error, [solved].

    Hello, I found a strange complier/linker bug. I'm still using bcb 6 but i thought i'd check with c++builder 10.4 and lo and behold, there's the same bug. Look at the image, it says it all, the result should be zero but it's not. You can see the result in the caption, it's always this number 2.77etc E-17. I've also seen it happen with 10 - 0.1 giving 9.911111 or something. Man i feel bad, i made my life's work with this. Please try this yourself.
  14. JeanCremers

    update indy to use tls 1.2 in c++builder 6?

    Proud to say I have been an official borland betatester for a short while, around c++builder 1 that was, even got a thanks for my report. Till next time 🙂
  15. JeanCremers

    update indy to use tls 1.2 in c++builder 6?

    It's working great Remy. A progressbar on the testapp to show download progress! Your name already was in the credits and again you contributed to my program, many thanks again. Good old TeamB, i miss those times, Kent Reisdorph and all.. Does it still exist? ps, void __fastcall OnWorkHandler(void *AData, TObject *ASender, TWorkMode AWorkMode, __int64 AWorkCount) should be: void __fastcall OnWorkHandler(TObject *ASender, TWorkMode AWorkMode, __int64 AWorkCount)
×