About "ActivateDevice"

  • Thread starter Thread starter cfyam
  • Start date Start date
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.

-Chris
 
I have the same question....
I am writing a startup app for my CE device and I'm upgrading an old VC
app to .NET
Any thoughts would be appeaciated...

best regards,

James
 
They APIs are simple enough to P/Invoke, but again I question the situation
where you need to manually load or unload a driver. Why do you need to?

-Chris
 
Hi Chris,

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...

Thanks,

James
 
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);

Chris Tacke
OpenNETCF Consulting
www.opennetcf.com
 
Back
Top