Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently December 22nd, 2024, 10:44 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Write to disk file and colour prob
PostPosted: March 28th, 2011, 9:57 am 
Offline

Joined: April 27th, 2006, 1:34 pm
Posts: 37
Location: Belfast
Opus: 9.03
OS: Win 7
System: i5 - 6gig RAM
Hi Folks
I would be grateful if you woulg give me your thoughts on the following problem.

Using the below code

var MyDLL = LoadDLL( SYSTEM_PUBLICATION_DIR + "TestCallDLL.dll" );
if (MyDLL)
{
varPickedColour = MyDLL.CallFn("ShowColourPicker", true, "slong", "hwnd", 0, "slong", varPickedColour );
if (varPickedColour != -1)
{
PolygonClockFace.SetFillColour( varPickedColour );
}
}

varClockColour=varPickedColour;

I then write to disk file to varClockColour

When reloading pub I read from disk file to varClockColour

then

PolygonClockFace.SetFillColour(varClockColour);
Does not work

Checked the varClockColour variable and the number is fine.

Also if I make varClockColour =255
then
PolygonClockFace.SetFillColour(varClockColour);
This works fine?

Why does the write/read to/from file not work.
Cheers
Paul


Top
 Profile  
 
 Post subject: Re: Write to disk file and colour prob
PostPosted: March 28th, 2011, 10:59 am 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Hi Paul,

I think you might be muddling something up. There is no read / write to a file in this script. The DLL loads the Colour Picker window and then passed the colour selected to the variable with is used to set the polygon.

This bit does work!

It might be daft, but I have to ask, you have put the DLL in the publication folder?

Regards,

Mack

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
 Post subject: Re: Write to disk file and colour prob
PostPosted: March 28th, 2011, 11:23 am 
Offline

Joined: April 27th, 2006, 1:34 pm
Posts: 37
Location: Belfast
Opus: 9.03
OS: Win 7
System: i5 - 6gig RAM
Sorry Mack,
Yes the colour changes fine and I used actions for the read/write to disk file.


Top
 Profile  
 
 Post subject: Re: Write to disk file and colour prob
PostPosted: March 28th, 2011, 12:21 pm 
Offline

Joined: April 27th, 2006, 1:34 pm
Posts: 37
Location: Belfast
Opus: 9.03
OS: Win 7
System: i5 - 6gig RAM
Check out attached. Once colour is picked it should load on pub startup.


You do not have the required permissions to view the files attached to this post.


Top
 Profile  
 
 Post subject: Re: Write to disk file and colour prob
PostPosted: March 28th, 2011, 2:07 pm 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Hi Paul,

Posting executables generally won't help and most people would be skeptical of running foreign programs. Also, writing files to the root drive is not good practice - better of using the publication directory or the user's documents or temp.

As for the problem, try replacing the corresponding line with this:

Code:
PolygonClockFace.SetFillColour(parseInt(varClockColour));


Mack

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
 Post subject: Re: Write to disk file and colour prob
PostPosted: March 28th, 2011, 2:34 pm 
Offline

Joined: April 27th, 2006, 1:34 pm
Posts: 37
Location: Belfast
Opus: 9.03
OS: Win 7
System: i5 - 6gig RAM
Hi Mack
Sorry for the indiscretions, rushed it abit.
New line works perfectly, would never have got that in a milion years.
Cheers and thanks
Paul


Top
 Profile  
 
 Post subject: Re: Write to disk file and colour prob
PostPosted: March 28th, 2011, 2:51 pm 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Not a problem.

The reasoning is that the text file reads in a string and the parameter required is a number.

Mack

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 25 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group