Page 3 of 4

Re: Cpp 2 PB translation but understanding

Posted: Fri May 12, 2017 3:57 pm
by LiK137
I think You have to look to see the problem with Longs, Quads and Assertion

Re: Cpp 2 PB translation but understanding

Posted: Fri May 12, 2017 5:58 pm
by Olliv
uh?

You re right : I have to look big headaches this end of week !

Re: Cpp 2 PB translation but understanding

Posted: Fri May 12, 2017 7:06 pm
by LiK137
Thank You for reply.
In the attachment the Luxand Face SDK.

The strange thing is that sample (C++, C#, Java, VB.Net and VB) codes are working. Means Dll engine is not buggy. But in PureBasic it malfunctions but shouldn't.

Up to FSDK_FeedFrame is OK. After is obscure.

Re: Cpp 2 PB translation but understanding

Posted: Sat May 13, 2017 10:42 pm
by Olliv
I think the main problem is the choice of types you took.

I can see :
#fsdNGn="fsdk_62_64.dll"

It is 64 bits version.

All your outputs have 32 bits :

PrototypeC.l

dot l = dot long = 32 bits (on pb)

Change it to "dot I" (uppercase i) to have 64 bits :

PrototypeC.I

(replace function on edit menu in IDE)

Re: Cpp 2 PB translation but understanding

Posted: Sun May 14, 2017 12:42 am
by LiK137
Thanx, let me try and write result

Re: Cpp 2 PB translation but understanding

Posted: Sun May 14, 2017 11:24 am
by LiK137
Hi Olliv,
According to Your recommendation I fixed problems in includefile, changed PrototypeC.l to PrototypeC.I
But did You success obtaining FaceCount, IDs and FacePosition in Tracker? I couldn't...

Re: Cpp 2 PB translation but understanding

Posted: Sun May 14, 2017 12:23 pm
by Olliv
If I have availability with test, I ll do a test.

Re: Cpp 2 PB translation but understanding

Posted: Thu May 18, 2017 4:48 pm
by LiK137
Hope next release will solve, lets wait for next pb release

Re: Cpp 2 PB translation but understanding

Posted: Wed May 24, 2017 11:29 pm
by Olliv
Also... I go and read what new about such a bug I do not imagine from compiler actually unless I looped a message in a bug report...

Re: Cpp 2 PB translation but understanding

Posted: Thu May 25, 2017 12:10 am
by Olliv
No! I did not find bug report message... So, I will get your source code containing listing of PrototypeC, and check each type of variable helped by the on-line doc...

Re: Cpp 2 PB translation but understanding

Posted: Thu May 25, 2017 12:16 am
by Olliv
But... What did happen about this listing of PrototypeC ?

Well, it's not a problem... I just need the on-line doc...

Re: Cpp 2 PB translation but understanding

Posted: Thu May 25, 2017 5:51 am
by Olliv
Let's see this macro named 'external'.
It just removes a little bit of typing and of boring tests.

Could you test it, inserting the DLL file name and inserting key code string?

I typed a list of displayed value I want you to report here as result.

Code: Select all

;****************************************************************************************************************************************************************************************

Macro Quote
        "
EndMacro

Macro External(arg, arg0 =, arg1 =, arg2 =, arg3 =, arg4 =, arg5 =, arg6 =)
        CompilerIf Quote#arg1#Quote <> ""
                CompilerIf Quote#arg2#Quote <> ""
                        CompilerIf Quote#arg3#Quote <> ""
                                CompilerIf Quote#arg4#Quote <> ""
                                        CompilerIf Quote#arg5#Quote <> ""
                                                CompilerIf Quote#arg6#Quote <> ""
                                                        PrototypeC arg(arg0, arg1, arg2, arg3, arg4, arg5, arg6)
                                                CompilerElse
                                                        PrototypeC arg(arg0, arg1, arg2, arg3, arg4, arg5)
                                                CompilerEndIf
                                        CompilerElse
                                                PrototypeC arg(arg0, arg1, arg2, arg3, arg4)
                                        CompilerEndIf
                                CompilerElse
                                        PrototypeC arg(arg0, arg1, arg2, arg3)
                                CompilerEndIf
                        CompilerElse
                                PrototypeC arg(arg0, arg1, arg2)
                        CompilerEndIf
                CompilerElse
                        PrototypeC arg(arg0, arg1)
                CompilerEndIf
        CompilerElse
                PrototypeC arg(arg0)
        CompilerEndIf
        Define arg.arg = GetFunction(Library, Quote#FSDK_#arg#Quote)
EndMacro







Define.S DllName = "" ; Please insert dll file immediate string /!\
Define.S License = "" ; Please insert dll key immediate string /!\

Define.I Library = OpenLibrary(#PB_Any, DllName)

If Library
        
        External(ActivateLibrary, License.P-Unicode)
        ;External(ActivateLibrary, License.P-ASCII)
        
        
        Debug #PB_Compiler_Unicode
        Debug DllName
        Debug Library
        Debug ActivateLibrary
        Debug ActivateLibrary(License)
        
EndIf

Re: Cpp 2 PB translation but understanding

Posted: Thu May 25, 2017 6:41 am
by Olliv
Ups... I removed ' = 0 ' which cancels the load test.
Without DLL, I just get empty values :

Code: Select all

1

0
0
Normally, you get more informations than just some zeros and spaces.

I wait your report...

Re: Cpp 2 PB translation but understanding

Posted: Thu May 25, 2017 9:22 am
by LiK137
Hi,
what is the benefit of using macroway?

Re: Cpp 2 PB translation but understanding

Posted: Fri May 26, 2017 8:57 am
by Olliv
The economy of syntax.

Here, I allow you
to declare a function simply.

Code: Select all

External(myFunction, arg1, arg2)
what enables this below

Code: Select all

; call of function
myFunction(2, 3)
Sure that 'invoking' just one time a macro does not seem to be useful. But this subject is not static. We are moving around an executing access error between a external library and pb.

This presents many questions and this forces us to make points of view to respond to the problem.

1) A macro allows you to get just one-line solution.

2) Here, we want to handle any calls of external functions.

3) You observe two problems :

3a) Root language assertion failure.
3b) Bad values resulting from one of the executing extern functions.

Technically, a function, wherever it comes from, it is ever the exchange of local variables.
Each variable has a defined type.
Each type has one, or many, format(s).
In the way of the 'string' type, there is 'sub-formats' too.

Sure that a global macro is root of headaches. That is the reason you can see two macros in this subject. And I think a third and a fourth macro should be required : this depends of the values you can report.