Let's step back and ask why you think you need to? These APIs are for
loading and unloading drivers and it's pretty rare in any environment that
your app would be calling them.
To be honest, I am simply trying to simplify my platform deployment.
I have a 'standard' platform that includes all the drivers & registry
entries for all the possible hardware supported on my device, and I aim
to customise the capabilities of the device simply by starting the
required drivers...
Do you have any good examples of using P/Invoke? I've never needed to
play with the API from C# before...
Since I'm curious, you're saying your platform by default doesn't have the
drivers loaded? Why not simply adjust the registry for the capbilities of
the driver (setting the driver's Flags entry to not start for example)
rather than doing it at the app level?
Again, I'm not sure I agree with the design, but then it's not my platform.
For P/Invoke there are a couple good introductory articles in MSDN - that's
the best place to start.
For this specific case, here's the definition:
[DllImport("coredll.dll", SetLastError=true)]
public extern static IntPtr ActivateDevice(string lpszDevKey, int
dwClientInfo);
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.