A
Anders Eriksson
I have an ActiveX library that I need to use to control some hardware.
This ActiveX has a public interface called System.
I know that it's stupid but it's a fact!
If I put the using statements before my namespace everything works, but
if I put them inside my namespace (like Stylecop wants) The
sub-type names of System will not be found since System is assumed to be
in the ActiveX namespace.
Why and can I do anything about it and still have the using within my
namespace?
=This works=
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Text;
using System.Windows.Forms;
using laserengineLib; // this is the Interop for the ActiveX library
namespace DcSelectMark
{
=This doesn't work=
namespace DcSelectMark
{
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Text;
using System.Windows.Forms;
using laserengineLib; // this is the Interop for the ActiveX library
I get this error message:
namespace System.Collections
Error:
The type name 'Collections' does not exist in the type
'laserengineLib.System'
I get the same error for
System.ComponentModel
System.Data
System.Drawing
System.IO
System.Text
System.Windows
// Anders
This ActiveX has a public interface called System.
I know that it's stupid but it's a fact!
If I put the using statements before my namespace everything works, but
if I put them inside my namespace (like Stylecop wants) The
sub-type names of System will not be found since System is assumed to be
in the ActiveX namespace.
Why and can I do anything about it and still have the using within my
namespace?
=This works=
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Text;
using System.Windows.Forms;
using laserengineLib; // this is the Interop for the ActiveX library
namespace DcSelectMark
{
=This doesn't work=
namespace DcSelectMark
{
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Text;
using System.Windows.Forms;
using laserengineLib; // this is the Interop for the ActiveX library
I get this error message:
namespace System.Collections
Error:
The type name 'Collections' does not exist in the type
'laserengineLib.System'
I get the same error for
System.ComponentModel
System.Data
System.Drawing
System.IO
System.Text
System.Windows
// Anders