IonicWind Software

IWBasic => General Questions => Topic started by: JoaoAfonso on July 01, 2008, 05:39:33 AM

Title: SETCONTROLTEXT a bitmap not working with image from another computer
Post by: JoaoAfonso on July 01, 2008, 05:39:33 AM
Good evening.

The following code works if the picture is in my machine (in spite of "\\other_machine", "C:\EB\my_project") , but does not work if is in another machine. Any explanation for this not working, and solution to it?

GETBITMAPSIZE LoadImage("\\other_machine\equipment"+CHR$(92)+d4.return1+".bmp",@IMGBITMAP),w,h
IF (w=150)&(h=150)
foto="\\other_machine\equipment"+CHR$(92)+d4.return1+".bmp"
ELSE
foto="\\other_machine\equipment\foto_default.bmp"
ENDIF
SETCONTROLTEXT d4,35,foto
Title: Re: SETCONTROLTEXT a bitmap not working with image from another computer
Post by: Ionic Wind Support Team on July 01, 2008, 07:33:16 AM
Should be:

"\\\\other_machine\\equipment"

?

Paul.
Title: Re: SETCONTROLTEXT a bitmap not working with image from another computer
Post by: JoaoAfonso on July 01, 2008, 07:46:50 AM
Even with address like that, stills not work...
Title: Re: SETCONTROLTEXT a bitmap not working with image from another computer
Post by: Ionic Wind Support Team on July 01, 2008, 07:50:50 AM
Wasn't sure what you were attempting with the mixed slashes.  Even in a normal path you need to use the \\ as the \ is an escape character in a string (see the users guide).   So I was assuming you were trying to access a networked computer.

If you are trying to use a relative path based on the location of the executable then the path would be incorrect.

You should put the bitmap in resources and then not have to worry about where it is.

Paul.

Title: Re: SETCONTROLTEXT a bitmap not working with image from another computer
Post by: JoaoAfonso on July 01, 2008, 09:47:28 AM
I am trying to access a bitmap in a network computer. That bitmap, in this context, is a picture of the equipment.
I open databases and check other .txt files in the network computer using the same path ("\\other_machine\\equipment\\") and it works... can't figure out why accessing other computer it doesn't. Also I scratch my head thinking that this
foto="C:\\EB\\my_project\\equipment\\foto_default.bmp"
works, but this
foto="\\other_machine\\equipment\\foto_default.bmp"
doesn't, so doesn't seems a path's problem.
Title: Re: SETCONTROLTEXT a bitmap not working with image from another computer
Post by: czoran on July 02, 2008, 12:25:36 AM
Hi,

I had similar problem last year. I solved it by "map network drive" in Win Explorer. Maybe that will help you too.
Paul's suggestion to use "\\\\network_computer\\directory\\file" sometimes does not work. Most of the time working fine, but in some networks it doesn't work.

Regards.
Title: Re: SETCONTROLTEXT a bitmap not working with image from another computer
Post by: aurelCB on July 02, 2008, 02:40:31 AM
I dont know but maby is problem in
you write - IF (w=150)&(h=150)
and where is l,t position?
Title: Re: SETCONTROLTEXT a bitmap not working with image from another computer
Post by: JoaoAfonso on July 02, 2008, 02:47:43 AM
That line is just to check if the BMP fits in the place I want it to be. But fitting or not, the program or accepts the picture chosen (d4.return1) or uses the default picture (foto_default), so even if that piece of code is wrong, the problem always exist.

Figured out if I get a directory from a txt file, it can be this way and works correctly: 'dir="\\other_machine\directory1\directory2"'. If I want to add to this string got from a txt file another directory, then I must add another slash: 'dir=dir+"\\directory3\\directory4\\foto_default.bmp"'. Anyway, tried everything around it and nothing worked.

What "map network drive" does in order to fix this? Also this program is a client everyone can download and make it run in their own computer, so if "map network drive" works just for my own computer, then that can't be a solution...

A solution it works for sure is if I copy the picture file from the network computer to the client one, like a temporary file, I know I can open that file. It takes more resources, though, and doesn't seem much professional :/ If someone has another ideas, please share. And thanks for all the tips.