×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

SET LIBRARY TO xmsg71
2

SET LIBRARY TO xmsg71

SET LIBRARY TO xmsg71

(OP)
Hi Everyone... Still trying to enhance my application and while researchin from the internet, i came accross this site that teaches how to enhance messagebox command thru the use of xmsg71.FLL file... i've used it and saw the extended capability of the messagebox, but while testing it, everytime i edit or save it always says invalid path... so i need to close foxpro and reopen the file for me to save other edition... i noticed that everytime i run the program and try to edit again it always says invalid path... Please help me be enlightened with this error... Thanks and God bless...

heres the code ive gotten from the internet...

*MEESAGEBOX ESPECIAL
*-------------------
SET LIBRARY TO xmsg71
**If This.Value=0
** * turn extended dialog off
** xmsg_SetDlgMonitor(.F.)
**ELSE
* Set dialog font and color
xmsg_AssignMessageFont('Times',16,.T.)
xmsg_AssignMessageFontColor(RGB(0,74,128))

* set dialog background color
xmsg_EnableUdfBackColors(.T.)
xmsg_LoadBackcolorFromSolidColor(1,RGB(210,235,253))
xmsg_LoadBackcolorFromSolidColor(2,RGB(107,174,221))

* set dialog icon
xmsg_EnableUdfIcons(.T.)
xmsg_LoadIconFromResourceFile(0x80, _vfp.ServerName, 0) &&UDF

* set button caption
xmsg_EnableUdfButtonCaptions(.T.)
xmsg_AssignButtonCaption(1, 'Agree?')
xmsg_AssignButtonFont(1, 'Arial',11)

* limit the width of the dialog
xmsg_AssignDlgMaxSize(400)

* turn extended dialog on
xmsg_SetDlgMonitor(.T.)
**ENDIF

=MESSAGEBOX('A picture is worth a thousand words...',;
64, 'MessageBox Dialog')
xmsg_SetDlgMonitor(.F.)

RE: SET LIBRARY TO xmsg71

SET LIBRARY TO something only works, if the FLL file is found, just like any command using a file depends on it being found. Just like USE or SET PROCEDURE fail if they don't find the file.

So, SET LIBRARY TO xmsg71 only works in the short form, if you CD into or SET PATH to the directory of the FLL or if you have the FLL in one of the paths you have in your SET PATH.

Chriss

RE: SET LIBRARY TO xmsg71

Mandy, I'm not familiar with XMSG71, but if you are looking for a way of issuing enhanced message boxes, I suggest you take a look at FoxyDialogs. If you follow that link, you'll see that it can produce some very attractive results. It also has the advantage of being well documented.

I appreciate you might have already invested some time in learning XMSG71, but I do think FoxyDialogs is worth a look.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads

RE: SET LIBRARY TO xmsg71

(OP)
Hi Chriss... i think i found the culprit... i edited the fll file using notepad 3 in hex.... because i want to remove the "demo" word in title bar... so everytime i edit and remove that word, it will have that error.. but when i use the original file which is downloaded from the internet, everything works well... Thank you Chris...

Hi Mike... yes I will still try to look what you have suggested... and learn more... thank you and god bless...

RE: SET LIBRARY TO xmsg71

Well, Mandy.

That explains very well why the FLL stops working. I didn't think of such a reason,, I thought you just missed to address the file correctly. Or have included it into the project an embedded it into the EXE, which doesn't work as far as I know.

An FLL is a DLL dynamic link library and one of the major features of a dynamic link library is having "entry points", Adresses where the functions of a DLL start. By removing just a single byte you make those addresses invalid and the DLL stops working, of course. You don't hack a DLL that easy, forget it. Since the whole of news2news doesn't exist anymore and was integraated into the VFPX project, a lot of samples are still not yet completely working, so you could address that and may get at the full version of the FLL.

First notice the old site news2news.com already migrated twice to codeplex and now github. So things are all out of whack, but the current maintainers of the github project likely have all the original files from news2news and could reorganize what's missing. See https://github.com/VFPX/Win32API/blob/master/sampl.... It says:

Quote (Github Win32API)

Note that this document contains some links to the old news2news website which does not work at the moment. This material will be available sometime in the future.

You may acccelerate that b opening an issue with this problem. In fact it is already an open issue, if you look into https://github.com/VFPX/Win32API/issues
Looking into the discussion, that's from 2018 and nothing changed until then, sadly. And the last comment of Tore Bleken may be the final word on it:

Quote (Tore Bleken)

Some of the samples which were available at News2news.com are not presently available here since they depend on custom made libraries. Some of these samples may be added later, if the necessary libraries are released to the public.

I think this FLL has not been released to the bpublic and remains one of the thingss news2news didn't release for free, so this will always remain incomplete.

If that's the case you're far better helped by taking Mikes advice to take a look into using FoxyDialogs, which offers way more than the xmsg71.fll, if you ask me. Also, I think that stems back from your old thread Some of the samples which were available at News2news.com are not presently available here since they depend on custom made libraries. Some of these samples may be added later, if the necessary libraries are released to the public.

And there I showed you tht VFPs MEssagebox is simply a Windows API function, but more importantly than that I put in bold

Quote (myself)

Well, instead, do your own Messagebox form class.

I repeat that. If it took you from end of October 22 to now, April 23 and still trying to use an enhanced messagebox you really should give up and give in. I mean what hinders you to see the biggest advantage of creating your own Messagebox form? A system or FLL messagebox also is just a form, and you can design forms on your own, you don't need a library or FLL for that. PLus the forms you design can by simplest use of the forms you already have done. Reuse the same color scheme, fonts, graphics, icons etc. is simple, if you make the messagebox forms on your own. What is stopping you from using that? You seem to fear you have to do every single messagebox with every text ever. No, you can use a function, parameters, set a label.caption to the text passed in and use its wordwrap feature to automatically layout the text.

It can't be any simpler to get the desired looks of the messageboxes you want to have in your application by making them your own forms. You want the freedom of designing those messagebox to integrate into the look of the rest of your application. You have the maximum freedom in that way and only in that way. So what are you waiting for, Mandy?

We even had a discussion there how it can all integrate into the code you already have thanked for that part of the thread, so you have already noticed it.

Chriss

RE: SET LIBRARY TO xmsg71

Quote (Chris)

I mean what hinders you to see the biggest advantage of creating your own Messagebox form? A system or FLL messagebox also is just a form, and you can design forms on your own, you don't need a library or FLL for that
.

Mandy, although I personally like FoxyDialogs and am happy to recommend it to you, I do agree with Chris that creating your own message form is often a good way to go.

You can do that quite easily wihthout changing any of your existing code. You create a form that takes the same parameters as the native MESSAGEBOX() function and returns the same value. Make it a modal form, and add whatever controls you want to make it look attractive.

Then write a function that does nothing other than calling your form, passing the same parameters and returning the same result. Name the function, for example, MyMessage. Finally, add this line to your Include file (if you don't know what an Include file is, we can explain it):

#DEFINE MESSAGEBOX MyMessage

From now on, whenever you call the native MESSAGEBOX() function in your program. your custom form will be invoked instead.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads

RE: SET LIBRARY TO xmsg71

Mike did explain the steps to do very well, easier to follow than what I wrote back in October. I just want to mention I already described how you can even minimize how many times you'd need to add this definition #DEFINE MESSAGEBOX MyMessage into your code by using includes.

I can imagine there are a ton of questions that led you to not go this route, but it pays to ask them. For example, the first question that should come up is how to take any message text and display it in a form. It seems like it's a hard task already, but text is just data and you know the Editbox - hopefully, can display text, any text, with word wrap and within the size of itself. It can fail on text so long, that it doesn't display fully, so instead you get a scrollbar. You could react to an editbox having a scrollbar. You could higher its height until the scrollbar disappears. And there is something that's able to render text even more automatically in the size needed: A label caption with a label set to use wordwrap and autosize, so it extemds in height, if the text doesn't fit.

Anyway, I can imagine you have questions. But you're not afraid of asking questions, are you? The major advantage still is, you have the full control about colors and graphics in the design of all your forms, strting wiht the font and fontsize and color to use for this label caption.

Chriss

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close