Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
0

0v3rloader

@0v3rloader
About
Posts
129
Topics
60
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Inheritance II
    0 0v3rloader

    Hello, I have been getting these annoying error and warning messages from the compiler that I really don't understand. Consider the following code example:

    class objA
    {
    public:
    objA(){};
    ~objA(){};

    public:
    virtual bool Setup(int){};
    bool Setup(float){};
    };

    class objB : public objA
    {
    public:
    objB(){};
    ~objB(){};

    public:
    virtual bool Setup(int){};
    };

    class C
    {
    public:
    C(){};
    ~C(){};

    public:
    bool doTest()
    {
    objB b;

    	b.Setup(100);	
    	b.Setup(0.0001); // warning C4244: 'argument' : 
    			 // conversion from 'const double' to 'int', possible loss of data
    };
    

    };

    So here we get a warning message from the compiler as it doesn't know what function to use -- it is as if it doesn't recognise the base-class' method. I know that somehow this has to do with the virtual keyword in use, but I really don't know why this is happening. Now consider yet another code example:

    class _objA
    {
    public:
    _objA(){};
    ~_objA(){};

    public:
    bool Setup(int){};
    bool Setup(float){};
    };

    class _objB : public _objA
    {
    public:
    _objB(){};
    ~_objB(){};
    };

    class _C
    {
    public:
    _C(){};
    ~_C(){};

    public:
    bool doTest()
    {
    _objB _b;

    	\_b.Setup(100);	
    	\_b.Setup(0.0001);	// no warnings whatsoever! the compiler correctly casts!
    };
    

    };

    Here we have a class being derived from another one but without any virtual methods -- no errors/warnings! Can someone please explain me what are the compiler/C++/ANSI rules I am missing here? Thank you very much, David

    C / C++ / MFC c++ oop help tutorial question

  • Inheritance
    0 0v3rloader

    Hello, I have been having this compiling issue today and I don't really know what I am doing wrong. Nothing better than an example to make myself understood thus consider the following example:

    class objA
    {
    public:
    objA(){};
    ~objA(){};

    public:
    virtual bool Setup(int){};
    bool Setup(float){};
    };

    class objB : public objA
    {
    public:
    objB(){};
    ~objB(){};

    public:
    virtual bool Setup(int){};
    };

    class C
    {
    public:
    C(){};
    ~C(){};

    public:
    bool doTest()
    {
    objB b;

    	b.Setup(100);	
    	b.Setup(0.0001); // warning C4244: 'argument' : 
    			 // conversion from 'const double' to 'int', possible loss of data
    };
    

    };

    Why am I getting this warning? I mean, shouldn't the compiler automatically use the float-version method, or are there any rules I am aware of? Any insights as to why this is happening will be greatly appreciated. Thanks, David

    C / C++ / MFC oop help tutorial question announcement

  • Precision and Scale ?
    0 0v3rloader

    Hello, I have been trying to develop an automatic way of programmatically accessing datasources and performing some predefined(-supported) processing on them. The question I would like to ask you people has to do with numeric fields. What exactly is precision? Is it the maximum length in digits of a field, or is there more to it? What about a "field's scale", what is it and how does it affect a field's value handling? Thank you very much, Dave

    Database question

  • Custom build
    0 0v3rloader

    Great! That's exactly what I was looking for! Thank you very much for replying. David

    C / C++ / MFC c++ tutorial question announcement

  • Custom build
    0 0v3rloader

    Hello, I have a Lib which has some objects which are compiled depending on whether certain macros are defined or not. I was wondering if it is possible to have multiple builds of the Lib for the different scenarios and have Visual C++ automatically choose between the correct version of the Lib to use? Example:

    In the Lib:
    #ifdef _MACROA
    class A
    {
    .
    :
    .
    };
    #endif // defined(_MACROA)

    This means that we have two possible versions of the Lib: one for when _MACROA is defined and another for when it's not. So the question is how to configure the project settings in the (implementation) App - if such a thing is possible at all - to make it choose the correct version of the Lib depending on whether the macro is defined or not. Perhaps I should adopt a different strategy? All insights on the question in hand will be greatly appreciated. David

    C / C++ / MFC c++ tutorial question announcement

  • Knowing resource ID
    0 0v3rloader

    Hello, Given a CDocument object, how does one do about knowing the ID of the resource (the IDR__resource_) which was associated to the document template? Thanks, David

    C / C++ / MFC question learning

  • OnFileNew
    0 0v3rloader

    Hello, Whenever the application's InitInstance is executed, what is the best way of preventing the OnFileNew method from being called without removing the command line parser? Is this possible to do without recurring to the use of flag variables?

    C / C++ / MFC question

  • Frame Windows -- best strategy
    0 0v3rloader

    Hello, I am doing a project at the moment which basically should allow creation of frame windows - and their associated views with specific purposes - automatically. My problem is I don't really know what the best strategy to employ is. I mean, I can't use an MDI architecture as the frame windows have to be created independently - separately from each other - and if I use the SDI_nterface_ I am limited to one frame window only. How do I do about this with MFC? Thank you very much, David

    C / C++ / MFC question c++ architecture help

  • Linking with inline methods
    0 0v3rloader

    Yes, that is true. I have defined it in the class declaration - in the header file - and I've coded the method(s) in the actual source file (.cpp) . I take it you mean I can't insert the code in the source file but only in the header? David BTW, thanks for the reply

    C / C++ / MFC help question debugging tutorial

  • Linking with inline methods
    0 0v3rloader

    Hello, I was wondering if any of you CPers know how to solve this problem i've come across with. I've defined about four or so methods in this class of mine as inline and, it appears, the linker cannot find the method's definitions in the .OBJ. The only way of solving this issue is by NOT defining the method(s) as inline. How do I do about solving this, while at the same time keeping inline declaration? Thanks a lot David Linker Error:

    Linking...
    LINK : LNK6004: Debug/xtest.exe not found or not built by the last incremental link; performing full link
    xtestDlg.obj : error LNK2001: unresolved external symbol "public: char const & __thiscall XField::GetText(void)" (?GetText@XField@@QAEABDXZ)
    Debug/xtest.exe : fatal error LNK1120: 1 unresolved externals

    C / C++ / MFC help question debugging tutorial

  • ODBC, ADO or OLEDB ?
    0 0v3rloader

    Hi and thanks for replying. It is interesting to know you are (also) an adept of the ODBC_API... but looking at both the ODBC_API and OLEDB what would you say about performance issues such as: - memory usage; - processing speed (in the general sense); And what about the future? I mean, do you think ODBC will still be supported in the future or will it be made deprecated by Microsoft? #David

    C / C++ / MFC question database json performance help

  • ODBC, ADO or OLEDB ?
    0 0v3rloader

    Hi there, I have recently finished a collection of classes which provide support for database processing. The only problem though is the classes use the (old-deprecated) ODBC API. Some time ago I was told ADO data source connectivity is a much better approach because of its ease of use, speed and so forth. This made me think about updating (or actually rewritting) the entire collection so that it can support the latest in what regards to datasource connectivity. But I have been doing some reading and would like to ask you some questions: - doesn't ADO use OLEDB? And if so, should I not be thinking about supporting OLEDB rather than ADO as it would create an additional layer between the ODBC driver and the App? - in what concerns compatibility and speed, what is, in your own opinion, the platform I should be aiming for? Thank you very much, David

    C / C++ / MFC question database json performance help

  • Class templates
    0 0v3rloader

    cmk wrote: In a source file add : template class __declspec(dllexport) CXList; // required That's precisely what I mean. cmk wrote: By class template i assume you mean CXList is defined like : template class CXList { ... }; Ahh! The magic code to make it work! I thought the compiler did this automatically. Can you provide me with an explanation as to why you have to do it like so? Thanks a lot, cmk. You have been very helpful indeed! David Nimrod

    C / C++ / MFC help asp-net database wpf question

  • Class templates
    0 0v3rloader

    Hello, I am having trouble in compiling this project of mine. I will try to make myself clear so please bear with me for awhile... :) The scenario The workspace consists of 4 projects, 3 of them generating static libraries: - core.lib; - controls.lib ==> dependant on core.lib; - db.lib ==> also dependant on core.lib; The fourth project is the application which uses classes/objects from the 3 libraries I've just described. The problem I have just added a new class (CXList) to core.lib. This class allows the processing of a complex linked-list with variable data types - it is therefore a class template. Before including it in core.lib I tested it in a separate project and it performed just fine. But, when I included it in the master workspace described above and after having updated the whole project, I couldn't believe my eyes when I hit the Build button! I got loads of linking errors telling me that all (yes all) of the CXList objects (and methods) were not found in any of the libs (you know, the external object not found in db.lib kind of error). Is this some kind of a class template issue that I am not aware of? If you think you can shed some light on what I'm experiencing here, please do let me know. Thank you for your time, David Nimrod

    C / C++ / MFC help asp-net database wpf question

  • Dialog window class name?
    0 0v3rloader

    Hello, Can someone tell me what the class name of a dialog box is? The problem is I need to find a specific window and the only two things I know are: - it is a dialog box (modeless); - and its window title (static-never-changing string); Also, if you think there is a better (more correct) way of doing this, please do let me know! Thank you, Dave

    C / C++ / MFC help question

  • Communication between processes
    0 0v3rloader

    Hi Blake and thanks for the input. Looking back at you posted, I think I will have to go for the COM solution as I think it is the best one. Can I ask you one thing though? Do you know of any site(s) with the right technical content I could learn from?

    C / C++ / MFC question tutorial

  • Communication between processes
    0 0v3rloader

    Hello, What is the best way to make different processes send messages to one another? I mean, I know how to make different threads within the same process (app) communicate with one another, but I really don't know what is the correct way of making different threads in different processes communicate with each other... David

    C / C++ / MFC question tutorial

  • DLL being freed
    0 0v3rloader

    Hello, I am loading a dll from an app (.exe) and it has to remain in memory after the app terminates execution. Well, the problem i've been having consists in that whenever the app stops running, the dll is automatically freed (possibly because it is associated with the creating thread/instance.) How can I prevent this from happening? I mean, how can I make the Dll remain in memory until it receives a notification saying it can terminate? Thanks, Dave BTW: it is a dll with MFC support...

    C / C++ / MFC question c++ performance help

  • Preventing multiple instance creation in DLL
    0 0v3rloader

    Hi and thanks for the reply! That is exactly what I need to do. I would have accomplished it by now if it wasn't for one thing: this Dll of mine has MFC support and thus I don't have access to the DllMain procedure! I do have access to CWinApp::InitInstance. How can I prevent the Dll from loading twice? Perhaps I'm just confusing (and confused) with all this Dll business...

    C / C++ / MFC

  • Preventing multiple instance creation in DLL
    0 0v3rloader

    I'm sorry if I wasn't clear enough... Allow me to explain what I need to do: I have to create a Dll, which is loaded at startup time and should be accessible by any application. Among many different features, this Dll creates a kind of console for output purposes only. So, all applications loading the Dll, can get direct access to this "output console" (and other features.) My problem is I can't let the Dll get duplicated each time an app loads it. This is why I am asking you for your help as I have never attempted to do this in a Dll. Actually I have never had this need before. What would you suggest me to do? Dave BTW: Perhaps I can prevent this from happening if all the applications use GetModuleHandle, instead of loading them?

    C / C++ / MFC
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups