unmanaged dll abstract class

  • Half-life2 Mod - cannot instantiate abstract class

    Hey, ive tried fixing this error by myself but im stuck :S. Any help needed :P1.------ Build started: Project: client_hl2mp, Configuration: Debug HL2MP Win32 ------2.Compiling...3.stdafx.cpp4.Compiling...5.c_weapon_gravitygun.cpp6.d:\modding\hl2\weapmod\src\cl_dll\hl2_hud\c_weapon_gravitygun.cpp(92) : error C2259: 'C_BeamQuadratic' : cannot instantiate abstract class7.due to following members:8.'const matrix3x4_t &CDefaultClientRenderable::RenderableToWorldTransform(void)' : is abstract9.d:\modding\hl2\weapmod\src\public\iclientrenderable.h(176) : see declaration of 'CDefaultClientRenderab

  • Error-handling in multi-threaded abstract class - how?

    I have a multi-threaded abstract class.How can I handle errors in this class?In the constructor, my only choice is to throw an exception.In the thread-proc (static member function which receives 'this' as a parameter), the only option I can think of is to call a pure virtual OnError() function. Since this function is called by Windows (probably Kernel32.dll and its friends), throwing an exception at this point would result in a crash, or worse.What should I do? I don't want the class to have multiple ways of handling errors... Especially with standard member functions, which can use both metho

  • Template Abstract Class

    I have a template abstract class with derived classes. The pure virtual functions have been declared in the header file and the body of the functions are defined in the source file. Now all this wrapped in to a dll. However for linking with the executable I employ default implicit linking using the header only and of course the library.Problem is that while buiding the executable the compiler complains of error C2259 : class' : cannot instantiate abstract class due to following members:So to get rid of the error I define each of the pure virtual function with a dummy body in the header. Howeve

  • calls to unmanaged dll to create a socket result in debug assertion

    I have an unmanaged C++ dll which is an MFC shared DLL that has functions in it to initialize sockets and do other ethernet related things. I have built a managed C++ wrapper project which is also an MFC shared DLL, compiled with /clr that calls functions in the unmanaged dll. Then I have a C# project which instantiates a member of the wrapper class to access the unmanaged functions. One of the functions in the unmanaged dll creates a new CAsyncSocket, checks to see if AfxSocketInit is successful, and if so, calls Create to create a new socket. When I call this function through my wrapper from

  • VB Abstract Class

    I'm trying to figure out how to implement an abstract class in VB6. Sounds simple enough, right ? Well wrong, cause I'm having lots of troubles. Any help would be greatly appreciated.Here's what I have :'-------------------------------------------(Project1 : class "Interface") <-- This is an ActiveX DLL projectPublic Function Load()End Function'-------------------------------------------(Project 2 : class "Implementation1") <-- this is also an ActiveX DLL Project. "Implementation1" has a reference to Project1Implements AbstractClass.InterfacePrivate

  • pass parameter to unmanaged DLL

    I have a C++ unmanaged DLL mydll. It has a exported function myfunc(float** buffer, int size). The buffer will store the returned result.I tried wrapper it into C# dll so I write a wrapper class for it. The function runmyfun will call the function myfun() in unmanaged dll mydll and return the resultpublic class CDllWrapper{[DllImport("mydll.Dll")] private unsafe static extern void myfun(float** buffer, int size);public unsafe void runmyfun(out float[] arr){arr = new float[size];fixed(float * buffer = &arr[0]){myfun(&buffer, size);}}}This code has error. First we can not write

  • passing parameters to unmanaged DLL in C#

    I have a C++ unmanaged DLL mydll. It has a exported function myfunc(float** buffer)I tried to used it in C# so I write a wrapper class for it.public class CDllWrapper{

  • Problem with using unmanaged DLL in C# app

    HiI'm having trouble finding exactly how to import and use a unmanaged DLL in my C# app.The DLL I'm trying to use is this one:http://www.barcode-manufacturer.com/magnetic_card/portable_magstripe/mse630tdll.htmlC# code I'm using:private void button1_Click(object sender, EventArgs e){IntPtr status = Class1.Init_com("8,9600,O,7,1");}unsafe class Class1{[DllImport("cardreader.dll")]public static extern IntPtr Init_com(string parameter);}The code works as such, and returns a status when called.The prolem is it seems it's not reading the sent string correctly.When sending port 2

  • Call Unmanaged DLL with Japanese strings

    My machine's system locale and user locale are both English (en-US).I have created a form using C# which simply captures the data entered in an edit box and calls an unmanaged C++ DLL.public partial class Form1 : Form{[DllImport("TestDll.dll")]public static extern int WriteMyFile(ref MyGlob argGlob);[StructLayout(LayoutKind.Sequential)]public struct MyGlob{[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)]public string hci_str;};public Form1(){InitializeComponent();}private void textBox1_TextChanged(object sender, EventArgs e){}private void button1_Click(object sender, EventArgs e

  • Is list<abstract class> possible?

    I need a list whose nodes are objects of either of the different derived classes of a abstract class "a". But writing list<a> yields an compiling error. Is it because you can't instantiate the list template with a abstract class? Does it mean I have to write the a class of list myself without the facility of the C++ library?

  • Abstract class fundamentals

    I understand we can't create objects of abstract class but how is the function "void prs( subt& i )" working. "subt& i" is passing by reference. But still we are passing by reference of an object of "subt" type which is an abstract class.Here is the code:#include <iostream>#include <string>using namespace std;class subt {public:virtual char * getd() = 0;};class sk:public subt {public:char * getd() {return ( "in 1!" );}};class ot:public subt {public:char * getd() {return ( "in 2!" );}};void prs( subt& i ) {printf( "%

  • cannot instantiate abstract class

    I have created a plugin for Outlook, I want add ribbon controls to my existing OUtlook plugin.When I Implement "IRibbonExtensibility" Interface in the class that was implemented "_IDTExtensibility2" Interface it throws up the following error messageI ve created my plugin in C++,STDMETHOD(GetCustomUI)(BSTR RibbonID, BSTR * RibbonXml)This API will return XML content of the ribbon control in "RibbonXml" parameter so the return value is not a string.My sample works fine but when i implement this "IRibbonExtensibility" interface in my existing Outlook plugin

  • cannot instantiate abstract class ... how to work around this error?

    This is my abstract class:#ifndef ENTITE_H#define ENTITE_H#include <string>using namespace std;class Entite {public:Entite() {}~Entite() {}virtual void initialiser() = 0;virtual string getNom() const = 0;virtual int getVie() = 0;virtual string getEtat() = 0;virtual string choisirAction(Entite* e) = 0;virtual void attaquer() = 0;virtual void esquiver() = 0;virtual void neRienFaire() = 0;};#endifNow I get the error "cannot instantiate abstract class" every time I try declaring:Entite* e1_;How do I work around this?

  • create a std::vector from an abstract class

    hi, i manage some dynamic arrays of an abstract class like this:// ID3DXMesh is DirectX abstract structID3DXMesh** meshArray = new ID3DXMesh*[nbActors];//and then i only use it like this:meshArray[i] = something.now... how can i manage it with a std::vector?i init the vector like this:std::vector<ID3DXMesh*> meshVector;but when i do the push_back() i get errors...how do i solve the problem?

  • __interface vs Abstract Class?

    I haven't used it, but looking for "Plugin Architecture" basics I have run across the keyword "__interface". I know c# and java make use of this, not sure why....Here is my questions:What is the purpose of __interface when there is such a thing as Abstract Class? By definition, AFAIK, both are used simply to outline a description/protocol that must be implemented by derived classes.Any differences between the two, and why would I use __interfaces instead of an Abstract Class?Mike B

  • Problems with an abstract class in mvs2005

    I don't know if this problem has to do with Microsoft Visual Studio, I guess not... probably a mistake of mine. And I have no idea why I'm getting these errors. If someone could help me out, I'd be very thankful.I'm trying to build my own small library with math functions and variables so my idea was to make a base class for all the variables and then derive them from this one, making complex numbers, matrixes, etc...So I wrote a basic structure for this base abstract class and then tried compiling just to see if there were any errors, and I got the following:1>Compiling...1>Main.cpp1

  • ATL -- error:C2259 'ATL::CComObject' : cannot instantiate abstract class

    i have created one ATL project and add one simple Atl class then, just add one class in list of inherianced classes in new simple atl class like belowclass ATL_NO_VTABLE CSlider :public CComObjectRootEx<CComSingleThreadModel>,public CComCoClass<CSlider, &CLSID_Slider>,public IObjectWithSiteImpl<CSlider>,public IDispatchImpl<ISlider, &IID_ISlider, &LIBID_TabSlingLib, /*wMajor =*/ 1, /*wMinor =*/ 0>,/* newly added class that create error*/public CWindowImpl<CSlider>Then a got the error message likeerror C2259: 'ATL::CComObject<Base>' : cannot insta

  • "error C2259: cannot instantiate abstract class"

    My query is regarding the error C2259"error C2259: cannot instantiate abstract class"I am using Visual studio 2005 and doing some sort of porting work across different versions of source codes. I am getting this error in one of my source files but the problem is that the base class is a huge one with lots of pure virtual functions with complex signatures also and just by comparing the derived class and the base class I am still struggling to resolve the issue.Can this error C2259 be more descriptive as to which functions does compiler thinks that I am not implementing or conflict wit

  • XSD question with abstract class/derived

    XSD seems to have a limitation when trying to create an abstract class and a derived class. It seems to want the elements in both to be enclosed in <sequence> and not in <all>.For instance, the XSD at the bottom of this post is correctly parsed.But, if i change those <sequence> elements to <all>, there is a parsing error. As far as i know, the only difference should be whether the elements within the classes are required to be in sequence or not (our server does not require that they be in sequence). But, my XSD parser objects to <all> being within an Extension.So

  • error C2259: 'Application' : cannot instantiate abstract class

    all i am definining a class for my application in a header file as defined below and when i try to create an instance in the main.cpp file i get the error error C2259: 'Application' : cannot instantiate abstract classThe class declaration is #ifndef APPLICATION#define APPLICATION#include "dtCore/dt.h"#include <map>#include <osgSim/DOFTransform>#include "netSocket.h"#include "ul.h"class Application : public dtCore::Base, public dtCore::KeyboardListener{DECLARE_MANAGEMENT_LAYER(Application)public:Application(std::string name = "Application");vi

  • cannot instantiate an object based on an abstract class

    - I am new here and I am taking a beginning C++ course and I am stuck. Any help will be great.I am stuck on figuring out how I need to instantiate the object from the derived class (wholesale).Problem:Explain why the followng code causes a compile error:class Inventory{public:virtual void setVolumeDiscount( ) = 0;protected:double dDiscount;};class Wholesale : public Inventory {public:void set VolumeDiscount( );};void main( ) {Inventory westernDistributor;westernDistributor.setVolumeDiscount( );}This is what I have come up with:class Inventory {public:virtual void setVolumeDiscount() = 0;protec

  • Advantage of An Interface over an Abstract class

    What is the main advantage of Interface over an Abstract class? Since in an interface the methods are only defined, there is no implementation, then howcome someone is able to accompalish resuablity?What is there in an Inteface which cannot be accompalished in an abstract class??

  • Derived class from abstract class(COleControl in MFC) gave error while allocation mem

    Created a class i.e. CFlipCustomViewer derived from COleConrol class(abstact class)and overridden the "virtual void OnDraw(CDC* pdc, const CRect& rcBounds, const CRect& rcInvalid)" method of COleControl class in the void CFlipCustomViewer::OnDraw(CDC* pdc, const CRect& rcBounds, const CRect& rcInvalid).I tried to call this in OnInitDialog() method of my dialog class of the application.Here the code snippets..BOOL CFlip::OnInitDialog() {//having a CStatic as a place holder and then //create the flip custom control in InitDialogCOleControl* ptrOleControl; //abstract bas

  • When would you use an abstract class and when an interface?

    When would you use an abstract class and when an interface?what are advantages of using abstract class and interface?

  • abstract class

    I am new to C++, below is a class downloaded from MS. But I want to change it as to access UNICODE data with stream, so I changed void* variable to BYTE *. When I compile it, I got an errord:\src\personal\XMLSQL1.0\OLEDBApp.cpp(2446): error C2259: 'CSeqStream' : cannot instantiate abstract classmy questions : is it a abstract class? if yes which function is a pure virtual?Note It worked before I changed void* type.Thank you very much.class CSeqStream : public ISequentialStream{public://ConstructorsCSeqStream();virtual ~CSeqStream();virtual BOOL Seek(ULONG iPos);virtual BOOL Clear();virtual BOO

  • What is the difference between abstract class and interface

    What is the difference between abstract class and interface?

  • DLL: exporting class methods

    I'm building my first DLL and having problem with exporting class methods.The following builds a dll with no errors, but then i get a unresolved external symbol when linking to the dll.dll header:class CTest{public:__declspec(dllexport) void __cdecl Ciao();};dll implementation:__declspec(dllexport) void __cdecl CTest::Ciao(){AfxMessageBox("Ciao");}dll def file:EXPORTSCiao @1test program that uses dll:__declspec(dllimport) void Ciao(void);...Ciao();If i do the same thing with a global function instead of a method, it works.

  • problem instantiating a subclass of abstract class

    Hi, I have an abstract class like this:class Descriptor{public:virtual ULONG dispatch(char*, size_t, Stream) = 0;};and I have a subclass like this:class ConsoleShell : public Descriptor{public:ULONG dispatch(char*, size_t, Stream*);};#include "services/console/Console.cpp"and in Console.cpp:ULONG ConsoleShell::dispatch(char *cmd, size_t len, Stream *s){return (ACE_OS::strcmp(cmd, "quit") == 0) ? s->close() : s->printf(cmd);}So I would think I'm all set to instantiate ConsoleShell, but I gcc gives me this:/export/home/levk/r6/services/console/Console.cpp: In member fun

  • problem with an abstract class

    Hi! I was writing a calculator to practice my programming skills and I really cannot solve a problem with an abstract class //base class for all tokenspublic abstract class BaseToken{public override string ToString() {return tokenValue;}}//base class for all operatorspublic abstract class Operators:BaseToken {protected char tokenValue;}//numberspublic class number : BaseToken {protected int tokenValue;public number(int val) {tokenValue = val;}}problem here is that I implement "tokenValue" varaible in sub-classes of baseToken class but I want to use it in base class but it gives me er

  • abstract class

    in abstract class the methods may or may not be implemented, when we implement the methods in the abstract class, then why cant we instantiate objects in for the abstract class. is it mandatory that the objects are not instantiated in abstract class. can anyone tell me the internal working of the abstract class.

  • Title : Declaring abstract class function Prototype or Signature

    I have two classes 1. Employee2. Projectboth classes have a create function create function of Employee class creates a new Employee it takes object of Employee class as input parameter and return boolcreate function of Project class creates a new Projectit takes object of Project class as input parameter and return boolNow I want to create a abstract class which will contain a create functionSo I can inherit that abstract class into my both above classesWhat should be the prototype or signature for that create function of abstract classWhich should be able to take any type of class object? An

  • Instantiate abstract class

    I have a class, CCollection, which holds a number of CConnection objects. CCollection and CConnection are interfaces for a COM object.I want to use pointers, but when I want to create a new object, I receive this error:error C2259: 'CConnection' : cannot instantiate abstract class due to following members:warning C4259: 'long __stdcall CConnection::QueryInterface(const struct _GUID &,void ** )' : pure virtual function was not definedIt happens with this code:CConnection * pTemp = new CConnection(parameters);I looked up in the help what this error means, but it still isn't clear to me. If I

  • calling method in Abstract class

    hi,can anyone help me regard, code Abstract class public abstract class Rectangle extends another class {private Line line;private static class Cone {line.doLine ();}}Line class public class Line extends another class {public doLine(){....}}I need to call doLine() method in Rectangle abstract class, so I've created a object of Line and called.anything wrong in this...kindly helpThnx,carol

  • abstract class constructor

    My instructor said that a abstract class can have a constructor but she does not explain it so well. Why can it have a constructor when one can make no new instance? What is the usage of such a method being?

  • An abstract class as a bean - problems

    I am trying to get an app. to run on Websphere 5.1. In at least 1 place, a bean is created, set to the session, and passed into a jsp. However the class used is an abstract class (more accurately, the class used is a concrete class, but the declaration on the jsp page is for the abstact parent class, since any of 5 child classes could be in that bean, polymorphism in action).On Tomcat, this is certainly not an issue, the object exists, and just because we declare the bean as an abstract class, it works fine. On WSAD 5.1, I get an error stating the class is abstract, and cannot be instantiated.

  • stuck with abstract class, function overriding

    i am writing a program on 2-D transformation which handles transformations for three objects, namely, point, line and a triangle.i have created a base class Object and derived three classes - Point, Line, Triangle - from it.Here i will discuss just the Object and Point class.The code snippet for that is as under :// base class Objectclass Object{public :virtual void translate() = 0;// virtual void rotate() = 0;// virtual void scale() = 0;// virtual void reflect() = 0;// virtual void shear() = 0;virtual void draw(void) const = 0;virtual void setCoords() = 0;};// Point classclass Point : public

  • error C2259: 'ClassName' : cannot instantiate abstract class

    HII have a class className which is an abstract class. I am attaching the definition in the code snipet below.when I am writing the line I am getting an errorerror C2259: 'className' : cannot instantiate abstract classFrom this error I have understood that we cannot create an instance of an abstract class But when I make the object of the class i.e.className obj.and try to access the public function initState().I am getting an error"object reference is not set"How to resolve this problemclass ClassName : public Class2, public Class3{ virtual ~ClassName{} public:virtual void initState

  • Java subclass won't work with partial abstract class

    I am not that good in java and as a homework we had to write to classes: a partial abstract class Koerper and it's subclass Kugel but when I try to compile them the compiler always tells me this:Quote ... Kugel.java:9: Kugel is not abstract and does not override abstract method compareTo(java.lang.Object) in java.lang.Comparablepublic class Kugel extends Koerper I hope someone can help I'm just not able to figure it out... maybe it's nothing big, but i don't get it The code of both classes is as follows:abstract class Koerper implements Comparable {public double volumen;public double oberflaec

  • abstract class questions

    hi, i just have many questions regarding abstract class, please briefly explain if you may. thanks. 1. what is the difference between declaring public abstract class and abstract class ? 2. should abstract class have a constructor? i know by default it has one, but since abstract class doesn't have an object and its constructor cannot be instantiated, then why we need a constructor? 3. does abstract class normally have public methods? 4.does abstract class have concrete functions as well? and why would we have full function in an abstract class? lastly, what is wrong with my Customer construct

  • 3 C++ questions - destructors, derived class, abstract class

    I've got these 3 questions, I didn't work so far in C++, and this is preparation for my C++ class, These questions are a little tricky and unknown to me, I tried to find the answers in Wikipedia, but I didn't manage, if anyone can answer me, please.1.1 Can a destructor, defined in a base class, be inherited by a derived class?1.2 Can a base class destructor be overridden in a derived class?1.3 Does an abstract class need a contructor?Thank you very much, I would appreciate all help, and if someone has links with examples where I can see how it works.

  • Notation: Abstract Class in RSA 7.5.4

    does someone know if its possible to change the UML notation style of an abstract class in rsa 7.5.4?the default notation looks like:-------------- | Class | -------------- I would like to use this notation:--------------- | Class | | {abstract} | --------------- note: Class name is cursive in both notations.But cursiv only is not so good visible in presentations...

  • Interface for abstract class

    I am a little confused about interfaces.Can an abstract class inherit an interface, so that interface can be used in conjunction of a class derived from the adstract?eg A is an interface, B is an abstarcat class, C & D inherit from B but have different proerties.Can A still be utilised to interface with C and D, if so how will the one method in the interface be passed down through the adstract class and will the derived classes have to overide the method?

  • CPropertyPage abstract class

    I am trying to create a CPropertyPage abstract class (ie. a CPropertyPage base class with a pure virtual function) but when doing so I always get the following compile errors for each derived class...- PPApplication.cpp(19) : error C2259: 'CPPApplication' : cannot instantiate abstract class due to following members:- PPApplication.h(15) : see declaration of 'CPPApplication'- warning C4259: 'int __thiscall CPPApplication::isSvrProjAccessPCOK(void)' : pure virtual function was not definedsee declaration of 'isSvrProjAccessPCOK'No where is an object of the base class created and interestingly, th

  • Abstract Class question

    What I have is this:public abstract class Ability {public class Action extends Ability{}public class Reaction extends Ability{}public class Support extends Ability{}}I have it like that so I don't have all of the Ability-extended classes in their own .java file (to save room and to keep tidy while coding). And so i can access each class by only importing blah.blah.Ability, then making a new Action Ability like so:Ability.Action Jump = new Ability.Action();My question is, does doing it this way lead to any adverse side effects? such as memory leaks, or something of similar unwanted nature.

  • Using C++ abstract class setters?

    I am trying to implement some getters and setters in an abstract class that I am calling from the derived class draw functions but I can't get the thing to compile and I don't know why. Shape is the abstract base class. I am getting the compiler error that says " passing `const Circle' as `this' argument of `void Shape:etSize(float, float, float)' discards qualifiers" Below is the code I have for one of the setters and the way I am calling it from the draw functions. protected: float Sizex, Sizey, Sizez; //the member variables for this setter void SetSize(float sx,float sy,float sz);

  • Abstract Class is declared but not defined

    I have class eventqueue_t which is derived from the abstract class event_storage_t. When I compile the code I get:makempixlcxx -c -O3 brain.cppmpixlcxx -c -O3 config.cppmpixlcxx -c -O3 connection.cpp"eventqueue.h", line 17.29: 1540-0408 (S) The base class "event_storage_t" is declared but not defined.make: *** [connection.o] Error 1The connection_t class has a event_storage_t pointer. I am surprised see the compiler is referencing "eventqueue.h" when compiling connection.cpp even though eventqueue_t is derived from event_storage_t.Below you will find (hopefully) a

  • Java SQL problem in abstract class

    I have an abstract class called student with an abstract method add().I also have other classes undergraduate, graduate, parttime that extends student. Requirements are that I have to have an abstract class student and the same abstract method add(). This method needs to write to mySQL DB elements entered (fistname, lastname etc...). In my add() method under subclass undergraduate I can easily see the values from the textfield (System.out.println(this.firstname));My question is: how can I easily implement something like sql.execute(this.firstname, this.lastname...); the same as println(this.fi

  • Interface and Abstract Class

    when to use Interface and when to use abstract class?please suggest

  • Changing abstract class to interface, causes problems with inherited classes?

    I'm having a problem changing an abstract class to an interface. I changed the abstract class (Bounceable) to an interface but I'm not sure what I need to do with the concrete classes (Tennisball, Basketball) that implement the interface. The change to an interface is also affecting the output test program (PolyTest).Bounceable.java/*** This abstract class implements an interface.*/public interface Bounceable{/*** This method is the bounce method and returns the bounce string.* @return Returns the bounce string.*/public abstract String bounce();}Tennisball.java/*** This concrete class that imp

  • Problem creating base abstract class

    I'm having a problem figuring out what goes in the SecurityAlarm class. It is an abstract base class with 3 methods: alarmFailure() (cannot be overridden by any subclass), and alarmSensor(), alarm() (both are abstract. EntryAlarm is a class that inherits from SecurityAlarm. If the simulation of an alarm exceeds the constant value (the threshold), the entry alarm is triggered. Security Alarm:public abstract class SecurityAlarm{/*** Constant values*/public static final int ALARM_NORMAL = 0;public static final int ALARM_ACTIVATED = 1;public static final int ALARM_FAILURE = 2;/*** This method cann