S
STG
Greetings,
My group has an SDK that was developed 5 years ago with VC++ 6.
Over the last years, the requests for a VS.NET SDK has reached critical mass
and I am now in the process of doing that.
Actually, the first release of this 'port' is be a simple rebuild of the
unmanaged C++ SDK in VS.NET. I have done this part already, using VS.NET
2003. [This will allow VS.NET users to debug with our SDK without having to
manually pull in the VC++ 6.0 debug DLLs.]
The reason I chose to use VS.NET 2003 was that this is a seachange for me,
and all of the books and references I have acquired reference Managed C++.
I thought I could stand to learn the concepts with the references I had and
then switch to VS 2005/C++/CLI, knowing that this will represent another (if
smaller) seachange.
The plan for the next phase of my SDK includes a managed wrapper for the
unmanaged SDK. I had planned for this to be done in VS 2005 using C++/CLI,
after a bit of a learning curve. It's a pedestrian approach, I know.
Perhaps these plans are misguided; read on.
Today I started creating a Managed C++ winforms sample application for my
unmanaged C++ SDK.
In the process, I stumbled upon what I think is a bug in the VC++ 7.1
compiler:
My SDK unmanaged class has the following declarations:
typedef enum
{
CNX_NONE = -2
, CNX_UNKNOWN = -1
, CNX_USB = 0
, CNX_SER
} eCommType;
class SDKobject
{
...
public:
eCommType FindCnx();
BOOL CnxReady();
...
};
In my Managed C++ sample code, I would like to do something like the
following (not exactly, but this represents the errors I am encountering):
void WinformSample::Form1::Connect( void )
{
SDKobject device;
__box( device.FindCnx() ); // This line produces a compiler
error: error C3149: 'System::Enum' : illegal
// use of managed type 'System::Enum'; did you forget a '*'?
if ( __box( device.CnxReady() ) ) // This line produces no compiler
error
{
}
else
{
device.FindCnx(); // This produces no
compiler error, but it will create garbage-collection problems at runtime,
won't it?
}
}
From what I have gathered, the System::Enum compiler error is something that
is supposed to be fixed in VS2005. I haven't verified this; I discovered
this morning that rebuilding the SDK in VS2005 is not going to be a walk in
the park either. It may not be that bad, but time is running short, and I
don't want to go through the trouble right now if it isn't going to solve
the problem.
So, I have a few questions for those of you who are willing to offer advice:
1. First, is there a solution/workaround to the compile problem I have
illustrated in VS.NET 2003?
2. If I find a solution to #1 and release the SDK built w/ VS.NET 2003, am
I going to introduce more serious pain to SDK users out there who have
already moved on to VS 2005? What will they have to do to make it work?
3. If I go ahead and build/release with VS 2005, am I going to introduce a
world of hurt to VS.NET 2003 users?
3a. I am already planning to continue to maintain the SDK w/ VC++ 6 for
awhile. I'm resigned to the idea of maintaining two flavors of the SDK. I
really don't want to go for three flavors..
Thank you A WHOLE LOT for reading this far. I eagerly await your opinion.
Suz
My group has an SDK that was developed 5 years ago with VC++ 6.
Over the last years, the requests for a VS.NET SDK has reached critical mass
and I am now in the process of doing that.
Actually, the first release of this 'port' is be a simple rebuild of the
unmanaged C++ SDK in VS.NET. I have done this part already, using VS.NET
2003. [This will allow VS.NET users to debug with our SDK without having to
manually pull in the VC++ 6.0 debug DLLs.]
The reason I chose to use VS.NET 2003 was that this is a seachange for me,
and all of the books and references I have acquired reference Managed C++.
I thought I could stand to learn the concepts with the references I had and
then switch to VS 2005/C++/CLI, knowing that this will represent another (if
smaller) seachange.
The plan for the next phase of my SDK includes a managed wrapper for the
unmanaged SDK. I had planned for this to be done in VS 2005 using C++/CLI,
after a bit of a learning curve. It's a pedestrian approach, I know.
Perhaps these plans are misguided; read on.
Today I started creating a Managed C++ winforms sample application for my
unmanaged C++ SDK.
In the process, I stumbled upon what I think is a bug in the VC++ 7.1
compiler:
My SDK unmanaged class has the following declarations:
typedef enum
{
CNX_NONE = -2
, CNX_UNKNOWN = -1
, CNX_USB = 0
, CNX_SER
} eCommType;
class SDKobject
{
...
public:
eCommType FindCnx();
BOOL CnxReady();
...
};
In my Managed C++ sample code, I would like to do something like the
following (not exactly, but this represents the errors I am encountering):
void WinformSample::Form1::Connect( void )
{
SDKobject device;
__box( device.FindCnx() ); // This line produces a compiler
error: error C3149: 'System::Enum' : illegal
// use of managed type 'System::Enum'; did you forget a '*'?
if ( __box( device.CnxReady() ) ) // This line produces no compiler
error
{
}
else
{
device.FindCnx(); // This produces no
compiler error, but it will create garbage-collection problems at runtime,
won't it?
}
}
From what I have gathered, the System::Enum compiler error is something that
is supposed to be fixed in VS2005. I haven't verified this; I discovered
this morning that rebuilding the SDK in VS2005 is not going to be a walk in
the park either. It may not be that bad, but time is running short, and I
don't want to go through the trouble right now if it isn't going to solve
the problem.
So, I have a few questions for those of you who are willing to offer advice:
1. First, is there a solution/workaround to the compile problem I have
illustrated in VS.NET 2003?
2. If I find a solution to #1 and release the SDK built w/ VS.NET 2003, am
I going to introduce more serious pain to SDK users out there who have
already moved on to VS 2005? What will they have to do to make it work?
3. If I go ahead and build/release with VS 2005, am I going to introduce a
world of hurt to VS.NET 2003 users?
3a. I am already planning to continue to maintain the SDK w/ VC++ 6 for
awhile. I'm resigned to the idea of maintaining two flavors of the SDK. I
really don't want to go for three flavors..
Thank you A WHOLE LOT for reading this far. I eagerly await your opinion.
Suz