Search found 14 matches

by clover
Wed Sep 01, 2010 3:43 pm
Forum: Coding Questions
Topic: Invalid mem access when I use COM
Replies: 1
Views: 783

Re: Invalid mem access when I use COM

I've managed to resolve it. The methods of a interface must be declared in proper order. e.g.
Interface IMMDevice Extends IUnknown
Activate.l(*iid.IID, dwClsCtx.l, *pActivationParams, *ppInterface)
OpenPropertyStore.l(stgmAccess.l, *ppProperties.IPropertyStore)
GetId.l(*pwstrId.String)
GetState ...
by clover
Thu Aug 26, 2010 4:46 pm
Forum: Coding Questions
Topic: Invalid mem access when I use COM
Replies: 1
Views: 783

Invalid mem access when I use COM

The OS is Windows 7, I wanna control the system's volume. So after referring to some demo code, I tried to edit my code as follows. But unfortunately, I encountered invalid memory access reported by the compiler. I don't know what was wrong with my code, so please help me.

#CLSCTX_INPROC_SERVER ...
by clover
Tue Jul 20, 2010 3:53 am
Forum: Coding Questions
Topic: PlaySound() in end of Thread
Replies: 6
Views: 1731

Re: PlaySound() in end of Thread

Below is a section of code for attaining the duration of FLAC audio files:

Procedure.i GetFlacDuration(*pData) ;return milliseconds
If *pData = #Null
ProcedureReturn 0
EndIf

If PeekS(*pData, 4, #PB_Ascii) <> "fLaC"
ProcedureReturn 0
EndIf

mbs.METADATA_BLOCK_STREAMINFO
CopyMemory(*pData ...
by clover
Tue Jul 20, 2010 3:48 am
Forum: Coding Questions
Topic: PlaySound() in end of Thread
Replies: 6
Views: 1731

Re: PlaySound() in end of Thread

It seems that PlaySound() implements asynchronously. So you can get the total duration of the sound in advance of playing, then call Sleep() and set the param to the duration you have just got. And then... all is OK!
As for the way of getting the duration of the sound, you can refer to relative ...
by clover
Tue Jul 20, 2010 2:38 am
Forum: Coding Questions
Topic: How to draw an icon by 2DDrawing lib?
Replies: 1
Views: 829

How to draw an icon by 2DDrawing lib?

Now I have got the handle of an icon by API such as ExtractIcon(). Of course I can use API function DrawIcon() to display it easily. But how can I manage to diaplay it by PB 2DDrawing lib? Because there is no such a function that takes a handle as its parameter in PB 2DDrawing lib. That is to say, I ...
by clover
Thu Jun 24, 2010 9:36 am
Forum: Coding Questions
Topic: Does PB regard .c in API structures as one byte in any case?
Replies: 3
Views: 850

Does PB regard .c in API structures as one byte in any case?

I was confused about it for a long time.

Sometimes I need to compile my code in unicode mode. Generally, I found there are two kinds of declaration concerned with string in API structures, e.g.

[prototype with C from MSDN]
typedef struct _WIN32_FIND_DATA { // wfd
DWORD dwFileAttributes ...
by clover
Mon Jun 14, 2010 8:45 am
Forum: Coding Questions
Topic: Can I call a procedure by its pointer?
Replies: 12
Views: 2726

Re: Can I call a procedure by its pointer?

Oh, thank you very much, Josh & Comtois.
I was nearly forgot it, what a useful function -- CallCFunctionFast()!
by clover
Mon Jun 14, 2010 8:35 am
Forum: Coding Questions
Topic: Can I call a procedure by its pointer?
Replies: 12
Views: 2726

Can I call a procedure by its pointer?

I want to call a procedure which has several parameters as followed:

Code: Select all

Procedure FuncA(param1.l, param2.l)
    ;......
EndProcedure

Define *p = @FuncA()
Now the problem is how could I manage to call it with *p just like C language:

Code: Select all

(*p)(param1, param2);
by clover
Mon Dec 21, 2009 11:39 am
Forum: Coding Questions
Topic: What does #PB_Function mean?
Replies: 7
Views: 1140

Re: What does #PB_Function mean?

Get it! ts-soft, thanks!
by clover
Sun Dec 20, 2009 4:16 pm
Forum: Coding Questions
Topic: What does #PB_Function mean?
Replies: 7
Views: 1140

Re: What does #PB_Function mean?

ts-soft wrote:A Procedure is selfwritten in your source, a function is buildin (incl. userlibfunction)
So difference between #PB_OSFunction & #PB_Function ?
by clover
Sun Dec 20, 2009 4:08 pm
Forum: Coding Questions
Topic: What does #PB_Function mean?
Replies: 7
Views: 1140

What does #PB_Function mean?

There are several new constants in new 4.40 ver. Such as "#PB_Function". I cannot find help about it and guess it's equal to #PB_Procedure, isn't it? Please teach me, thanks a lot!
by clover
Sun Jan 18, 2009 10:34 am
Forum: Announcement
Topic: A cute owner draw menu DLL (full Ver.)
Replies: 17
Views: 8419

To User_Russian:

It seems that PB is particular with .rc file, that is, you must use absolute file path.
I encountered the same error when I was compilying the "Cute Menu.pb" with the .rc file edited by VC++.
To solve this problem, I edited the .rc file manually as following:

IDB_BITMAP1 BITMAP ...
by clover
Sat Jan 17, 2009 9:15 am
Forum: Announcement
Topic: A cute owner draw menu DLL (full Ver.)
Replies: 17
Views: 8419

Full version released, download and enjoy it!
by clover
Tue Dec 30, 2008 2:15 pm
Forum: Announcement
Topic: A cute owner draw menu DLL (full Ver.)
Replies: 17
Views: 8419

A cute owner draw menu DLL (full Ver.)

Introduction
This DLL acts to make the menu more beautiful. The way it works is based on the existent menu and you will find it quite convenient to use it.


Characteristics
1) The code completely depends on the existent MENUITEMINFO structure and didn't allocate any structure array that store ...