Error!!
-
Hai friends When i create one sample project... class EDCService :public IFileIO Service - oneclass IFileIO -interface class then, i create instance of the class EDCService::IFileIO fio; finallay i compiled...showing below error..please suggest me!! error C3153: you cannot create an instance of an interface
*****THANKS N ADVANCE**** Mathen.K (I WILL TRY MY LEVEL BEST )
-
Hai friends When i create one sample project... class EDCService :public IFileIO Service - oneclass IFileIO -interface class then, i create instance of the class EDCService::IFileIO fio; finallay i compiled...showing below error..please suggest me!! error C3153: you cannot create an instance of an interface
*****THANKS N ADVANCE**** Mathen.K (I WILL TRY MY LEVEL BEST )
Suggest what?
-
Suggest what?
-
Hai friends When i create one sample project... class EDCService :public IFileIO Service - oneclass IFileIO -interface class then, i create instance of the class EDCService::IFileIO fio; finallay i compiled...showing below error..please suggest me!! error C3153: you cannot create an instance of an interface
*****THANKS N ADVANCE**** Mathen.K (I WILL TRY MY LEVEL BEST )
You are creating object of the Interface
IFileIO
rowdy_vc++ wrote:
EDCService::IFileIO fio;
Do this:
EDCService fio;
Is this you want??Manish Patel. B.E. - Information Technology.
-
It took me 10 seconds to find this: http://msdn2.microsoft.com/en-us/library/7d4ezh73(VS.80).aspx[^] Why don't you try to figure things out for yourself before spamming this board?
-
You are creating object of the Interface
IFileIO
rowdy_vc++ wrote:
EDCService::IFileIO fio;
Do this:
EDCService fio;
Is this you want??Manish Patel. B.E. - Information Technology.
-
It took me 10 seconds to find this: http://msdn2.microsoft.com/en-us/library/7d4ezh73(VS.80).aspx[^] Why don't you try to figure things out for yourself before spamming this board?
hi michel thanks 2 your replay...Already i try this logic ..wen i add that dll..via (#using "mscorlib.dll").. showing this error: fatal error C1190: managed targeted code requires a '/clr' option
*****THANKS N ADVANCE**** Mathen.K (I WILL TRY MY LEVEL BEST )
-
yes i try ...but showing this error error C2259: 'EDCService' : cannot instantiate abstract class
*****THANKS N ADVANCE**** Mathen.K (I WILL TRY MY LEVEL BEST )
Do you realy need for IFileIO interface? If you don't need it then remove it. What declarations you made inside it?
Manish Patel. B.E. - Information Technology.
-
yes i try ...but showing this error error C2259: 'EDCService' : cannot instantiate abstract class
*****THANKS N ADVANCE**** Mathen.K (I WILL TRY MY LEVEL BEST )
I tried this:: IFileIO.h
#pragma once interface IFileIO { void setData(int xi); };
EDCService.h #pragma once #include "IFileIO.h"class EDCService:public IFileIO { public: EDCService(){}; int x; void setData(int xi) { x = xi; } };
Its works fine for me. I can create instance like thisEDCService serviceObj;
Try it and let me know how it worksManish Patel. B.E. - Information Technology.