bbSystemProperty - all returning the same?

Archives Forums/Blitz3D SDK Programming/bbSystemProperty - all returning the same?

bytecode77(Posted 2010) [#1]
hello,

I'm currrently playing with the SDK and i'm looking forward to implement some stencil shadows and shadars.
the problem is that the systemproperty function returns the same integer value, no matter what string you provide.
is this a bug or am I doing something wrong?

there won't be any reply for another 3 weeks, i guess. but if you read this, please help me out! there are no stencil shadows where there is no systemproperty...
thank you.

[DllImport("Blitz3D.dll")]
static private extern int bbSystemProperty(string property);
....
....
int x = bbSystemProperty("Direct3D7");
int y = bbSystemProperty("Direct3DDevice7");
int z = bbSystemProperty("AppHINSTANCE");
// x == y == z ... all the same



MCP(Posted 2010) [#2]
Yes you are, bbSystemProperty actually returns a string pointer containing numerical information in ascii format and NOT int as in the second line of the code above. Hope that helps DC :)


bytecode77(Posted 2010) [#3]
wow! works!
        [DllImport("Blitz3D.dll")]
        [return: MarshalAs(UnmanagedType.AnsiBStr)]
        static private extern string bbSystemProperty(string property);
thanks a lot! i can has stencil shadows

edit: i think i got over-excited. the "AppHWND" property returns an empty string... :(


MCP(Posted 2010) [#4]
Hi DC, I'm assuming you are programming in C# (which I know little about unfortunately!) I personallly code in either C++ or PureBasic these days and all I can say is bbSystemProperty has always returned correct results in strings for those languages with latest Blitz3DSDK.
However, there are always good alternatives to AppHWND and I've found a good link for c# programmers below...

FindWindow in C#


bytecode77(Posted 2010) [#5]
i know how to find window handles with c#, but there is more to that. look:
Direct3D7 - good
Direct3DDevice7 - good
DirectDraw7 - good
AppHWND - bad
AppHINSTANCE - bad

i can't find both hwnd and hinstance because it returns an empty string.
using SetBlitz3DHWND to use my own window doesn't really work either...


MCP(Posted 2010) [#6]
A good candidate for a bug report I think! In the mean time you can use other means to find application HWND, HINSTANCE so
it's not such a setback for what you want to do project-wise I think.

I'll be looking forward to seeing your shadow system when it's finished :)


bytecode77(Posted 2010) [#7]
Well, Blitz3D SDK costs 100 bucks and has 100 bugs, so I posted one of them in the bug section.

I will try to do this using c#, until it gets fixed.
thanks for your help dude!