Search found 140 matches

by auser
Fri Nov 14, 2014 8:47 am
Forum: Coding Questions
Topic: Linux chmod_()
Replies: 6
Views: 3535

Re: Linux chmod_()

0755 is wrong. It would be 493 in that case. You could use strtol() to get your value:

Code: Select all

chmod_("/etc/cron.daily/fstrim",strtol_("0755",0,8))
by auser
Fri Oct 24, 2014 7:31 am
Forum: Coding Questions
Topic: Is this code safe?
Replies: 2
Views: 1936

Re: Is this code safe?

If you would increase the safety then I would recommend to add some "If". "If AddElement" and "If FirstElement" to make sure your elements are available before you are going to use them. However your list does not consume much memory anyway. You lock, add the first element, switch to the first and ...
by auser
Thu Oct 23, 2014 9:17 am
Forum: General Discussion
Topic: How to translate from PB PeekI() to C++?
Replies: 5
Views: 3885

Re: How to translate from PB PeekI() to C++?

In PB we need various PeekA(), PeekB(), PeekC(), PeekL(), PeekI(), PeekQ() and PokeA(), PokeB(), PokeC(), PokeL(), PokeI(), PokeQ() and so on. In C we just need *. The compiler knows the type because we are forced to declare it in C.

That means in C translated to PB (while there is no such ...
by auser
Thu Aug 21, 2014 4:48 pm
Forum: Coding Questions
Topic: Pointer to an array inside of a structure
Replies: 19
Views: 5514

Re: Pointer to an array inside of a structure

The MIB_IFROW structure looks pretty different to the version you've posted in your example: http://msdn.microsoft.com/en-us/library/windows/desktop/aa366836%28v=vs.85%29.aspx ...and it looks like pdwSize is telling you the size of the buffer anyway. So I think you could just give it an pointer to a ...
by auser
Thu Aug 21, 2014 3:58 pm
Forum: Coding Questions
Topic: Pointer to an array inside of a structure
Replies: 19
Views: 5514

Re: Pointer to an array inside of a structure

I did not know that that memory-overlap is supported. I'm not really sure what you need exactly. If you don't need pointer why you don't use just table.MIB_IFROW[2] afterwards? Maybe you could try this:


Structure MIB_IFROW
dwIndex.l
EndStructure

Structure MIB_IFTABLE1
dwNumEntries.l
table.MIB ...
by auser
Thu Aug 21, 2014 2:42 pm
Forum: Coding Questions
Topic: Pointer to an array inside of a structure
Replies: 19
Views: 5514

Re: Pointer to an array inside of a structure

I don't see a bug here (except probably that PB allows creation of an static array with 0 size without warning).


Structure MIB_IFROW
dwIndex.l
EndStructure

Structure MIB_IFTABLE1
dwNumEntries.l
*table.MIB_IFROW[2]
EndStructure

Define MIBIfTable.MIB_IFTABLE1

Debug SizeOf(MIB_IFTABLE1 ...
by auser
Wed Aug 20, 2014 1:12 pm
Forum: Windows
Topic: Difficulty opening window in a thread PB5.11
Replies: 11
Views: 8962

Re: Difficulty opening window in a thread PB5.11

I did not found a good solution for that issue as well. PostEvent() does not really help (or it just helps in few cases and only in one direction).

If you need some new thread that is similar to a new process as if you click on "something.exe" in windows-explorer and the only information that have ...
by auser
Thu Jul 31, 2014 2:32 pm
Forum: Windows
Topic: Hyperlinkgadget Focus / Taborder
Replies: 1
Views: 2076

Hyperlinkgadget Focus / Taborder

Is it possible to enable Focus / Taborder for HyperlinkGadget() e.g. like "#PB_Canvas_Keyboard|#PB_Canvas_DrawFocus" for CanvasGadget? I need this just for windows-OS.
by auser
Fri Mar 21, 2014 8:52 am
Forum: Linux
Topic: [PB5.22LTS] MessageRequester and Threads
Replies: 16
Views: 8310

Re: [PB5.22LTS] MessageRequester and Threads

uses the graphical primitives of x11 directly
Guess you are right. At least it seems there is no limitation in x11 itself but just in the GUIs.
by auser
Thu Mar 20, 2014 4:32 pm
Forum: Linux
Topic: [PB5.22LTS] MessageRequester and Threads
Replies: 16
Views: 8310

Re: [PB5.22LTS] MessageRequester and Threads

luis wrote: It's not surprising it works under wine.
I don't wonder if it works but how it works via wine especially if the major linux-guis lacks that behavior. I even tried to play a bit with fork_() and so on but got some strange results.
by auser
Thu Mar 20, 2014 2:28 pm
Forum: Linux
Topic: [PB5.22LTS] MessageRequester and Threads
Replies: 16
Views: 8310

Re: [PB5.22LTS] MessageRequester and Threads

I wonder how wine (acronym "Wine Is Not an Emulator") handles that issue because running the example which was posted on the top does not crash the program if it was compiled on windows and started on linux via "wine test.exe" and even the timer continues to run (so it seems to be a different thread ...
by auser
Thu Mar 20, 2014 11:49 am
Forum: Linux
Topic: [PB5.22LTS] MessageRequester and Threads
Replies: 16
Views: 8310

Re: [PB5.22LTS] MessageRequester and Threads


gdk_threads_enter has been deprecated since version 3.6 and should not be used in newly-written code. All GDK and GTK+ calls should be made from the main thread


In my opinion it's a shame and a step backwards regarding freedom and modular design. GUI is just one part of a software that have to ...
by auser
Thu Mar 20, 2014 9:30 am
Forum: Linux
Topic: [PB5.22LTS] MessageRequester and Threads
Replies: 16
Views: 8310

Re: [PB5.22LTS] MessageRequester and Threads


Using windows, the program runs fine.


I'm a linux-fanboy and used linux based OS for years almost exclusive at my own stuff. However that "windows processing have to be in the mainthread crap" (in the 21st century with multicore processors and GPUs that do lots of parallel processing and own ...
by auser
Thu Mar 13, 2014 2:39 pm
Forum: Linux
Topic: Debugger missing at IMA :(
Replies: 6
Views: 3973

Re: Debugger missing at IMA :(

I had a further "crash" of my application. Well at least it _should_ crash because I've got a segfault reported from the Error-Handler:


Error-message: Segmentation violation
Error-code: 11
Code-address: 139690827377649
Target-address: 0
Source-line: 1044
Source-file: srv_serv85.pb


However ...
by auser
Wed Feb 26, 2014 4:48 pm
Forum: Linux
Topic: Debugger missing at IMA :(
Replies: 6
Views: 3973

Re: Debugger missing at IMA :(

Did you try onerror ?

Thanks for the hint. Edit: I've tried with OnError and put 2 FreeMemory in a raw now. It's telling some wrong line without the debugger. Anyway compiling with "-l -t -pf -ds -d" reported the wrong faulty line on OnError... at least most time (it even yet again reported some ...