Hello, I’m suffering so much now about extracting variables from dll

There is a library glew32.dll In it is the variable GLEW_OK

[DllImport(@"glew32.dll",CallingConvention = CallingConvention.Cdecl)] static extern bool glewInit(); static extern int GLEW_OK; 

enter image description here

  • 2
    It is unlikely that it is there - it is a constant ... - Qwertiy
  • I can offer the option "manually". Import GetProcAddress, get IntPtr from it, and through Interprop you can read int (But it's easier to declare a constant) - nick_n_a
  • @Qwertiy In theory, I need the value of this constant. - SVD102
  • @nick_n_a In theory, I need the value of this constant. - SVD102
  • I would still look for a ready managed wrapper. But in general, what do you do with open gl - can a game? Look then at Unity. And so, look for the declarations of all the constants in the downloaded source code (use the file search). For example, I found online: tynts . - Alexander Petrov

1 answer 1

Variables are not "extracted from dll". And they are simply declared in the header (declaration) as a constant, in the C # code itself.