Home > Net >  C # initialization yinhai interface problems
C # initialization yinhai interface problems

Time:10-18

Initialization interface has been an error, find the reasons for a long time all don't understand, hope to have help to see what's going on, the code is as follows:
 using System; 
Using System. Collections. Generic;
Using System.Com ponentModel;
Using System. The Data;
Using System. Drawing;
Using System. Linq;
using System.Text;
Using System. Windows. Forms;
Using System. The Runtime. InteropServices;
Using yh_interface;
Using System. The Reflection;


The namespace YH
{
Public partial class ff: Form
{

//System. The Type yh=the GetTypeFromProgID (" YinHai. SCMYInterface ");


//Object yhObject;





Public ff ()
{
InitializeComponent();
}
//business interface function
Public static short li_appcode=1;
Public static string ls_appmsg="";
Public static string a="";

//initialize interface


Public static bool JK_Init ()
{
COClass_n_yh_interface YH=new COClass_n_yh_interface ();
//System. The Type yh=the GetTypeFromProgID (" YinHai. SCMYInterface ");


YH. Yh_interface_init (a, li_appcode, ls_appmsg);

If (ff) li_appcode & gt;=0)
{
return true;
}
return false;
}
# region initialization
Private void button1_Click (object sender, EventArgs e)
{
JK_Init ();
}
# endregion


An error screenshot:

CodePudding user response:

COClass_n_yh_interface content is what? Is his own definition or reference?

CodePudding user response:

references on the 1st floor buses meet response:
COClass_n_yh_interface content is what? Is his own definition or reference?


Is referenced, the content inside don't know, should not content of the problem, as a parameter

CodePudding user response:

If the DLL is written in c #, you use Windows's own IL disassembler see inside the constructor method

CodePudding user response:

To the administrator mode vs try... This cannot be created are generally access error

CodePudding user response:

You copy all the files under yinhaisoft to the debug directory is ok, but you will be another error below:

Then there is no then, I was stuck in here not bottom go to, don't know you solve have no?

CodePudding user response:

DLLS are need to debug or folder with the environment, but COClass_n_yh_interface. The init is probably a pointer, the parameter types may be wrong, this should have the document to you, or you won't let you do

CodePudding user response:

Projects to use x86 compiler, using anyCPU has the problem, that's what I was solved

CodePudding user response:

Compilation, into a 32-bit CPU, try it
  •  Tags:  
  • C#
  • Related