c# - Reference shell32.dll in a programmatically compiled program? -
i need shell32 in program create shortcut.
this code:
var compiler = new csharpcodeprovider(); var params = new system.codedom.compiler.compilerparameters { generateexecutable = true, outputassembly = outputname, referencedassemblies = { "system.dll", "system.core.dll", "system.windows.forms.dll", "system.drawing.dll", @"c:\windows\system32\shell32.dll" } };
doing this, error:
metadata file c:\windows\system32\shell32.dll not opened. attempt made load program incorrect format.
found nothing while searching.. wasn't sure search :/
how go doing this?
shell32.dll (windows file systems don't care case, "s" or "s" shouldn't matter) not .net assembly , can't treated such.
if want call functions exported non-.net libraries, should use dllimportattribute
.
Comments
Post a Comment