" is not a valid integer

Interested in developing new plug-ins? Got one to share? Post here!
christ23
Posts: 82
Joined: Mon Jan 16, 2012 4:51 am

" is not a valid integer

Postby christ23 » Wed Aug 01, 2012 12:34 am

Hi together,

i am developing a plugin written in C# at the moment (with the Delphi Bridge from MaxLogic - thanks to him at this point, also for his support!).

But since some days, i am getting a strange error message when running my plugin.

I have simplified my code, but it won't work any more. In the Test-Tool from MaxLogic, everything works fine, but not in IA.

First of all, i have this .reg :

Code: Select all

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\MimarSinan\InstallAware\2.0\Plug-Ins\ORASQL23]
@="C:\\Documents and Settings\\***\\My Documents\\Doku\\Installer\\_InstallAware\\Plugins_dotNet\\_NEW2012\\IA_NetBridge_and_TestTool\\data\\IDEPlug_NetBridge.dll"
"Action"="ORASQL23"
"Execute"="EXEPlug_NetBridge.dll"
"Script"="ORASQL-RUN"


Then i got my C# Code :

Code: Select all

namespace EXE_sql
{
    /// <summary>
    /// delegate for to represent Delphi callback
    /// </summary>
    /// <param name="SmartPosition">integer parameter</param>
    /// <param name="text">string parameter</param>
    /// <returns></returns>
    [ComVisible(true),
    GuidAttribute("AD7144BF-3730-46F5-A5B6-DDA760575C61")]
    public delegate bool RunTimeCallback(Int32 SmartPosition, string text);

    [ComVisible(true),
    GuidAttribute("9C7B484A-EFE1-45B2-ADE6-042601741914")]
    public class EXE_sql
    {
        string m_newval = "";

        public unsafe int RunTimeExecute(
            uint window,
            string variables,
            string state,
            Int32 callback,
            ref Int32 returnVal,
            ref string newval,
            bool firstiteration)
        {


            System.Diagnostics.Debugger.Launch();

            try
            {

                if (firstiteration)
                {


                    IntPtr ptr = new IntPtr(callback);
                    RunTimeCallback callbackMethod = (RunTimeCallback)Marshal.GetDelegateForFunctionPointer(ptr, typeof(
                      RunTimeCallback));

                    callbackMethod(0, "Initialize sql ...");
                    Thread.Sleep(1000);
                    callbackMethod(30, "Initialize sql ... getting credentials ... ");
                    Thread.Sleep(100);
                    callbackMethod(90, "Initialize sql ... getting credentials ... connecting ... executing ... getting values ...");
                    int eestasks = 23;
                 
                    this.m_newval = "EESTASKS, " + eestasks.ToString();

                    returnVal = 0;
                   
                    return this.m_newval.Length;
                }
                else
                {
                    //   MessageBox.Show("Second call");
                    //IntPtr ptr = new IntPtr(callback);
                    //RunTimeCallback callbackMethod = (RunTimeCallback)Marshal.GetDelegateForFunctionPointer(ptr, typeof(
                    //  RunTimeCallback));
                    //callbackMethod(100, "Initialize sql ... getting credentials ... connecting ... executing ... getting values ... finish");

                    newval = this.m_newval;
                    return 0;

                }
            }
            catch (Exception err)
            {

                throw err;
            }

        }


In IA i have this code :
1.PNG
1.PNG (4.26 KiB) Viewed 33827 times


Now when running my plugin (compiling works fine) :
2.PNG
2.PNG (5.56 KiB) Viewed 33827 times


The thing is, the variable "EESTASKS" is filled with the 23 from the Plugin ! And, as you can see, the error comes up at a blank (!) line (Line 232 as the box says)

Any ideas ??
Last edited by christ23 on Tue Aug 28, 2012 3:05 am, edited 1 time in total.

FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: " is not a valid integer

Postby FrancescoT » Thu Aug 02, 2012 3:30 am

Dear User,

your topic has been moved to "Plug-In Development" forum.

Anyway, I am not an expert of c# plug-in development (I use C/C++ only)... but seems that the parameters you entered doesn't not have the correct format.

Regards.
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE

christ23
Posts: 82
Joined: Mon Jan 16, 2012 4:51 am

Re: " is not a valid integer

Postby christ23 » Sun Aug 26, 2012 1:34 am

Hi FrancescoT,

i have checked all my parameters, they are allright. The strange thing on this topic is, this error comes up "randomly". I was working with my plugin-development without errors. Then having trouble with the plugin not being called in non-debug-mode-of-IA, and (seemed) to having found the error.

Now, after two times everything was right, i am getting the "..."is not a valid integer value"-error again. In this post, my problem had gone when i changed the machine. Now i have shooten this new machine also, cannot remove the error.

Any further ideas ?
(Cutting and pasting at another line has not resolved the problem, making a new project also did not work)

bokkie
Posts: 767
Joined: Sun Feb 08, 2009 6:30 am

Re: " is not a valid integer

Postby bokkie » Mon Aug 27, 2012 1:09 pm

Chris,

You seem to be the resident expert on dot net plugins? :)

If so, and you get to read this reply could you look at this recent thread of mine and see if you can explain what my problem might be? Thanks.

The thread: viewtopic.php?f=2&t=8797
Peter. Smartly dressed, he still resembles an unmade bed.
InstallAware MVP


Return to “Plug-In Development”

Who is online

Users browsing this forum: No registered users and 27 guests