.NET IMAPI2 Code samples

Is anyone using SampleApp3 successfully

After installing the Vista SDK Beta2 and trying to build this with Visual Studio 2005, I get:

------ Rebuild All started: Project: Demo3, Configuration: Debug Any CPU ------

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets : warning MSB3287: Cannot load type library for reference "IMAPI2". Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED))

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets : warning MSB3287: Cannot load type library for reference "IMAPI2FS". Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED))

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Csc.exe /noconfig /nowarn:1701,1702 /errorreport:prompt /warn:4 /define:DEBUG;TRACE /reference:..\..\Lib\ImapiHelperLib.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Data.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Xml.dll /debug+ /debug:full /optimize- /out:obj\Debug\Demo3.exe /target:exe Program.cs Properties\AssemblyInfo.cs

C:\save\imapi\SampleApp3\Demo3\Demo3\Program.cs(5,7): error CS0246: The type or namespace name 'IMAPI2' could not be found (are you missing a using directive or an assembly reference )

C:\save\imapi\SampleApp3\Demo3\Demo3\Program.cs(6,13): error CS0246: The type or namespace name 'IMAPI2FS' could not be found (are you missing a using directive or an assembly reference )

C:\save\imapi\SampleApp3\Demo3\Demo3\Program.cs(42,38): error CS0246: The type or namespace name 'IDiscFormat2Data' could not be found (are you missing a using directive or an assembly reference )

C:\save\imapi\SampleApp3\Demo3\Demo3\Program.cs(42,64): error CS0246: The type or namespace name 'IDiscFormat2DataEventArgs' could not be found (are you missing a using directive or an assembly reference )

C:\save\imapi\SampleApp3\Demo3\Demo3\Program.cs(58,75): error CS0246: The type or namespace name 'IDiscRecorder2' could not be found (are you missing a using directive or an assembly reference )

C:\save\imapi\SampleApp3\Demo3\Demo3\Program.cs(60,79): error CS0246: The type or namespace name 'IDiscRecorder2' could not be found (are you missing a using directive or an assembly reference )

C:\save\imapi\SampleApp3\Demo3\Demo3\Program.cs(62,9): error CS0246: The type or namespace name 'IDiscRecorder2' could not be found (are you missing a using directive or an assembly reference )

C:\save\imapi\SampleApp3\Demo3\Demo3\Program.cs(70,9): error CS0246: The type or namespace name 'IMAPI2' could not be found (are you missing a using directive or an assembly reference )

C:\save\imapi\SampleApp3\Demo3\Demo3\Program.cs(72,9): error CS0246: The type or namespace name 'IMAPI2' could not be found (are you missing a using directive or an assembly reference )

C:\save\imapi\SampleApp3\Demo3\Demo3\Program.cs(88,9): error CS0246: The type or namespace name 'IMAPI2' could not be found (are you missing a using directive or an assembly reference )

Compile complete -- 10 errors, 0 warnings

Done building project "Demo3.csproj" -- FAILED.

========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========



Answer this question

.NET IMAPI2 Code samples

  • 71EFBB98-D1FE-4eff-BAC5-F94AC74

    Hi foobar,

    Is this issue resolved, I am also facing similar issue, if have found the solution/solved it... Please let me know.

    I am trying to automate the build and when i ran the team build i got the below error

    Solution: Net2.sln, Project: Net2.Business.csproj, Compilation errors and warnings

    C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets(0,0): warning MSB3287: Cannot load type library for reference "ADDRESSOBJECTLib". Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED)).

    Solution: , Project: Net2.sln, Compilation errors and warnings

    (0,0): warning MSB3021: Unable to copy file "D:\NetTeamBuild\BuildLocation\NET2\Testbuild\Net\CommonFiles\Assemblies\Ajax.dll" to "Phly.PathNet2.Presentation\\Bin\Ajax.dll". Could not find a part of the path 'D:\NetTeamBuild\BuildLocation\NET2\Testbuild\Net\CommonFiles\Assemblies\Ajax.dll'.

    (0,0): warning MSB3021: Unable to copy file "D:\NetTeamBuild\BuildLocation\NET2\Testbuild\Sources\Program Files\Obout\Component\NET2.0\obout_Splitter2_Net.dll" to "Net2.Presentation\\Bin\obout_Splitter2_Net.dll". Could not find a part of the path 'D:\NetTeamBuild\BuildLocation\NET2\Testbuild\Sources\Program Files\Obout\Component\NET2.0\obout_Splitter2_Net.dll'.

    Any help or pointer regarding this is deeply appreciated.

    Thanks,

    Venki


  • Ken98045

    The warnings are expected - the IDiscRecorder2Ex interface uses some wicked data structures. Again, are you running your test on a Vista box

  • shunt

    Are you building it on a Vista machine

    If so, could you remove a reference to IMAPI2 and re-add it using COM tab



  • fjcardoso

    I readded the references - same run time result.

    What do you think of all the warnings though...

    ------ Rebuild All started: Project: Demo3, Configuration: Debug Any CPU ------
    C:\Windows\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets : warning : At least one of the arguments for 'MsftDiscRecorder2.ReadDvdStructure' cannot be marshaled by the runtime marshaler. Such arguments will therefore be passed as a pointer and may require unsafe code to manipulate.
    C:\Windows\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets : warning : At least one of the arguments for 'MsftDiscRecorder2.GetAdapterDescriptor' cannot be marshaled by the runtime marshaler. Such arguments will therefore be passed as a pointer and may require unsafe code to manipulate.
    C:\Windows\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets : warning : At least one of the arguments for 'MsftDiscRecorder2.GetDeviceDescriptor' cannot be marshaled by the runtime marshaler. Such arguments will therefore be passed as a pointer and may require unsafe code to manipulate.
    C:\Windows\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets : warning : At least one of the arguments for 'MsftDiscRecorder2.GetDiscInformation' cannot be marshaled by the runtime marshaler. Such arguments will therefore be passed as a pointer and may require unsafe code to manipulate.
    C:\Windows\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets : warning : At least one of the arguments for 'MsftDiscRecorder2.GetTrackInformation' cannot be marshaled by the runtime marshaler. Such arguments will therefore be passed as a pointer and may require unsafe code to manipulate.
    C:\Windows\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets : warning : At least one of the arguments for 'MsftDiscRecorder2.GetFeaturePage' cannot be marshaled by the runtime marshaler. Such arguments will therefore be passed as a pointer and may require unsafe code to manipulate.
    C:\Windows\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets : warning : At least one of the arguments for 'MsftDiscRecorder2.GetModePage' cannot be marshaled by the runtime marshaler. Such arguments will therefore be passed as a pointer and may require unsafe code to manipulate.
    C:\Windows\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets : warning : At least one of the arguments for 'MsftDiscRecorder2.GetSupportedFeaturePages' cannot be marshaled by the runtime marshaler. Such arguments will therefore be passed as a pointer and may require unsafe code to manipulate.
    C:\Windows\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets : warning : At least one of the arguments for 'MsftDiscRecorder2.GetSupportedProfiles' cannot be marshaled by the runtime marshaler. Such arguments will therefore be passed as a pointer and may require unsafe code to manipulate.
    C:\Windows\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets : warning : At least one of the arguments for 'MsftDiscRecorder2.GetSupportedModePages' cannot be marshaled by the runtime marshaler. Such arguments will therefore be passed as a pointer and may require unsafe code to manipulate.
    C:\Windows\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets : warning : At least one of the arguments for 'IDiscRecorder2Ex.ReadDvdStructure' cannot be marshaled by the runtime marshaler. Such arguments will therefore be passed as a pointer and may require unsafe code to manipulate.
    C:\Windows\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets : warning : At least one of the arguments for 'IDiscRecorder2Ex.GetAdapterDescriptor' cannot be marshaled by the runtime marshaler. Such arguments will therefore be passed as a pointer and may require unsafe code to manipulate.
    C:\Windows\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets : warning : At least one of the arguments for 'IDiscRecorder2Ex.GetDeviceDescriptor' cannot be marshaled by the runtime marshaler. Such arguments will therefore be passed as a pointer and may require unsafe code to manipulate.
    C:\Windows\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets : warning : At least one of the arguments for 'IDiscRecorder2Ex.GetDiscInformation' cannot be marshaled by the runtime marshaler. Such arguments will therefore be passed as a pointer and may require unsafe code to manipulate.
    C:\Windows\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets : warning : At least one of the arguments for 'IDiscRecorder2Ex.GetTrackInformation' cannot be marshaled by the runtime marshaler. Such arguments will therefore be passed as a pointer and may require unsafe code to manipulate.
    C:\Windows\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets : warning : At least one of the arguments for 'IDiscRecorder2Ex.GetFeaturePage' cannot be marshaled by the runtime marshaler. Such arguments will therefore be passed as a pointer and may require unsafe code to manipulate.
    C:\Windows\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets : warning : At least one of the arguments for 'IDiscRecorder2Ex.GetModePage' cannot be marshaled by the runtime marshaler. Such arguments will therefore be passed as a pointer and may require unsafe code to manipulate.
    C:\Windows\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets : warning : At least one of the arguments for 'IDiscRecorder2Ex.GetSupportedFeaturePages' cannot be marshaled by the runtime marshaler. Such arguments will therefore be passed as a pointer and may require unsafe code to manipulate.
    C:\Windows\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets : warning : At least one of the arguments for 'IDiscRecorder2Ex.GetSupportedProfiles' cannot be marshaled by the runtime marshaler. Such arguments will therefore be passed as a pointer and may require unsafe code to manipulate.
    C:\Windows\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets : warning : At least one of the arguments for 'IDiscRecorder2Ex.GetSupportedModePages' cannot be marshaled by the runtime marshaler. Such arguments will therefore be passed as a pointer and may require unsafe code to manipulate.
    C:\Windows\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets : warning : At least one of the arguments for 'MsftStreamPrng001.get_ExtendedSeed' cannot be marshaled by the runtime marshaler. Such arguments will therefore be passed as a pointer and may require unsafe code to manipulate.
    C:\Windows\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets : warning : At least one of the arguments for 'IStreamPseudoRandomBased.get_ExtendedSeed' cannot be marshaled by the runtime marshaler. Such arguments will therefore be passed as a pointer and may require unsafe code to manipulate.
    C:\Windows\Microsoft.NET\Framework\v2.0.50727\Csc.exe /noconfig /nowarn:1701,1702 /errorreport:prompt /warn:4 /define:DEBUG;TRACE /reference:..\..\Lib\ImapiHelperLib.dll /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Data.dll /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.dll /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Xml.dll /reference:obj\Debug\Interop.IMAPI2.dll /reference:obj\Debug\Interop.IMAPI2FS.dll /debug+ /debug:full /optimize- /out:obj\Debug\Demo3.exe /target:exe Program.cs Properties\AssemblyInfo.cs

    Compile complete -- 0 errors, 0 warnings
    Demo3 -> C:\chris\SampleApp3\Demo3\Demo3\bin\Debug\Demo3.exe
    Done building project "Demo3.csproj".
    ========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========


  • AlexBB

    Yes, building and running on Vista (5384)


  • .NET IMAPI2 Code samples