Author Topic: Windows Example Problems Under Vista.  (Read 5158 times)

0 Members and 1 Guest are viewing this topic.

Offline Clyde

  • A Little Fuzzy Wuzzy
  • DBF Aficionado
  • ******
  • Posts: 7271
  • Karma: 71
    • View Profile
Windows Example Problems Under Vista.
« on: October 01, 2008 »
Hi there,

I want to look into Windows GUI / Skinable apps; but for some reason when I try to compile and run any of the Windows examples and with FBIDE, I get the following.

Code: [Select]
Unable To Open Output file "dir and filename.exe"
Permission Denied.

Wondered if anyone else has been graced with this problem?

Cheers,
Clyde.
Still Putting The IT Into Gravy
If Only I Knew Then What I Know Now.

Challenge Trophies Won:

Offline Clyde

  • A Little Fuzzy Wuzzy
  • DBF Aficionado
  • ******
  • Posts: 7271
  • Karma: 71
    • View Profile
Re: Windows Example Problems Under Vista.
« Reply #1 on: October 02, 2008 »
Ok, think I've found the solution in Vista, and have to set FBIDE to run as Adminstrator.
I will be asking further questions on Windows stuff in FB in new topics at some stage.
Still Putting The IT Into Gravy
If Only I Knew Then What I Know Now.

Challenge Trophies Won:

Offline Hezad

  • Sponsor
  • Pentium
  • *******
  • Posts: 613
  • Karma: 44
  • I believe .. in Patrick.
    • View Profile
    • Hezad.com Web hosting
Re: Windows Example Problems Under Vista.
« Reply #2 on: October 02, 2008 »
'glad you found the solution :)

And if you have another problems linked to windows, don't hesitate to ask on the Windows section of the official FB forums too, I guess there will surely be someone to answer you :)

Offline Clyde

  • A Little Fuzzy Wuzzy
  • DBF Aficionado
  • ******
  • Posts: 7271
  • Karma: 71
    • View Profile
Re: Windows Example Problems Under Vista.
« Reply #3 on: October 02, 2008 »
Cheers mate, one thing I am wondering on, is how to render and load images, as im so used to using TinyPTC, and bin2bas / bmp2raw for image handling.
Still Putting The IT Into Gravy
If Only I Knew Then What I Know Now.

Challenge Trophies Won:

Offline Hezad

  • Sponsor
  • Pentium
  • *******
  • Posts: 613
  • Karma: 44
  • I believe .. in Patrick.
    • View Profile
    • Hezad.com Web hosting
Re: Windows Example Problems Under Vista.
« Reply #4 on: October 02, 2008 »
I'm afraid I don't understand :/ What do you mean by rendering and loading images ? On the fb's graphic screen ? Or on a windows dialog ?

If it's on a windows dialog, I can't help with the API since I don't know anything about it. But You can use the IUP library which is a pretty easy way to handle dialogs and controls (images too, and there is even an Open GL canvas you can control easily :D)

If it's on the FB's graphic screen, you can use bload to load a bmp and put to render it.

But maybe I misunderstood, sorry if you already knew all that. Don't know if I can be of any help but if so, don't hesitate :D

Offline Clyde

  • A Little Fuzzy Wuzzy
  • DBF Aficionado
  • ******
  • Posts: 7271
  • Karma: 71
    • View Profile
Re: Windows Example Problems Under Vista.
« Reply #5 on: October 02, 2008 »
Hmmm, maybe my solution doesnt work for all examples, the gui menus example is one ive tried, it runs but has a white background window with nothing else showing up on it.

How I use graphics ( 256 Colour Bitmaps ) is by converting them using the tools by RBZ ( Bmp2Raw And Bin2Bas ) that puts the raw and palette information as bytes into seperate arrays ( one for each ). I then draw them using tinyptc, and not FB graphics lib. This way benefits in 2 ways, lower file size, and also a bit tricky to rip out the media. probably possible, but I dont go near that side of things.

My main concern is, that I dont quite know how I'd go about rendering them for use in a Windows App environment ( What Im hoping to one day achieve is a skinable application ( I think thats what its called ) similar to WinAmp / Camouflage Music disk by GVY-DBF - coded by the mighty RBZ ). Maybe I should start a new topic, once the Windows stuff actually works properly for me.

If there are any Vista 32-bit Freebasic users among us, I wonder if you know the correct solution? If not, I best head over to the official FB forums with my alter ego, and post back any findings I have, ( if any )

Cheers and many thanks for your interest and reading,
Clyde.
Still Putting The IT Into Gravy
If Only I Knew Then What I Know Now.

Challenge Trophies Won:

Offline Hezad

  • Sponsor
  • Pentium
  • *******
  • Posts: 613
  • Karma: 44
  • I believe .. in Patrick.
    • View Profile
    • Hezad.com Web hosting
Re: Windows Example Problems Under Vista.
« Reply #6 on: October 02, 2008 »
Hey again :)

Okay I get it now, don't know why, the windows skin part was out of my head when I answered you. Well, .. I have to admit I never tried nor looked for how to use skins in a windows environment.

If the objective is some kind of a gadget, I guess you could use directly the fbGFX screen with the
GFX_NO_FRAME and GFX_SHAPED_WINDOW flags and then drawing directly yourself the skin (you should write the window moving, resizing, etc.. yourself though)

If you want to use the windows API uniquely, I really don't know, sorry :/

Quote
If not, I best head over to the official FB forums with my alter ego, and post back any findings I have, ( if any )
I guess it'd be a good idea :)

Offline Jim

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 5301
  • Karma: 402
    • View Profile
Re: Windows Example Problems Under Vista.
« Reply #7 on: October 03, 2008 »
Clyde, you shouldn't have to run your program as Administrator unless you are trying to work inside the Program Files folder under Vista.  If you do that, as a normal user you may not write files inside Program Files and that can make it crash.  Much better to work in a folder outside there (I use c:\dev\source\freebasic\projectname).

If you want to do contoured windows (you can even put holes in them!) then it's probably better to use the startup code that Shockwave is working on in the General Coding thread right now http://dbfinteractive.com/forum/index.php?topic=3565.0
That way you will end up with full control over your window, and *then* we can start taking about how Regions work and how to attach clipping regions to your window to make shapes.

If you can draw the images you want into a framebuffer, just like you do with PTC, then it is very simple to blit them on to a window using SetDIBitsToDevice() function.  Something like
Code: [Select]
dim bmi as BITMAPINFO

bmi.bmiHeader.biSize = sizeof BITMAPINFOHEADER
bmi.bmiHeader.biWidth = src_w
bmi.bmiHeader.biHeight = -src_h
bmi.bmiHeader.biPlanes = 1
bmi.bmiHeader.biBitCount = bpp
bmi.bmiHeader.biCompression = BI_RGB
bmi.bmiHeader.biSizeImage = 0
bmi.bmiHeader.biXPelsPerMeter = 75
bmi.bmiHeader.biYPelsPerMeter = 75
bmi.bmiHeader.biClrUsed = 0
bmi.bmiHeader.biClrImportant = 0

SetDIBitsToDevice(hdc, 0,0, w,h, 0,0, 0,h, @gfx(0), @bmi,  DIB_RGB_COLORS)
where src_x/y are the size of your image, hdc is a device context you can get easily from the Window (hdc = GetDC(window)) and gfx is the framebuffer.

Jim
Challenge Trophies Won:

Offline Clyde

  • A Little Fuzzy Wuzzy
  • DBF Aficionado
  • ******
  • Posts: 7271
  • Karma: 71
    • View Profile
Re: Windows Example Problems Under Vista.
« Reply #8 on: October 05, 2008 »
Many thanks for your response Jim dude! :D

Never tried compiling into a different folder before.

Cheers And Much appreciated,
Clyde.
Still Putting The IT Into Gravy
If Only I Knew Then What I Know Now.

Challenge Trophies Won: