T
Todd R. Jacobs
Hi group,
I had this with VS2003 Managed C++
pro-to-types:
===================================
TimeHandler.h
class TimeHandler
{
public:
TimeHandler(void);
virtual ~TimeHandler(void);
// Adjust time span
static bool AdjTime(TimeSpan *tsLogSpan);
};
===================================
TimeHandler.cpp
// Adjust time span
bool TimeHandler::AdjTime(TimeSpan* tsStatusLogSpan)
{
// Adjust TimeSpan here
// ...
}
===================================
Form1.h
#include "TimeHandler.h"
nanespace MyForm
{
public __gc class Form1 : public System::Windows::Forms::Form
{
static TimeSpan tsSpan = 0;
// ...
private: System::Void ShowTimeSpan_Click(System::Object * sender,
System::EventArgs * e)
{
Pass in a pointer to our TimeSpan
AdjTime ( &tsSpan );
// Display adjusted TimeSpan ...
}
};
}
===================================
And now I am trying to do the same with 2005 /clrure
===================================
TimeHandler.h
TimeHandler.cpp
SAME AS BEFORE
===================================
Form1.h
#include "TimeHandler.h"
namespace MyForm
{
public ref class Form1 : public System::Windows::Forms::Form
{
static TimeSpan tsStatusLogSpan = TimeSpan(0);
// ...
#pragma region Windows Form Designer generated code
/// ...
#pragma endregion
private: System::Void ShowTime_Click(System::Object^ sender,
System::EventArgs^ e)
{
Pass in a pointer to our TimeSpan
AdjTime ( &tsSpan );
// Display adjusted TimeSpan ...
}
};
}
I am getting the C2664 Error: cannot convert 'cli::interior_ptr<Type>' to
'System::TimeSpan *'
which after looking at the docs would be expected. But I still haven't found
where it shows how to fix it.
Can anyone show me what I need to change?
TIA,
Todd
I had this with VS2003 Managed C++
pro-to-types:
===================================
TimeHandler.h
class TimeHandler
{
public:
TimeHandler(void);
virtual ~TimeHandler(void);
// Adjust time span
static bool AdjTime(TimeSpan *tsLogSpan);
};
===================================
TimeHandler.cpp
// Adjust time span
bool TimeHandler::AdjTime(TimeSpan* tsStatusLogSpan)
{
// Adjust TimeSpan here
// ...
}
===================================
Form1.h
#include "TimeHandler.h"
nanespace MyForm
{
public __gc class Form1 : public System::Windows::Forms::Form
{
static TimeSpan tsSpan = 0;
// ...
private: System::Void ShowTimeSpan_Click(System::Object * sender,
System::EventArgs * e)
{
Pass in a pointer to our TimeSpan
AdjTime ( &tsSpan );
// Display adjusted TimeSpan ...
}
};
}
===================================
And now I am trying to do the same with 2005 /clrure
===================================
TimeHandler.h
TimeHandler.cpp
SAME AS BEFORE
===================================
Form1.h
#include "TimeHandler.h"
namespace MyForm
{
public ref class Form1 : public System::Windows::Forms::Form
{
static TimeSpan tsStatusLogSpan = TimeSpan(0);
// ...
#pragma region Windows Form Designer generated code
/// ...
#pragma endregion
private: System::Void ShowTime_Click(System::Object^ sender,
System::EventArgs^ e)
{
Pass in a pointer to our TimeSpan
AdjTime ( &tsSpan );
// Display adjusted TimeSpan ...
}
};
}
I am getting the C2664 Error: cannot convert 'cli::interior_ptr<Type>' to
'System::TimeSpan *'
which after looking at the docs would be expected. But I still haven't found
where it shows how to fix it.
Can anyone show me what I need to change?
TIA,
Todd