Hi!
Global my_lib.l
my_lib=OpenLibrary(#PB_Any, "version.dll")
Debug Str(my_lib)+" = $"+Hex(my_lib)
If my_lib = 0:End:EndIf
GetFunction(my_lib,"GetFileVersionInfoA")
(I wasn't actually using version.dll, this is just an example.)
Works with PB6.00 x64, crashes with PB6.10 x64.
The reason ...
Search found 13 matches
- Wed Apr 10, 2024 8:26 pm
- Forum: Coding Questions
- Topic: PB 6.10 x64 OpenLibrary
- Replies: 6
- Views: 1368
- Thu May 19, 2022 11:57 am
- Forum: Coding Questions
- Topic: Defining Macros in one line
- Replies: 7
- Views: 1103
Re: Defining Macros in one line
If nobody can explain why this happens, I call it a bug and will repost it in the bugs forum, or can someone move this topic?
- Wed May 11, 2022 2:23 pm
- Forum: Coding Questions
- Topic: Defining Macros in one line
- Replies: 7
- Views: 1103
Re: Defining Macros in one line
BTW: The DoubleQuote feels like a hack. It would be better to have a special character as prefix or postfix to the parameter name and the macro processor would automatically stringify it, like in this example Debug x$ or $x or #x or ##x or whatever. But I don't think this exists, right?
There ...
- Wed May 11, 2022 1:17 pm
- Forum: Coding Questions
- Topic: Defining Macros in one line
- Replies: 7
- Views: 1103
Defining Macros in one line
Hi!
I came across a strange behavior. What exactly is the difference between defining a macro one line (with ":") and in mutilple lines?
Is it even allowed to define a macro in one line?
Example:
Macro DoubleQuote
"
EndMacro
Macro Test1(x):Debug DoubleQuote#x#DoubleQuote:EndMacro
Macro Test2 ...
I came across a strange behavior. What exactly is the difference between defining a macro one line (with ":") and in mutilple lines?
Is it even allowed to define a macro in one line?
Example:
Macro DoubleQuote
"
EndMacro
Macro Test1(x):Debug DoubleQuote#x#DoubleQuote:EndMacro
Macro Test2 ...
- Thu Mar 20, 2014 2:06 pm
- Forum: Linux
- Topic: [PB5.22LTS] MessageRequester and Threads
- Replies: 16
- Views: 8072
Re: [PB5.22LTS] MessageRequester and Threads
I tried my example with your gdk_threads_enter_()/_leave() additions.
It does not crash but it is far away from working properly. On my linux machine, it takes a few seconds (!) for the Requester to appear properly and then yes, the clock starts running but the program is very unreactive.
And the ...
It does not crash but it is far away from working properly. On my linux machine, it takes a few seconds (!) for the Requester to appear properly and then yes, the clock starts running but the program is very unreactive.
And the ...
- Thu Mar 20, 2014 1:11 pm
- Forum: Linux
- Topic: [PB5.22LTS] MessageRequester and Threads
- Replies: 16
- Views: 8072
Re: [PB5.22LTS] MessageRequester and Threads
Thanks for all your quick replies. Too bad that it's not fixable.
I have to change my program accordingly.
The gdk_threads_enter_()/_leave() stuff wouldn't have helped I guess because it would have stopped the mainloop from running also.
Maybe a small hint could be added to the help text of ...
I have to change my program accordingly.
The gdk_threads_enter_()/_leave() stuff wouldn't have helped I guess because it would have stopped the mainloop from running also.
Maybe a small hint could be added to the help text of ...
- Wed Mar 19, 2014 6:16 pm
- Forum: Linux
- Topic: [PB5.22LTS] MessageRequester and Threads
- Replies: 16
- Views: 8072
[PB5.22LTS] MessageRequester and Threads
Hello!
I'm trying to port an application from Windows to Linux. I'm having trouble with threads, though I enabled ThreadSafe compiling.
Here is a small example code:
Procedure About(*dummy)
MessageRequester("Requester","Click ok")
EndProcedure
OpenWindow(0, 0, 0, 220, 70, "Example", #PB_Window ...
I'm trying to port an application from Windows to Linux. I'm having trouble with threads, though I enabled ThreadSafe compiling.
Here is a small example code:
Procedure About(*dummy)
MessageRequester("Requester","Click ok")
EndProcedure
OpenWindow(0, 0, 0, 220, 70, "Example", #PB_Window ...
- Thu May 31, 2007 12:09 am
- Forum: Coding Questions
- Topic: Null Over Network?
- Replies: 4
- Views: 1378
SendNetworkString is for sending strings...
RTmich, SendNetworkString is for sending strings. Strings are some characters terminated by a null character . This cannot be changed.
You really need to use SendNetworkData.
There are several ways to get the data in place in memory like you need it.
One way would be to Poke it to memory like in the ...
You really need to use SendNetworkData.
There are several ways to get the data in place in memory like you need it.
One way would be to Poke it to memory like in the ...
- Wed May 30, 2007 11:57 pm
- Forum: Coding Questions
- Topic: Include binary problem
- Replies: 11
- Views: 2906
Should be simple
Try this:
file_1_begin:
IncludeBinary "data.hex"
file_1_end:
[...]
size=?file_1_end-?file_1_begin
ComWrite(Hcom, ?file_1_begin, size)
or in smaller blocks to get the progressbar running:
written=0
size=?file_1_end-?file_1_begin
*ptr=?file_1_begin
While written<size
bs=256
If bs>(size ...
file_1_begin:
IncludeBinary "data.hex"
file_1_end:
[...]
size=?file_1_end-?file_1_begin
ComWrite(Hcom, ?file_1_begin, size)
or in smaller blocks to get the progressbar running:
written=0
size=?file_1_end-?file_1_begin
*ptr=?file_1_begin
While written<size
bs=256
If bs>(size ...
- Wed May 30, 2007 11:30 pm
- Forum: Coding Questions
- Topic: PB4 Mac B1: ListviewGadget not supportet?
- Replies: 2
- Views: 809
Try adding an item
The events
#PB_EventType_LeftClick
#PB_EventType_LeftDoubleClick
of a ListViewGadget are only fired if you click on an item of the gadget.
Since your ListViewGadget is empty, no events are created.
Try to add the line AddGadgetItem(#Listview_0, -1, "My first ListView Item") after the ListViewGadget ...
#PB_EventType_LeftClick
#PB_EventType_LeftDoubleClick
of a ListViewGadget are only fired if you click on an item of the gadget.
Since your ListViewGadget is empty, no events are created.
Try to add the line AddGadgetItem(#Listview_0, -1, "My first ListView Item") after the ListViewGadget ...
- Thu May 24, 2007 11:42 pm
- Forum: Announcement
- Topic: PureBasic 4.01 for Linux
- Replies: 20
- Views: 11466
Had to edit the url manually
Thanks for the new 4.01 linux version!
BTW:
In the download area - after logging in - the link now states
Download PureBasic 4.01 full version for Linux but the link goes to the old 4.00 version. Had to edit the URL manually to grab the 4.01...
To check if it is really 4.01, I untared and opened ...
BTW:
In the download area - after logging in - the link now states
Download PureBasic 4.01 full version for Linux but the link goes to the old 4.00 version. Had to edit the URL manually to grab the 4.01...
To check if it is really 4.01, I untared and opened ...
- Sun Apr 22, 2007 12:10 am
- Forum: Coding Questions
- Topic: Arithmetric expressions
- Replies: 7
- Views: 1453
Arithmetric expressions
Hello!
I tend to use arithmetric expressions without the = sign. At first I thought when I write a * some_expression it would be the same as a=a*(some_expression) But "some_expression" is not necessarily evaluated first and then multiplied with "a" and the result stored in "a".
It is more like a=a ...
I tend to use arithmetric expressions without the = sign. At first I thought when I write a * some_expression it would be the same as a=a*(some_expression) But "some_expression" is not necessarily evaluated first and then multiplied with "a" and the result stored in "a".
It is more like a=a ...
- Thu Nov 30, 2006 3:23 am
- Forum: Coding Questions
- Topic: Very strange bug hard to understand (.b types related ? )
- Replies: 8
- Views: 1751
It's not a bug in PB
I had a look at your code.
The problem is that in your inline assembly line
!fistp dword[v_MustDelay];<- MustDelay=DispPeriod-(checkpoint2-checkpoint1)/SysFreq.
you store 32bits at the address of your variable MustDelay which is only 8bits wide, which is why your variable PCODE (also 8bits) gets ...
The problem is that in your inline assembly line
!fistp dword[v_MustDelay];<- MustDelay=DispPeriod-(checkpoint2-checkpoint1)/SysFreq.
you store 32bits at the address of your variable MustDelay which is only 8bits wide, which is why your variable PCODE (also 8bits) gets ...