Witam. Dlaczego nie mogę dodać formy? Dodałem formę w solution explorer, dodałem referencję, ale Visual Studio nie widzi tej formy, nie ma jej nawet w podpowiedziach.
using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;
using HelloWorld.API;
using DllExporter;
using System.Windows.Forms;
namespace HelloWorld
{
public class AqqCs
{
// Fields
private static List<IntPtr> _listHooks;
private static AqqStructs.TPluginInfo _pluginInfo;
private static IntPtr _pluginInfoPtr;
private static AqqStructs.TPluginLink _pluginLink;
// Methods
private static int AQQ_SYSTEM_MODULESLOADED(int wParam, int lParam)
{
return 0;
}
[DllExport]
public static IntPtr AQQPluginInfo(int AQQVersion)
{
_pluginInfo = new AqqStructs.TPluginInfo();
_pluginInfo.ShortName = "Przelicznik";
_pluginInfo.Version = AqqFunctions.PLUGIN_MAKE_VERSION(1, 0, 0, 2);
_pluginInfo.Description = "Przelicznik walut, aktualne kursy walut";
_pluginInfo.Author = "Marcin";
_pluginInfo.AuthorMail = "email";
_pluginInfo.Copyright = "None";
_pluginInfo.Homepage = " ";
_pluginInfo.Flag = 0;
_pluginInfo.ReplaceDefaultModule = 0;
_pluginInfo.cbSize = (uint)Marshal.SizeOf(_pluginInfo);
IntPtr ptr = Marshal.AllocHGlobal((int)_pluginInfo.cbSize);
Application.DoEvents();
Application.DoEvents();
Application.DoEvents();
Marshal.StructureToPtr(_pluginInfo, ptr, false);
_pluginInfoPtr = ptr;
return ptr;
}
[DllExport]
public static int Load(IntPtr Link)
{
_pluginLink = (AqqStructs.TPluginLink)Marshal.PtrToStructure(Link, typeof(AqqStructs.TPluginLink));
_listHooks = new List<IntPtr>();
_listHooks.Add(_pluginLink.HookEvent(AqqConstants.AQQ_SYSTEM_MODULESLOADED, new AqqDelegates.TAQQHook(AqqCs.AQQ_SYSTEM_MODULESLOADED)));
return 0;
}
[DllExport]
public static int Settings()
{
//tutaj chce wyświetlić formę, ale nie mam do niej dostępu, nie wiem dlaczego bo przecież dodałem referencję do Windows.Forms
//Form1 formWaluta = new Form1();
return 0;
}
[DllExport]
public static int Unload()
{
if (_listHooks.Count > 0)
{
_listHooks.ForEach(delegate(IntPtr x)
{
_pluginLink.UnhookEvent(x);
});
}
Marshal.FreeHGlobal(_pluginInfoPtr);
return 0;
}
}
}