cybecks
asked on
CAn someone help me to fix these errors please?
I'm using Visual C++ 2005 and I recieved the following errors when trying to compile my program:
Medications.cpp
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\Medicati ons.h(13) : error C4980: '__gc' : use of this keyword requires /clr:oldSyntax command line option
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\Medicati ons.h(16) : error C3699: '*' : cannot use this indirection on type 'System::String'
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\Medicati ons.h(17) : error C3699: '*' : cannot use this indirection on type 'System::String'
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\Medicati ons.h(18) : error C3699: '*' : cannot use this indirection on type 'System::String'
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\Medicati ons.h(19) : error C3699: '*' : cannot use this indirection on type 'System::String'
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\Medicati ons.h(23) : error C3699: '*' : cannot use this indirection on type 'System::String'
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\Medicati ons.h(23) : error C3699: '*' : cannot use this indirection on type 'System::String'
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\Medicati ons.h(23) : error C3699: '*' : cannot use this indirection on type 'System::String'
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\Medicati ons.h(23) : error C3699: '*' : cannot use this indirection on type 'System::String'
compiler replacing '*' with '^' to continue parsing
.\Medications.cpp(6) : error C3921: Use of S-prefixed strings requires /clr:oldSyntax command line option
When compiling with /clr, an implicit conversion exists from string literal type to System::String^. If necessary to avoid ambiguity, cast to System::String^
.\Medications.cpp(7) : error C3921: Use of S-prefixed strings requires /clr:oldSyntax command line option
When compiling with /clr, an implicit conversion exists from string literal type to System::String^. If necessary to avoid ambiguity, cast to System::String^
.\Medications.cpp(8) : error C3921: Use of S-prefixed strings requires /clr:oldSyntax command line option
When compiling with /clr, an implicit conversion exists from string literal type to System::String^. If necessary to avoid ambiguity, cast to System::String^
.\Medications.cpp(9) : error C3921: Use of S-prefixed strings requires /clr:oldSyntax command line option
When compiling with /clr, an implicit conversion exists from string literal type to System::String^. If necessary to avoid ambiguity, cast to System::String^
.\Medications.cpp(11) : error C3699: '*' : cannot use this indirection on type 'System::String'
compiler replacing '*' with '^' to continue parsing
.\Medications.cpp(11) : error C3699: '*' : cannot use this indirection on type 'System::String'
compiler replacing '*' with '^' to continue parsing
.\Medications.cpp(11) : error C3699: '*' : cannot use this indirection on type 'System::String'
compiler replacing '*' with '^' to continue parsing
.\Medications.cpp(11) : error C3699: '*' : cannot use this indirection on type 'System::String'
compiler replacing '*' with '^' to continue parsing
.\Medications.cpp(19) : error C2084: function 'Medications::Medications( void)' already has a body
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\Medicati ons.h(22) : see previous definition of '{ctor}'
NewMeds.cpp
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\Medicati ons.h(13) : error C4980: '__gc' : use of this keyword requires /clr:oldSyntax command line option
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\Medicati ons.h(16) : error C3699: '*' : cannot use this indirection on type 'System::String'
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\Medicati ons.h(17) : error C3699: '*' : cannot use this indirection on type 'System::String'
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\Medicati ons.h(18) : error C3699: '*' : cannot use this indirection on type 'System::String'
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\Medicati ons.h(19) : error C3699: '*' : cannot use this indirection on type 'System::String'
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\Medicati ons.h(23) : error C3699: '*' : cannot use this indirection on type 'System::String'
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\Medicati ons.h(23) : error C3699: '*' : cannot use this indirection on type 'System::String'
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\Medicati ons.h(23) : error C3699: '*' : cannot use this indirection on type 'System::String'
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\Medicati ons.h(23) : error C3699: '*' : cannot use this indirection on type 'System::String'
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(79) : error C2144: syntax error : 'void' should be preceded by ';'
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(79) : error C3699: '*' : cannot use this indirection on type 'System::Collections::Arra yList'
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(189) : error C3921: Use of S-prefixed strings requires /clr:oldSyntax command line option
When compiling with /clr, an implicit conversion exists from string literal type to System::String^. If necessary to avoid ambiguity, cast to System::String^
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(226) : error C3699: '*' : cannot use this indirection on type 'System::Object'
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(226) : error C3699: '*' : cannot use this indirection on type 'System::EventArgs'
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(230) : error C3921: Use of S-prefixed strings requires /clr:oldSyntax command line option
When compiling with /clr, an implicit conversion exists from string literal type to System::String^. If necessary to avoid ambiguity, cast to System::String^
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(253) : error C3921: Use of S-prefixed strings requires /clr:oldSyntax command line option
When compiling with /clr, an implicit conversion exists from string literal type to System::String^. If necessary to avoid ambiguity, cast to System::String^
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(255) : error C3921: Use of S-prefixed strings requires /clr:oldSyntax command line option
When compiling with /clr, an implicit conversion exists from string literal type to System::String^. If necessary to avoid ambiguity, cast to System::String^
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(260) : error C3921: Use of S-prefixed strings requires /clr:oldSyntax command line option
When compiling with /clr, an implicit conversion exists from string literal type to System::String^. If necessary to avoid ambiguity, cast to System::String^
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(188) : error C3699: '*' : cannot use this indirection on type 'System::Runtime::Serializ ation::For matters::S oap::SoapF ormatter'
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(188) : error C2750: 'System::Runtime::Serializ ation::For matters::S oap::SoapF ormatter' : cannot use 'new' on the reference type; use 'gcnew' instead
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(188) : error C2440: 'initializing' : cannot convert from 'System::Runtime::Serializ ation::For matters::S oap::SoapF ormatter *' to 'System::Runtime::Serializ ation::For matters::S oap::SoapF ormatter ^'
No user-defined-conversion operator available, or
Cannot convert an unmanaged type to a managed type
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(189) : error C3699: '*' : cannot use this indirection on type 'System::String'
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(193) : error C3699: '*' : cannot use this indirection on type 'System::IO::FileStream'
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(193) : error C2750: 'System::IO::FileStream' : cannot use 'new' on the reference type; use 'gcnew' instead
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(193) : error C2440: 'initializing' : cannot convert from 'System::IO::FileStream *' to 'System::IO::FileStream ^'
No user-defined-conversion operator available, or
Cannot convert an unmanaged type to a managed type
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(194) : error C3699: '*' : cannot use this indirection on type 'System::Collections::Arra yList'
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(194) : error C3699: '*' : cannot use this indirection on type 'System::Collections::Arra yList'
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(198) : error C3699: '*' : cannot use this indirection on type 'Medications'
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(202) : error C2065: 'lstMeds' : undeclared identifier
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(202) : error C2227: left of '->Count' must point to class/struct/union/generic type
type is ''unknown-type''
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(204) : error C3293: 'Item': use 'default' to access the default property (indexer) for class 'System::Collections::Arra yList'
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(205) : error C3699: '*' : cannot use this indirection on type 'System::Windows::Forms::L istViewIte m'
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(205) : error C2750: 'System::Windows::Forms::L istViewIte m' : cannot use 'new' on the reference type; use 'gcnew' instead
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(205) : error C2440: 'initializing' : cannot convert from 'System::Windows::Forms::L istViewIte m *' to 'System::Windows::Forms::L istViewIte m ^'
No user-defined-conversion operator available, or
Cannot convert an unmanaged type to a managed type
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(206) : error C2750: 'System::Drawing::Font' : cannot use 'new' on the reference type; use 'gcnew' instead
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(206) : error C2664: 'System::Windows::Forms::L istViewIte m::Font::s et' : cannot convert parameter 1 from 'System::Drawing::Font *' to 'System::Drawing::Font ^'
No user-defined-conversion operator available, or
Cannot convert an unmanaged type to a managed type
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(228) : error C2065: 'lstMed' : undeclared identifier
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(228) : error C2750: 'System::Collections::Arra yList' : cannot use 'new' on the reference type; use 'gcnew' instead
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(229) : error C3699: '*' : cannot use this indirection on type 'System::Runtime::Serializ ation::For matters::S oap::SoapF ormatter'
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(229) : error C2750: 'System::Runtime::Serializ ation::For matters::S oap::SoapF ormatter' : cannot use 'new' on the reference type; use 'gcnew' instead
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(229) : error C2440: 'initializing' : cannot convert from 'System::Runtime::Serializ ation::For matters::S oap::SoapF ormatter *' to 'System::Runtime::Serializ ation::For matters::S oap::SoapF ormatter ^'
No user-defined-conversion operator available, or
Cannot convert an unmanaged type to a managed type
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(230) : error C3699: '*' : cannot use this indirection on type 'System::String'
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(234) : error C3699: '*' : cannot use this indirection on type 'System::IO::FileStream'
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(234) : error C2750: 'System::IO::FileStream' : cannot use 'new' on the reference type; use 'gcnew' instead
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(234) : error C2440: 'initializing' : cannot convert from 'System::IO::FileStream *' to 'System::IO::FileStream ^'
No user-defined-conversion operator available, or
Cannot convert an unmanaged type to a managed type
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(236) : error C2065: 'bcrStream' : undeclared identifier
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(238) : error C2227: left of '->Close' must point to class/struct/union/generic type
type is ''unknown-type''
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(241) : error C3861: 'ShowEmployees': identifier not found
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(249) : error C3699: '*' : cannot use this indirection on type 'mymeds::NewMedications'
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(249) : error C2750: 'mymeds::NewMedications' : cannot use 'new' on the reference type; use 'gcnew' instead
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(249) : error C2440: 'initializing' : cannot convert from 'mymeds::NewMedications *' to 'mymeds::NewMedications ^'
No user-defined-conversion operator available, or
Cannot convert an unmanaged type to a managed type
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(251) : error C2039: 'OK' : is not a member of 'System::Windows::Forms::F orm::Dialo gResult'
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\AddMeds. h(24) : see declaration of 'System::Windows::Forms::F orm::Dialo gResult'
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(251) : error C2065: 'OK' : undeclared identifier
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(260) : error C3699: '*' : cannot use this indirection on type 'System::String'
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(261) : error C3699: '*' : cannot use this indirection on type 'Medications'
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(261) : error C2750: 'Medications' : cannot use 'new' on the reference type; use 'gcnew' instead
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(261) : error C2440: 'initializing' : cannot convert from 'Medications *' to 'Medications ^'
No user-defined-conversion operator available, or
Cannot convert an unmanaged type to a managed type
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(268) : error C2227: left of '->Add' must point to class/struct/union/generic type
type is ''unknown-type''
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(270) : error C3699: '*' : cannot use this indirection on type 'System::IO::FileStream'
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(270) : error C2750: 'System::IO::FileStream' : cannot use 'new' on the reference type; use 'gcnew' instead
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(270) : error C2440: 'initializing' : cannot convert from 'System::IO::FileStream *' to 'System::IO::FileStream ^'
No user-defined-conversion operator available, or
Cannot convert an unmanaged type to a managed type
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(271) : error C3699: '*' : cannot use this indirection on type 'System::Runtime::Serializ ation::For matters::S oap::SoapF ormatter'
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(271) : error C2750: 'System::Runtime::Serializ ation::For matters::S oap::SoapF ormatter' : cannot use 'new' on the reference type; use 'gcnew' instead
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(271) : error C2440: 'initializing' : cannot convert from 'System::Runtime::Serializ ation::For matters::S oap::SoapF ormatter *' to 'System::Runtime::Serializ ation::For matters::S oap::SoapF ormatter ^'
No user-defined-conversion operator available, or
Cannot convert an unmanaged type to a managed type
mymeds.cpp
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\Medicati ons.h(13) : error C4980: '__gc' : use of this keyword requires /clr:oldSyntax command line option
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\Medicati ons.h(16) : error C3699: '*' : cannot use this indirection on type 'System::String'
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\Medicati ons.h(17) : error C3699: '*' : cannot use this indirection on type 'System::String'
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\Medicati ons.h(18) : error C3699: '*' : cannot use this indirection on type 'System::String'
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\Medicati ons.h(19) : error C3699: '*' : cannot use this indirection on type 'System::String'
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\Medicati ons.h(23) : error C3699: '*' : cannot use this indirection on type 'System::String'
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\Medicati ons.h(23) : error C3699: '*' : cannot use this indirection on type 'System::String'
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\Medicati ons.h(23) : error C3699: '*' : cannot use this indirection on type 'System::String'
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\Medicati ons.h(23) : error C3699: '*' : cannot use this indirection on type 'System::String'
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(79) : error C2144: syntax error : 'void' should be preceded by ';'
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(79) : error C3699: '*' : cannot use this indirection on type 'System::Collections::Arra yList'
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(189) : error C3921: Use of S-prefixed strings requires /clr:oldSyntax command line option
When compiling with /clr, an implicit conversion exists from string literal type to System::String^. If necessary to avoid ambiguity, cast to System::String^
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(226) : error C3699: '*' : cannot use this indirection on type 'System::Object'
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(226) : error C3699: '*' : cannot use this indirection on type 'System::EventArgs'
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(230) : error C3921: Use of S-prefixed strings requires /clr:oldSyntax command line option
When compiling with /clr, an implicit conversion exists from string literal type to System::String^. If necessary to avoid ambiguity, cast to System::String^
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(253) : error C3921: Use of S-prefixed strings requires /clr:oldSyntax command line option
When compiling with /clr, an implicit conversion exists from string literal type to System::String^. If necessary to avoid ambiguity, cast to System::String^
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(255) : error C3921: Use of S-prefixed strings requires /clr:oldSyntax command line option
When compiling with /clr, an implicit conversion exists from string literal type to System::String^. If necessary to avoid ambiguity, cast to System::String^
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(260) : error C3921: Use of S-prefixed strings requires /clr:oldSyntax command line option
When compiling with /clr, an implicit conversion exists from string literal type to System::String^. If necessary to avoid ambiguity, cast to System::String^
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(188) : error C3699: '*' : cannot use this indirection on type 'System::Runtime::Serializ ation::For matters::S oap::SoapF ormatter'
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(188) : error C2750: 'System::Runtime::Serializ ation::For matters::S oap::SoapF ormatter' : cannot use 'new' on the reference type; use 'gcnew' instead
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(188) : error C2440: 'initializing' : cannot convert from 'System::Runtime::Serializ ation::For matters::S oap::SoapF ormatter *' to 'System::Runtime::Serializ ation::For matters::S oap::SoapF ormatter ^'
No user-defined-conversion operator available, or
Cannot convert an unmanaged type to a managed type
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(189) : error C3699: '*' : cannot use this indirection on type 'System::String'
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(193) : error C3699: '*' : cannot use this indirection on type 'System::IO::FileStream'
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(193) : error C2750: 'System::IO::FileStream' : cannot use 'new' on the reference type; use 'gcnew' instead
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(193) : error C2440: 'initializing' : cannot convert from 'System::IO::FileStream *' to 'System::IO::FileStream ^'
No user-defined-conversion operator available, or
Cannot convert an unmanaged type to a managed type
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(194) : error C3699: '*' : cannot use this indirection on type 'System::Collections::Arra yList'
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(194) : error C3699: '*' : cannot use this indirection on type 'System::Collections::Arra yList'
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(198) : error C3699: '*' : cannot use this indirection on type 'Medications'
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(202) : error C2065: 'lstMeds' : undeclared identifier
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(202) : error C2227: left of '->Count' must point to class/struct/union/generic type
type is ''unknown-type''
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(204) : error C3293: 'Item': use 'default' to access the default property (indexer) for class 'System::Collections::Arra yList'
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(205) : error C3699: '*' : cannot use this indirection on type 'System::Windows::Forms::L istViewIte m'
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(205) : error C2750: 'System::Windows::Forms::L istViewIte m' : cannot use 'new' on the reference type; use 'gcnew' instead
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(205) : error C2440: 'initializing' : cannot convert from 'System::Windows::Forms::L istViewIte m *' to 'System::Windows::Forms::L istViewIte m ^'
No user-defined-conversion operator available, or
Cannot convert an unmanaged type to a managed type
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(206) : error C2750: 'System::Drawing::Font' : cannot use 'new' on the reference type; use 'gcnew' instead
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(206) : error C2664: 'System::Windows::Forms::L istViewIte m::Font::s et' : cannot convert parameter 1 from 'System::Drawing::Font *' to 'System::Drawing::Font ^'
No user-defined-conversion operator available, or
Cannot convert an unmanaged type to a managed type
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(228) : error C2065: 'lstMed' : undeclared identifier
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(228) : error C2750: 'System::Collections::Arra yList' : cannot use 'new' on the reference type; use 'gcnew' instead
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(229) : error C3699: '*' : cannot use this indirection on type 'System::Runtime::Serializ ation::For matters::S oap::SoapF ormatter'
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(229) : error C2750: 'System::Runtime::Serializ ation::For matters::S oap::SoapF ormatter' : cannot use 'new' on the reference type; use 'gcnew' instead
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(229) : error C2440: 'initializing' : cannot convert from 'System::Runtime::Serializ ation::For matters::S oap::SoapF ormatter *' to 'System::Runtime::Serializ ation::For matters::S oap::SoapF ormatter ^'
No user-defined-conversion operator available, or
Cannot convert an unmanaged type to a managed type
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(230) : error C3699: '*' : cannot use this indirection on type 'System::String'
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(234) : error C3699: '*' : cannot use this indirection on type 'System::IO::FileStream'
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(234) : error C2750: 'System::IO::FileStream' : cannot use 'new' on the reference type; use 'gcnew' instead
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(234) : error C2440: 'initializing' : cannot convert from 'System::IO::FileStream *' to 'System::IO::FileStream ^'
No user-defined-conversion operator available, or
Cannot convert an unmanaged type to a managed type
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(236) : error C2065: 'bcrStream' : undeclared identifier
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(238) : error C2227: left of '->Close' must point to class/struct/union/generic type
type is ''unknown-type''
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(241) : error C3861: 'ShowEmployees': identifier not found
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(249) : error C3699: '*' : cannot use this indirection on type 'mymeds::NewMedications'
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(249) : error C2750: 'mymeds::NewMedications' : cannot use 'new' on the reference type; use 'gcnew' instead
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(249) : error C2440: 'initializing' : cannot convert from 'mymeds::NewMedications *' to 'mymeds::NewMedications ^'
No user-defined-conversion operator available, or
Cannot convert an unmanaged type to a managed type
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(251) : error C2039: 'OK' : is not a member of 'System::Windows::Forms::F orm::Dialo gResult'
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\AddMeds. h(24) : see declaration of 'System::Windows::Forms::F orm::Dialo gResult'
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(251) : error C2065: 'OK' : undeclared identifier
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(260) : error C3699: '*' : cannot use this indirection on type 'System::String'
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(261) : error C3699: '*' : cannot use this indirection on type 'Medications'
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(261) : error C2750: 'Medications' : cannot use 'new' on the reference type; use 'gcnew' instead
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(261) : error C2440: 'initializing' : cannot convert from 'Medications *' to 'Medications ^'
No user-defined-conversion operator available, or
Cannot convert an unmanaged type to a managed type
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(268) : error C2227: left of '->Add' must point to class/struct/union/generic type
type is ''unknown-type''
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(270) : error C3699: '*' : cannot use this indirection on type 'System::IO::FileStream'
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(270) : error C2750: 'System::IO::FileStream' : cannot use 'new' on the reference type; use 'gcnew' instead
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(270) : error C2440: 'initializing' : cannot convert from 'System::IO::FileStream *' to 'System::IO::FileStream ^'
No user-defined-conversion operator available, or
Cannot convert an unmanaged type to a managed type
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(271) : error C3699: '*' : cannot use this indirection on type 'System::Runtime::Serializ ation::For matters::S oap::SoapF ormatter'
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(271) : error C2750: 'System::Runtime::Serializ ation::For matters::S oap::SoapF ormatter' : cannot use 'new' on the reference type; use 'gcnew' instead
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed s\NewMeds. h(271) : error C2440: 'initializing' : cannot convert from 'System::Runtime::Serializ ation::For matters::S oap::SoapF ormatter *' to 'System::Runtime::Serializ ation::For matters::S oap::SoapF ormatter ^'
No user-defined-conversion operator available, or
Cannot convert an unmanaged type to a managed type
Generating Code...
Here is my code:
//Medications.cpp
#include "StdAfx.h"
#include "Medications.h"
#using <mscorlib.dll>
Medications::Medications(v oid)
{
Meds = S"Unknown";
Dosage = S"Unknown";
Times = S"Unknown";
Reason = S"Unknown";
}
Medications::Medications(S ystem::Str ing *meds, System::String *dosage, System::String *times, System::String *reason)
{
Meds = meds;
Dosage = dosage;
Times = times;
Reason = reason;
}
Medications::Medications(v oid)
{
}
//Medications.h
//#pragma once
//ref class Medications
//{
//public:
// Medications(void);
//};
#pragma once
using namespace System;
[Serializable]
public __gc class Medications
{
public:
String *Meds;
String *Dosage;
String *Times;
String *Reason;
public:
Medications(void);
Medications(String *meds, String *dosage,
String *times, String *reason);
~Medications(void);
};
//NewMeds.h
#pragma once
#using <System.Runtime.Serializat ion.Format ters.Soap. dll>
#include "NewMedications.h"
#include "Medications.h"
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
using namespace System::IO;
using namespace System::Runtime::Serializa tion::Form atters::So ap;
namespace mymeds {
/// <summary>
/// Summary for NewMeds
///
/// WARNING: If you change the name of this class, you will need to change the
/// 'Resource File Name' property for the managed resource compiler tool
/// associated with all .resx files this class depends on. Otherwise,
/// the designers will not be able to interact properly with localized
/// resources associated with this form.
/// </summary>
public ref class NewMeds : public System::Windows::Forms::Fo rm
{
public:
NewMeds(void)
{
InitializeComponent();
//
//TODO: Add the constructor code here
//
}
protected:
/// <summary>
/// Clean up any resources being used.
/// </summary>
~NewMeds()
{
if (components)
{
delete components;
}
}
private: System::Windows::Forms::La bel^ label1;
private: System::Windows::Forms::Bu tton^ btnNewMedications;
private: System::Windows::Forms::Bu tton^ btnClose;
private: System::Windows::Forms::Co lumnHeader ^ colMedications;
private: System::Windows::Forms::Co lumnHeader ^ colDosage;
private: System::Windows::Forms::Co lumnHeader ^ colTimesPerDay;
private: System::Windows::Forms::Co lumnHeader ^ colReason;
private: System::Windows::Forms::Co lumnHeader ^ colAllergies;
private: System::Windows::Forms::Li stView^ lvwMedications;
protected:
private:
/// <summary>
/// Required designer variable.
/// </summary>
System::ComponentModel::Co ntainer ^components;
ArrayList *lstMedications
#pragma region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
void InitializeComponent(void)
{
this->label1 = (gcnew System::Windows::Forms::La bel());
this->btnNewMedications = (gcnew System::Windows::Forms::Bu tton());
this->btnClose = (gcnew System::Windows::Forms::Bu tton());
this->colMedications = (gcnew System::Windows::Forms::Co lumnHeader ());
this->colDosage = (gcnew System::Windows::Forms::Co lumnHeader ());
this->colTimesPerDay = (gcnew System::Windows::Forms::Co lumnHeader ());
this->colReason = (gcnew System::Windows::Forms::Co lumnHeader ());
this->colAllergies = (gcnew System::Windows::Forms::Co lumnHeader ());
this->lvwMedications = (gcnew System::Windows::Forms::Li stView());
this->SuspendLayout();
//
// label1
//
this->label1->AutoSize = true;
this->label1->Font = (gcnew System::Drawing::Font(L"Mi crosoft Sans Serif", 18, static_cast<System::Drawin g::FontSty le>((Syste m::Drawing ::FontStyl e::Bold | System::Drawing::FontStyle ::Italic)) ,
System::Drawing::GraphicsU nit::Point , static_cast<System::Byte>( 0)));
this->label1->ForeColor = System::Drawing::Color::Sl ateBlue;
this->label1->Location = System::Drawing::Point(106 , 31);
this->label1->Name = L"label1";
this->label1->Size = System::Drawing::Size(273, 29);
this->label1->TabIndex = 2;
this->label1->Text = L"My Medication Record";
//
// btnNewMedications
//
this->btnNewMedications->L ocation = System::Drawing::Point(197 , 238);
this->btnNewMedications->N ame = L"btnNewMedications";
this->btnNewMedications->S ize = System::Drawing::Size(127, 23);
this->btnNewMedications->T abIndex = 9;
this->btnNewMedications->T ext = L"New Medications";
this->btnNewMedications->U seVisualSt yleBackCol or = true;
this->btnNewMedications->C lick += gcnew System::EventHandler(this, &NewMeds::btnNewMedication s_Click);
//
// btnClose
//
this->btnClose->DialogResu lt = System::Windows::Forms::Di alogResult ::Cancel;
this->btnClose->Location = System::Drawing::Point(343 , 238);
this->btnClose->Name = L"btnClose";
this->btnClose->Size = System::Drawing::Size(75, 23);
this->btnClose->TabIndex = 10;
this->btnClose->Text = L"Close";
this->btnClose->UseVisualS tyleBackCo lor = true;
this->btnClose->Click += gcnew System::EventHandler(this, &NewMeds::btnClose_Click);
//
// colMedications
//
this->colMedications->Disp layIndex = 1;
this->colMedications->Text = L"Medications";
this->colMedications->Widt h = 113;
//
// colDosage
//
this->colDosage->DisplayIn dex = 2;
this->colDosage->Text = L"Dosage";
this->colDosage->Width = 55;
//
// colTimesPerDay
//
this->colTimesPerDay->Disp layIndex = 3;
this->colTimesPerDay->Text = L"Times Per Day";
this->colTimesPerDay->Widt h = 85;
//
// colReason
//
this->colReason->DisplayIn dex = 4;
this->colReason->Text = L"Reason";
this->colReason->Width = 362;
//
// colAllergies
//
this->colAllergies->Displa yIndex = 0;
this->colAllergies->Text = L"Allergies";
//
// lvwMedications
//
this->lvwMedications->Anch or = static_cast<System::Window s::Forms:: AnchorStyl es>((((Sys tem::Windo ws::Forms: :AnchorSty les::Top | System::Windows::Forms::An chorStyles ::Bottom)
| System::Windows::Forms::An chorStyles ::Left)
| System::Windows::Forms::An chorStyles ::Right));
this->lvwMedications->Colu mns->AddRa nge(gcnew cli::array< System::Windows::Forms::Co lumnHeader ^ >(5) {this->colMedications,
this->colDosage, this->colTimesPerDay, this->colReason, this->colAllergies});
this->lvwMedications->Full RowSelect = true;
this->lvwMedications->Grid Lines = true;
this->lvwMedications->Loca tion = System::Drawing::Point(28, 63);
this->lvwMedications->Name = L"lvwMedications";
this->lvwMedications->Size = System::Drawing::Size(425, 148);
this->lvwMedications->TabI ndex = 8;
this->lvwMedications->UseC ompatibleS tateImageB ehavior = false;
this->lvwMedications->View = System::Windows::Forms::Vi ew::Detail s;
//
// NewMeds
//
this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
this->AutoScaleMode = System::Windows::Forms::Au toScaleMod e::Font;
this->ClientSize = System::Drawing::Size(481, 293);
this->Controls->Add(this-> btnClose);
this->Controls->Add(this-> btnNewMedi cations);
this->Controls->Add(this-> lvwMedicat ions);
this->Controls->Add(this-> label1);
this->Name = L"NewMeds";
this->StartPosition = System::Windows::Forms::Fo rmStartPos ition::Cen terScreen;
this->Text = L"NewMeds";
this->ResumeLayout(false);
this->PerformLayout();
}
void ShowMedications(void)
{
SoapFormatter *medsSoap = new SoapFormatter();
String *strFilename = S"Medications.bcr";
if( File::Exists(strFilename) )
{
FileStream *medsStream = new FileStream(strFilename, FileMode::Open, FileAccess::Read, FileShare::Read);
ArrayList *lstMed = dynamic_cast<ArrayList *>(medsSoap->Deserialize(m edsStream) );
medsStream->Close();
Medications* Med;
lvwMedications->Items->Cle ar();
for(int i = 0; i < lstMeds->Count; i++)
{
Med = dynamic_cast<Medications *>(lstMed->Item[i]);
ListViewItem *lviMedications = new ListViewItem(Med->Meds);
lviMedications->Font = new Drawing::Font("Georgia", 8, FontStyle::Bold);
if( i % 2 == 0 )
{
lviMedications->BackColor = Color::Blue;
lviMedications->ForeColor = Color::White;
}
else
{
lviMedications->BackColor = Color::LightBlue;
lviMedications->ForeColor = Color::Blue;
}
lviMedications->SubItems-> Add(Med->M eds);
lviMedications->SubItems-> Add(Med->D osage);
lviMedications->SubItems-> Add(Med->T imes);
lvwMedications->Items->Add (lviMedica tions);
}
}
}
private: System::Void Medications_Load(System::O bject * sender, System::EventArgs * e)
{
lstMed = new ArrayList;
SoapFormatter *bcrSoap = new SoapFormatter();
String *strFilename = S"Medications.bcr";
if( File::Exists(strFilename) )
{
FileStream *medsStream = new FileStream(strFilename, FileMode::Open, FileAccess::Read, FileShare::Read);
lstMed = dynamic_cast<ArrayList *>(bcrSoap->Deserialize(bc rStream));
bcrStream->Close();
}
ShowEmployees();
}
#pragma endregion
private: System::Void btnNewMedications_Click(Sy stem::Obje ct^ sender, System::EventArgs^ e)
{
// NewMedications newForm;
//newForm.ShowDialog();
NewMedications *dlgMeds = new NewMedications;
if( dlgMeds->ShowDialog() == DialogResult::OK )
{
if( dlgMeds->txtMeds->Text->Eq uals(S"") )
{
MessageBox::Show(S"You must provide at least a Medication name to create a new Medication");
return;
}
else
{
String *strFilename = S"Medications.bcr";
Medications *Meds = new Medications;
Meds->Meds = dlgMeds->txtMeds->Text;
Meds->Dosage = dlgMeds->txtDosage->Text;
Meds->Times = dlgMeds->coboTimes->Text;
Meds->Reason = dlgMeds->txtReason->Text;
lstMed->Add(Meds);
FileStream *bcrStream = new FileStream(strFilename, FileMode::OpenOrCreate, FileAccess::Write, FileShare::Write);
SoapFormatter *bcrSoap = new SoapFormatter();
bcrSoap->Serialize(bcrStre am, lstMed);
bcrStream->Close();
ShowMedications();
}
}
}
private: System::Void btnClose_Click(System::Obj ect^ sender, System::EventArgs^ e)
{
Close();
}
};
}
Medications.cpp
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
compiler replacing '*' with '^' to continue parsing
.\Medications.cpp(6) : error C3921: Use of S-prefixed strings requires /clr:oldSyntax command line option
When compiling with /clr, an implicit conversion exists from string literal type to System::String^. If necessary to avoid ambiguity, cast to System::String^
.\Medications.cpp(7) : error C3921: Use of S-prefixed strings requires /clr:oldSyntax command line option
When compiling with /clr, an implicit conversion exists from string literal type to System::String^. If necessary to avoid ambiguity, cast to System::String^
.\Medications.cpp(8) : error C3921: Use of S-prefixed strings requires /clr:oldSyntax command line option
When compiling with /clr, an implicit conversion exists from string literal type to System::String^. If necessary to avoid ambiguity, cast to System::String^
.\Medications.cpp(9) : error C3921: Use of S-prefixed strings requires /clr:oldSyntax command line option
When compiling with /clr, an implicit conversion exists from string literal type to System::String^. If necessary to avoid ambiguity, cast to System::String^
.\Medications.cpp(11) : error C3699: '*' : cannot use this indirection on type 'System::String'
compiler replacing '*' with '^' to continue parsing
.\Medications.cpp(11) : error C3699: '*' : cannot use this indirection on type 'System::String'
compiler replacing '*' with '^' to continue parsing
.\Medications.cpp(11) : error C3699: '*' : cannot use this indirection on type 'System::String'
compiler replacing '*' with '^' to continue parsing
.\Medications.cpp(11) : error C3699: '*' : cannot use this indirection on type 'System::String'
compiler replacing '*' with '^' to continue parsing
.\Medications.cpp(19) : error C2084: function 'Medications::Medications(
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
NewMeds.cpp
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
When compiling with /clr, an implicit conversion exists from string literal type to System::String^. If necessary to avoid ambiguity, cast to System::String^
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
When compiling with /clr, an implicit conversion exists from string literal type to System::String^. If necessary to avoid ambiguity, cast to System::String^
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
When compiling with /clr, an implicit conversion exists from string literal type to System::String^. If necessary to avoid ambiguity, cast to System::String^
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
When compiling with /clr, an implicit conversion exists from string literal type to System::String^. If necessary to avoid ambiguity, cast to System::String^
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
When compiling with /clr, an implicit conversion exists from string literal type to System::String^. If necessary to avoid ambiguity, cast to System::String^
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
No user-defined-conversion operator available, or
Cannot convert an unmanaged type to a managed type
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
No user-defined-conversion operator available, or
Cannot convert an unmanaged type to a managed type
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
type is ''unknown-type''
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
No user-defined-conversion operator available, or
Cannot convert an unmanaged type to a managed type
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
No user-defined-conversion operator available, or
Cannot convert an unmanaged type to a managed type
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
No user-defined-conversion operator available, or
Cannot convert an unmanaged type to a managed type
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
No user-defined-conversion operator available, or
Cannot convert an unmanaged type to a managed type
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
type is ''unknown-type''
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
No user-defined-conversion operator available, or
Cannot convert an unmanaged type to a managed type
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
No user-defined-conversion operator available, or
Cannot convert an unmanaged type to a managed type
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
type is ''unknown-type''
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
No user-defined-conversion operator available, or
Cannot convert an unmanaged type to a managed type
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
No user-defined-conversion operator available, or
Cannot convert an unmanaged type to a managed type
mymeds.cpp
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
When compiling with /clr, an implicit conversion exists from string literal type to System::String^. If necessary to avoid ambiguity, cast to System::String^
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
When compiling with /clr, an implicit conversion exists from string literal type to System::String^. If necessary to avoid ambiguity, cast to System::String^
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
When compiling with /clr, an implicit conversion exists from string literal type to System::String^. If necessary to avoid ambiguity, cast to System::String^
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
When compiling with /clr, an implicit conversion exists from string literal type to System::String^. If necessary to avoid ambiguity, cast to System::String^
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
When compiling with /clr, an implicit conversion exists from string literal type to System::String^. If necessary to avoid ambiguity, cast to System::String^
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
No user-defined-conversion operator available, or
Cannot convert an unmanaged type to a managed type
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
No user-defined-conversion operator available, or
Cannot convert an unmanaged type to a managed type
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
type is ''unknown-type''
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
No user-defined-conversion operator available, or
Cannot convert an unmanaged type to a managed type
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
No user-defined-conversion operator available, or
Cannot convert an unmanaged type to a managed type
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
No user-defined-conversion operator available, or
Cannot convert an unmanaged type to a managed type
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
No user-defined-conversion operator available, or
Cannot convert an unmanaged type to a managed type
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
type is ''unknown-type''
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
No user-defined-conversion operator available, or
Cannot convert an unmanaged type to a managed type
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
No user-defined-conversion operator available, or
Cannot convert an unmanaged type to a managed type
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
type is ''unknown-type''
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
No user-defined-conversion operator available, or
Cannot convert an unmanaged type to a managed type
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
compiler replacing '*' with '^' to continue parsing
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
c:\documents and settings \my documents\visual studio 2005\projects\mymeds\mymed
No user-defined-conversion operator available, or
Cannot convert an unmanaged type to a managed type
Generating Code...
Here is my code:
//Medications.cpp
#include "StdAfx.h"
#include "Medications.h"
#using <mscorlib.dll>
Medications::Medications(v
{
Meds = S"Unknown";
Dosage = S"Unknown";
Times = S"Unknown";
Reason = S"Unknown";
}
Medications::Medications(S
{
Meds = meds;
Dosage = dosage;
Times = times;
Reason = reason;
}
Medications::Medications(v
{
}
//Medications.h
//#pragma once
//ref class Medications
//{
//public:
// Medications(void);
//};
#pragma once
using namespace System;
[Serializable]
public __gc class Medications
{
public:
String *Meds;
String *Dosage;
String *Times;
String *Reason;
public:
Medications(void);
Medications(String *meds, String *dosage,
String *times, String *reason);
~Medications(void);
};
//NewMeds.h
#pragma once
#using <System.Runtime.Serializat
#include "NewMedications.h"
#include "Medications.h"
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
using namespace System::IO;
using namespace System::Runtime::Serializa
namespace mymeds {
/// <summary>
/// Summary for NewMeds
///
/// WARNING: If you change the name of this class, you will need to change the
/// 'Resource File Name' property for the managed resource compiler tool
/// associated with all .resx files this class depends on. Otherwise,
/// the designers will not be able to interact properly with localized
/// resources associated with this form.
/// </summary>
public ref class NewMeds : public System::Windows::Forms::Fo
{
public:
NewMeds(void)
{
InitializeComponent();
//
//TODO: Add the constructor code here
//
}
protected:
/// <summary>
/// Clean up any resources being used.
/// </summary>
~NewMeds()
{
if (components)
{
delete components;
}
}
private: System::Windows::Forms::La
private: System::Windows::Forms::Bu
private: System::Windows::Forms::Bu
private: System::Windows::Forms::Co
private: System::Windows::Forms::Co
private: System::Windows::Forms::Co
private: System::Windows::Forms::Co
private: System::Windows::Forms::Co
private: System::Windows::Forms::Li
protected:
private:
/// <summary>
/// Required designer variable.
/// </summary>
System::ComponentModel::Co
ArrayList *lstMedications
#pragma region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
void InitializeComponent(void)
{
this->label1 = (gcnew System::Windows::Forms::La
this->btnNewMedications = (gcnew System::Windows::Forms::Bu
this->btnClose = (gcnew System::Windows::Forms::Bu
this->colMedications = (gcnew System::Windows::Forms::Co
this->colDosage = (gcnew System::Windows::Forms::Co
this->colTimesPerDay = (gcnew System::Windows::Forms::Co
this->colReason = (gcnew System::Windows::Forms::Co
this->colAllergies = (gcnew System::Windows::Forms::Co
this->lvwMedications = (gcnew System::Windows::Forms::Li
this->SuspendLayout();
//
// label1
//
this->label1->AutoSize = true;
this->label1->Font = (gcnew System::Drawing::Font(L"Mi
System::Drawing::GraphicsU
this->label1->ForeColor = System::Drawing::Color::Sl
this->label1->Location = System::Drawing::Point(106
this->label1->Name = L"label1";
this->label1->Size = System::Drawing::Size(273,
this->label1->TabIndex = 2;
this->label1->Text = L"My Medication Record";
//
// btnNewMedications
//
this->btnNewMedications->L
this->btnNewMedications->N
this->btnNewMedications->S
this->btnNewMedications->T
this->btnNewMedications->T
this->btnNewMedications->U
this->btnNewMedications->C
//
// btnClose
//
this->btnClose->DialogResu
this->btnClose->Location = System::Drawing::Point(343
this->btnClose->Name = L"btnClose";
this->btnClose->Size = System::Drawing::Size(75, 23);
this->btnClose->TabIndex = 10;
this->btnClose->Text = L"Close";
this->btnClose->UseVisualS
this->btnClose->Click += gcnew System::EventHandler(this,
//
// colMedications
//
this->colMedications->Disp
this->colMedications->Text
this->colMedications->Widt
//
// colDosage
//
this->colDosage->DisplayIn
this->colDosage->Text = L"Dosage";
this->colDosage->Width = 55;
//
// colTimesPerDay
//
this->colTimesPerDay->Disp
this->colTimesPerDay->Text
this->colTimesPerDay->Widt
//
// colReason
//
this->colReason->DisplayIn
this->colReason->Text = L"Reason";
this->colReason->Width = 362;
//
// colAllergies
//
this->colAllergies->Displa
this->colAllergies->Text = L"Allergies";
//
// lvwMedications
//
this->lvwMedications->Anch
| System::Windows::Forms::An
| System::Windows::Forms::An
this->lvwMedications->Colu
this->colDosage, this->colTimesPerDay, this->colReason, this->colAllergies});
this->lvwMedications->Full
this->lvwMedications->Grid
this->lvwMedications->Loca
this->lvwMedications->Name
this->lvwMedications->Size
this->lvwMedications->TabI
this->lvwMedications->UseC
this->lvwMedications->View
//
// NewMeds
//
this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
this->AutoScaleMode = System::Windows::Forms::Au
this->ClientSize = System::Drawing::Size(481,
this->Controls->Add(this->
this->Controls->Add(this->
this->Controls->Add(this->
this->Controls->Add(this->
this->Name = L"NewMeds";
this->StartPosition = System::Windows::Forms::Fo
this->Text = L"NewMeds";
this->ResumeLayout(false);
this->PerformLayout();
}
void ShowMedications(void)
{
SoapFormatter *medsSoap = new SoapFormatter();
String *strFilename = S"Medications.bcr";
if( File::Exists(strFilename) )
{
FileStream *medsStream = new FileStream(strFilename, FileMode::Open, FileAccess::Read, FileShare::Read);
ArrayList *lstMed = dynamic_cast<ArrayList *>(medsSoap->Deserialize(m
medsStream->Close();
Medications* Med;
lvwMedications->Items->Cle
for(int i = 0; i < lstMeds->Count; i++)
{
Med = dynamic_cast<Medications *>(lstMed->Item[i]);
ListViewItem *lviMedications = new ListViewItem(Med->Meds);
lviMedications->Font = new Drawing::Font("Georgia", 8, FontStyle::Bold);
if( i % 2 == 0 )
{
lviMedications->BackColor = Color::Blue;
lviMedications->ForeColor = Color::White;
}
else
{
lviMedications->BackColor = Color::LightBlue;
lviMedications->ForeColor = Color::Blue;
}
lviMedications->SubItems->
lviMedications->SubItems->
lviMedications->SubItems->
lvwMedications->Items->Add
}
}
}
private: System::Void Medications_Load(System::O
{
lstMed = new ArrayList;
SoapFormatter *bcrSoap = new SoapFormatter();
String *strFilename = S"Medications.bcr";
if( File::Exists(strFilename) )
{
FileStream *medsStream = new FileStream(strFilename, FileMode::Open, FileAccess::Read, FileShare::Read);
lstMed = dynamic_cast<ArrayList *>(bcrSoap->Deserialize(bc
bcrStream->Close();
}
ShowEmployees();
}
#pragma endregion
private: System::Void btnNewMedications_Click(Sy
{
// NewMedications newForm;
//newForm.ShowDialog();
NewMedications *dlgMeds = new NewMedications;
if( dlgMeds->ShowDialog() == DialogResult::OK )
{
if( dlgMeds->txtMeds->Text->Eq
{
MessageBox::Show(S"You must provide at least a Medication name to create a new Medication");
return;
}
else
{
String *strFilename = S"Medications.bcr";
Medications *Meds = new Medications;
Meds->Meds = dlgMeds->txtMeds->Text;
Meds->Dosage = dlgMeds->txtDosage->Text;
Meds->Times = dlgMeds->coboTimes->Text;
Meds->Reason = dlgMeds->txtReason->Text;
lstMed->Add(Meds);
FileStream *bcrStream = new FileStream(strFilename, FileMode::OpenOrCreate, FileAccess::Write, FileShare::Write);
SoapFormatter *bcrSoap = new SoapFormatter();
bcrSoap->Serialize(bcrStre
bcrStream->Close();
ShowMedications();
}
}
}
private: System::Void btnClose_Click(System::Obj
{
Close();
}
};
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.