8 replies
by jlctechrep
by jlctechrep
A colleague on the UniversalThread reported getting
this error when building his setup
using InstallShield for Visual Foxpro
Resolving strings...
ISEXP : error -6264: A record in the Property table is using string ID 'ID_STRING1'
for column 'Value' but this string is blank and the column is not nullable
I believe this
problem is either a bug or corrupted ism file.
Although
IS does not store data in SQL database, trying to apply
similar concepts, you would agree with me that the program is trying to save
a .null. value into a field who does not accept such values; since you can't modify
that in IS Express for VFP, the only solution seems to be to fill that entry with
some string value.
- Open your ism project
-
Click on plus sign
to open "Organize your setup? option branch -
Look for every
single entry that requires a text entry and make sure there?s a string entered for
each one, if not, enter some text, example being, ?Publisher/Product URL? needs a
string value, and so on. -
Rebuild your project,
be happy again. If still did not work look into the rest of the project where a string
entry is required and do your thing.
It is difficult,
if not impossible, with this limited version of IS to determine the offending
field by using the description given in the error message 'ID_STRING1'.
You
could easily know this however. That
is in the case you had the full version of IS Express:
-
Use the menu option
"Project-Export String Table? to create a
text file with your project info. Do this at least once before you build
the project the first time. -
When you get an
error, open this text file and look the value reported in the error message to which
project option refers -
Go back to your
ise file and correct only the offending field.
This is
how the txt file looks like:
by jlctechrep
I
remember, a while ago, two famous FoxPro gurus were fighting on what
Visual FoxPro was going to be able to do running (if ever possible) on Longhorn
and Avalon (now WPF). One of them claimed that the impact of these new
technologies was going to be of such magnitude that would leave VFP totally out of
the game. The second guru, needles to say, denied this. It was a colorful discussion,
both got carried on to a point guru #1 proposed to bet money to show how serious
he was.
As guru #2, but
for different reasons, I thought #1 was wrong.
These pictures
speak by themselves. In case you didn't notice, it's FoxPro 2.6 DOS and VFP 9
running on Windows VISTA (formerly Longhorn) PDC 2005 build. In addition, I was
able to run a FoxPro DOS program (built back in 1993) flawlessly without touching
a single line of code.
But this means
nothing compared to what can be seen in Ken
Levy?s Channel9 video, (I recommend the whole video but, for what is
worth, the fun starts at minute 21).
Now, is it me
or one of these 2 persons proved to be soooo... wrong? I am
also wondering what they may think now...
>
by jlctechrep
A colleague using VFP7 asked recently about removing those pesky printer references
in reports. Of course, you have a way to manually remove them in VFP8
and VFP9 (report menu-printer environment and also for VFP9 report properties).
In case you still maintain projects in VFP7 and/or upgrade report files into projects
using versions 8 or 9, trying to remove those printer references (if any) automatically
won't hurt your project after all. The best known option for this is to put some
code in your project hook class 'beforebuild' method.
Most Fox people know that they can associate a ProjectHook visual class with
their projects using the Project Menu options available; Since I couldn't send to
my colleague the visual class as a file (it was an internet newsgroup), I thought
of a way to do this programatically so here's another way to do it, probably useful
in case you had your classes defined in a prg. The downside is that the ProjectHook
reference does not persist when you close the project.
This code takes care of creating the class file and adding at least one file
to the project in order to build it as an APP, needles to say these are things needed
for this example only, in a real life scenario those 2 would be existing
files.
#include
foxpro.h
clear
IF FILE("foo.prg")
DELETE FILE FOO.PRG
ENDIF
IF FILE("MyClasses.PRG")
DELETE FILE MyClasses.PRG
ENDIF
IF FILE("MyProject.pjx")
DELETE FILE MyProject.*
ENDIF
LOCAL lcMyProjectHookVar
TEXT TO lcMyProjectHookVar
noshow
**************************************************
*-- Class:
myphook (c:\noninteractive\annunciacurrent\phookexample.vcx)
*-- ParentClass: projecthook
*-- BaseClass: projecthook
*-- Time Stamp: 02/17/06 03:49:02 PM
*
DEFINE CLASS myphook AS projecthook
Height = 22
Width = 23
Name = "myphook"
*-- Cleans Fields EXPR, TAG, TAG2
Contents On First
Record Of Report File
PROCEDURE cleanreportprinterreferences
PRIVATE a
WITH _vfp.ActiveProject.Files
FOR a=1 TO .Count
IF UPPER(JUSTEXT(.Item(a).Name))="FRX"
USE .Item(a).Name
EXCLUSIVE
REPLACE expr WITH "",
tag WITH "",tag2 WITH ""
PACK
USE IN JUSTSTEM(.Item(a).Name)
ENDIF
NEXT
ENDWITH
ENDPROC
PROCEDURE BeforeBuild
LPARAMETERS
cOutputName, nBuildAction, lRebuildAll, lShowErrors, lBuildNewGuids
WAIT WINDOW "Hello
World from BEFOREBUILD" TIMEOUT 5
THIS.CleanReportPrinterReferences()
ENDPROC
ENDDEFINE
*
*-- EndDefine: myphook
**************************************************endtet
ENDTEXT
STRTOFILE(lcMyProjectHookVar ,"MyClasses.PRG",0)
STRTOFILE("*
Main Program PlaceHolder","FOO.PRG",0)
SET PROCEDURE TO MyClasses.PRG
MODIFY PROJECT MyProject NOWAIT noshow
_VFP.ActiveProject.ProjectHook = NewObject('MyPHook')
IF VARTYPE(_VFP.ActiveProject.ProjectHook)=="O"
?DATETIME(),":
ProjectHook Created Succesfully"
ELSE
?DATETIME(),":
WARNING->ProjectHook NOT Created Succesfully"
ENDIF
IF FILE("FOO.PRG")
_VFP.ActiveProject.Files.Add("FOO.PRG")
?DATETIME(),":
FOO.PRG added to the project, BUILD about to run."
IF _VFP.ActiveProject.Build(JUSTSTEM(_VFP.ActiveProject.Name),
BUILDACTION_BUILDAPP )
?DATETIME(),":
BUILD WAS SUCCESSFUL!"
ELSE
?DATETIME(),":
WARNING->BUILD WAS UNSUCCESSFUL"
ENDIF
ELSE
?DATETIME(),":
WARNING->Could not add a file to the project, BUILD not run."
ENDIF
_vfp.ActiveProject.Visible=.t.
by jlctechrep
I recently run into the problem of not getting the right order for records on a temporary
table. This is how data looked when using and index created as follows:
INDEX ON UPPER(company_name)+UPPER(dept_name)+UPPER(EMPLOYEE_LASTNAME)+UPPER(EMPLOYEE_FIRSTNAME) TAG ciadeptemp
COMPANY_NAME,DEPT_NAME,LAST_NAME,FIRST_NAME
Company 1, null,j,c
Company 2, Sales,f,c
Company 1,Tech Support,g,c
What
happened? Shouldn't I get all the 'Company 1' records before seeing 'Company 2'? Of
course, but that is in case there were not null values in any of the fields that
are part of the index key.
In
my case, field "dept_name" accepted .null. values so the index key for that record
evaluates to .NULL., therefore, appears at the top. This
new index key solved it:
INDEX
ON UPPER(company_name)+UPPER(IIF(ISNULL(dept_name),space(40),dept_name))+UPPER(EMPLOYEE_LASTNAME)+UPPER(EMPLOYEE_FIRSTNAME) TAG ciadeptemp
Never
run into this before, so many years working with VFP but how much I've got to
learn yet. Did anybody resolve this in a different way?
by jlctechrep
I used to think that blogs were the most idiotic thing in the world. That was not
so long ago.
Nowadays I'd rather read blogs that surf web sites. Yes, I am the real idiot.
Who would've thought then, that I would be having fun building a VFP RSS Reader.
I will be posting more as I make progress, but here are a few pictures.
You may want to know from what I've done so far it took me less lines of
code with Visual foxpro than with our, ahem rich cousin, .NET.
[Update: forgot to mention that Calvin
Hsia has built one also, using a different approach though]
by jlctechrep
Code-wise
speaking, I haven?t done big improvements since my previous post on this matter. But
I?ve spent a considerable amount of time to figure out that this technology is not
ready for Foxpro, if it will ever be.
I?ll go directly
to the point:
With
the new Internet Explorer 7 (Beta 2) we also get the RSS Platform (in ways of a DLL
file @ c:\windows\system32\msfeeds.dll).
Yes, you need
to install this Beta if you want to test the code posted here.
If you have
concerns about replacing your beloved IE 6 installation, shall I say then that you
can always uninstall?
Once you?ve
got IE7 Beta2 installed, all you need to do from the command window:
The Feeds
?property?, holds all of your subscribed feeds collection, following the example from
the picture above, the following code will print all those feeds names:
oFeedManager=NEWOBJECT("Microsoft.FeedsManager")
oRootFolder=oFeedManager.RootFolder
oAllMyFeeds=oRootFolder.Feeds
FOR EACH oCurrFeed in oAllMyFeeds
?oCurrFeed.name
NEXT
The RSS API
has been well documented at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/feedsapi/rss/overviews/msfeeds_ovw.asp ,
take a look at it to learn more about how this API is structured and the usage for
the different methods, properties and events that are available.
Sorry, did
I say ?events?? Well ignore that for the Foxpro scenario, as you?ll read in the ?Issues,
issues....? section of this post, RSS events don?t work in VFP.
My
approach: a goodwill attempt.
Here?s a very
simple form rssreader.zip
(8.24 KB), don't expect it to be bullet proof, but it will allow you to
add feeds and see their contents, as well as to get an idea of the potential.
This example uses
a Treeview control to populate the feeds, a microsoft web browser control to show
the Feed entries in html format, and eventually if you are connected to the internet,
click on 'show web' checkbox to see the blog entry directly from the original.
Remember the
'download issue' I referred to in this post "ISSUES ", so you
don't get frustrated on me, I am just the messenger.
My design
is far from what I would like, but from a VFP perspective, this API?s state-of-the-art
does not deserve more efforts from my side until I get a clear sign that it will work
seamlessly.
For the reasons
exposed, I can?t justify building a wrapper class for the API to make all the functionality
reusable with other controls than the Treeview, but for the most part, the code
(form) I built is a good sample of the potential for a good part of what
the API allows FoxPro to do.
It is a pity
indeed because, being able to see from VFP the same RSS info that our current IE7
installation sees, it would open a great potential for our FoxPro applications.
You may think
why bother building another news aggregator, but I am thinking more about interchanging
information between different systems rather than anything else, if you know what
I mean.
Maybe for
RSS functionality from VFP we will have to implement it ourselves via NET4COM or like
YAG commented in my previous post, SEDNA?s MY will take care of it.
ISSUES,
ISSUES ?.
Implementing
Interfaces: I wasn?t
able to implement interfaces (read the details below), but this is a huge constraint.
Not being able to listen and respond to folder or feed events makes it a nonstarter
to use this API for serious development from VFP.
Download/Update/Refresh: There?s
something wrong with the either with the API implementation of the Feed Download Engine
or the Engine itself.
I haven?t
been able to download more than 4 Feeds in a row without the API becoming non responsive
and stalling Foxpro, to finally get an ole error message. In order to see this behavior
you may have to leave the Foxpro session alone for several minutes, i.e., 20 or more.
Want to try
this? If you use my example form, you?ll notice that whenever you click on the Feed
(parent treeview element) it will ask you to perform a download.
In
case you answer YES, the download should be a quick process, 1 or 2 seconds, and you
should have inmediate access to the item, i.e., you click on a entry and you see the
html page.
If this isn't
the case, it mens that VFP is still waiting a response from the API, in
the meantime, you will be able to click on other areas of the form except for the
rest of the foxpro development environment, until an ole error pops up.
Internet
Explorer 7 (Beta2) does not update automatically:
IE7 itself
does not refresh its screen automatically when new feed items are created unless you
F5 or click on the Feed Entry. In some cases, even doing so would not update items
on a feed until you manually refresh it (right click-context menu option), try subscribing
to any feed from Craigslist.org to see the results in 5 minutes.
Delete
Feeds: Deleting a feed
programmatically is available as a method but not possible, an error pops up claiming
that the feed is in use by another process and can?t be accessed:
You
have to use IE 7 Feed Manager to delete a feed instead.
Deleting
a feed item does work though.
ADDENDUM
Implementing
Interfaces Issues Detailed.
Please, bear
with me on these 3 steps:
1. Open Object
Browser and ?browse? for c:\windows\system32\msfeeds.dll.
2. Expand
the Interfaces branch,
3. Drag and
drop the IFeedFolder interface inside an empty .prg.
This is the
message I?ve got invariably when dragging and dropping from the object browser
By ignoring
the error a couple of times, finally you?ll get the code, but still it will error
when you run it.
This line
(automatically generated by the previously described process),
IMPLEMENTS IFeedFolder IN "Feeds.FeedWatcher"
, needs to
be replaced manually by this other line
IMPLEMENTS IFeedFolder IN "msfeeds.dll"
(To
me this is one more clue indicating there?s something wrong.)
So,
with these modifications, at least the class code runs, but it fails when trying to
establish the link between the two classes, event and Feed, as shown in the following
code:
oFeedMgr = NEWOBJECT("Microsoft.FeedsManager")
oRootFolder = oFeedMgr.RootFolder
oFeeds=oRootFolder.Feeds
oFeed1=oFeeds.Item(1)
x=NEWOBJECT("myclass")
IF !VARTYPE(x)=="O"
MESSAGEBOX("Couldn't
create class x")
ENDIF
WAIT WINDOW
IIF(EVENTHANDLER(oFeed1,x),"Event
Handler succesful","Event
Handler Failed")
DEFINE CLASS myclass AS
session OLEPUBLIC
IMPLEMENTS IFeedFolder IN "msfeeds.dll"
PROCEDURE IFeedFolder_get_Feeds() AS VARIANT;
HELPSTRING "Retrieves
the collection of feeds in this folder."
*
add user code here
ENDPROC
PROCEDURE IFeedFolder_get_Subfolders() AS VARIANT;
HELPSTRING "Retrieves
the collection of subfolders in this folder."
*
add user code here
ENDPROC
PROCEDURE IFeedFolder_CreateFeed(name
AS STRING, url AS
STRING) AS VARIANT;
HELPSTRING "Creates
a new RSS feed, and subscribes to it."
*
add user code here
ENDPROC
PROCEDURE IFeedFolder_CreateSubfolder(name
AS STRING) AS VARIANT;
HELPSTRING "Creates
a new subfolder in the folder."
*
add user code here
ENDPROC
PROCEDURE IFeedFolder_ExistsFeed(name
AS STRING) AS LOGICAL;
HELPSTRING "Checks
if a feed exists."
*
add user code here
ENDPROC
PROCEDURE IFeedFolder_GetFeed(name
AS STRING) AS VARIANT;
HELPSTRING "Retrieves
a feed by its name."
*
add user code here
ENDPROC
PROCEDURE IFeedFolder_ExistsSubfolder(name
AS STRING) AS LOGICAL;
HELPSTRING "Checks
if a subfolder exists."
*
add user code here
ENDPROC
PROCEDURE IFeedFolder_GetSubfolder(name
AS STRING) AS VARIANT;
HELPSTRING "Retrieves
a subfolder by its name."
*
add user code here
ENDPROC
PROCEDURE IFeedFolder_Delete() AS VOID;
HELPSTRING "Deletes
this folder and all of its contents."
*
add user code here
ENDPROC
PROCEDURE IFeedFolder_get_name() AS
STRING;
HELPSTRING "Retrieves
the name of the current folder."
*
add user code here
ENDPROC
PROCEDURE IFeedFolder_Rename(name
AS STRING) AS VOID;
HELPSTRING "Renames
the folder."
*
add user code here
ENDPROC
PROCEDURE IFeedFolder_get_path() AS
STRING;
HELPSTRING "Retrieves
the path of the current folder."
*
add user code here
ENDPROC
by jlctechrep
This discussion is closed to new replies.
Trending After Hours posts
Sort by Trending