Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
B

baloup

@baloup
About
Posts
1
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Implement ILockBytes in C# (for I_IrmProtector)
    B baloup

    I need to invoke functions of the Microsoft Office Protector (OpcIrmProtector) from C#. This protector implements the I_IrmProtector interface (details: http://msdn.microsoft.com/en-us/library/ms475158%28v=office.14%29.aspx[^]). Calling HrInit() is no problem. But for e.g. HrIsProtected() I need to provide an implementation of ILockBytes. Has anybody experience how to correctly implement ILockBytes in managed code? I am a bit at a loss as to what is expected here. For unmanaged code I found a sample that uses CreateILockBytesOnHGlobal(). This returns an unmanaged instance of ILockBytes. Is there any chance of using this unmanaged instance from managed code (probably not...) or marshalling it into a managed structure? Or is there a similar method for C#? In that case I wouldn't have to implement ILockBytes, which would save me a lot of time. Of course, I could implement this part in unmanaged code, but I'd prefer a solution in managed code, if possible... Thank you!

    COM question csharp com help tutorial
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups