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 :
Now when running my plugin (compiling works fine) :
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 ??