Newbies sivak Posted February 2, 2006 Newbies Posted February 2, 2006 Wanted to invoke a FM script on a specific time. so looked for the example given in the following link http://www.filemaker.com/help/08-Scripts11.html to trigger a FM script through the Activex component. But could not proceed beyound the code line Set FMDocs = FMApp.Documents. But couple of times we have crossed this line of code also without any error but subsequently we do get an error at this line of code myOpenFile.DoFMScript ("First Script"). Tried this same set of code in both VB 6 and a VB.net application but have not been successful to launch the script even though the application launches and the document opens up. I am stuck on this and not able to move ahead. Any help or views will be great. thanks a lot siva
Wim Decorte Posted February 2, 2006 Posted February 2, 2006 Hi Siva, you need to mention what error you're seeing and also what version of FM you're seeing this with. Having said that, there seems to be a problem with FM 8 and .NET languages (VB.NET, C#) that I and others have seen. Haven't had the time yet to figure out if it is a FM bug or if it is something in .NET's COM interop.
Newbies sivak Posted February 2, 2006 Author Newbies Posted February 2, 2006 (edited) Hi Wim , I am using VS 2003 with FM 7 and 8. It throes the "Server threw an Exception error". I am also not sure as to why and who is responsible for this error to popup. I also tried this out with VC++ 6.0 and .net but did not get it to work. Will it work with FM 6. Any how i tried the same by installing FM 6 and used the sample code given from the FM web site and changed few library setting and it did work, i am tying this with vc++ 6.0 now accessing FM 6 thanks siva Edited February 2, 2006 by Guest
Wim Decorte Posted February 3, 2006 Posted February 3, 2006 FM6 has a different type library (DLLs) than FM7/8. FM7 and 8 share the same one since there have been no changes in ActiveX features. I've never had the error with VB6 though using FM7/8. Only with .NET languages. Always the same error as you're seeing.
Newbies sivak Posted February 3, 2006 Author Newbies Posted February 3, 2006 (edited) Hi Wim, i Tried it in VB.net 2002 and VC++.net 2002, and it worked in VB.net but not in VC++.net with FM7/8 . pity is that it threw an error at the Open Method of documents when i clearly suppilied the required parameters. the error was "invalid Number of Parameters". the same statement worked in vb.net 2002. yes it might be of the way visual studio.net generates those Interops, and this is what creates problems.Can you suggest anything else ? Thanks siva Edited February 3, 2006 by Guest
Wim Decorte Posted February 4, 2006 Posted February 4, 2006 I can't see how changing VS versions would cause the "invalid # of parameters" error. That has to do with ... well... not providing the necessary parameters to the Open command Remember that FM7/8 now has both an account name and a password so you need to pass 3 parameters in total: - file name - account - pw (whereas in FM6 you needed only the file name and the pw). The ActiveX model described in the help file is correct: Open(filename As String, accountName As String, password As String) But all the examples in the help file are wrong. As to the other error "Server threw an execption", I get hit by that too, but it is inconsistent. When it happens it happens all the time, but sometimes it just does not happen. I'll send you a little test app back-channel. I wrote it yesterday in C# (VS2005) and it does not produce the error. Never happens in VB6 either. Just VB.NET & C# in VS 2003 & 2005. So no help there until we can figure out a way to make the error totally reproducible. Then we can log it as a bug and talk to FMI.
Recommended Posts
This topic is 6936 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now