CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: Joeman

Page 1 of 25 1 2 3 4

Search: Search took 0.04 seconds.

  1. Thread: std::make_pair

    by Joeman
    Replies
    6
    Views
    2,992

    Re: std::make_pair

    this compiles


    #include <utility>
    #include <Windows.h>

    int main()
    {
    RECT rc = {0};
    std::pair <LONG,LONG> ControlSize;
  2. Replies
    19
    Views
    3,276

    Re: To be or not to be (a console app)

    You're welcome :).
    Also my code made sure it didn't break the command:
    EXENAME > echo.txt
    To make sure your app doesn't break that command, you need to adapt IsAConsole at the least like:


    ...
  3. Replies
    19
    Views
    3,276

    Re: To be or not to be (a console app)

    This is what ~cConsoleInitializer did


    ~cConsoleInitializer()
    {
    if( File )
    {
    INPUT_RECORD InputRecord;

    InputRecord.EventType = KEY_EVENT;
  4. Replies
    19
    Views
    3,276

    Re: To be or not to be (a console app)

    This seems like what you want:
    #include <windows.h>
    #include <iostream>
    #include <cstdio>

    bool IsAConsole( HANDLE Handle )
    {
    DWORD Mode;
    return GetConsoleMode( Handle, &Mode ) != 0;...
  5. Replies
    4
    Views
    2,153

    Re: Variadic function pointer

    To be more elaborate about trying &Class.myfunction from my previous post. The compiler will complain about trying to form a pointer by taking the address of a bound member function.

    The correct...
  6. Replies
    4
    Views
    2,153

    Re: Variadic function pointer

    Visual Studio 2010 c++ compiler:
    Gcc 4.7.0:
    This is incorrect since he only defined and declared a free standing function pointer, so you can assign any free standing function that...
  7. Replies
    15
    Views
    1,895

    Re: Reference to a pointer of another type

    I am confused about what you mean, but how about

    class A{};
    class B : public A{};

    int main()
    {
    A* pA = new B;
    B& pB1 = static_cast<B&>(*pA);
    }
  8. Re: learning about publicly and privately derived classes and access specifiers

    This is now possible with the new standard of c++ now called c++11 which was just finalized in August this year. c++11 is still being implemented in compilers. Gcc 4.7 and Clang 3.0 supports this...
  9. Re: std::for_each is not compiling with boost::algorithm::to_lowe

    #include <functional>
    #include <algorithm>
    #include <vector>
    #include <string>
    #include <locale>

    #include <boost/algorithm/string/case_conv.hpp>

    using namespace std;
    using namespace...
  10. Replies
    3
    Views
    715

    Re: Typedef a template

    I am sure you meant

    template <class T>
    Class1 < Class2 <T>>A problem that has now been fixed in the new c++11 standard. Any compiler that has been updated to conform will compile correctly.
    You...
  11. Replies
    15
    Views
    2,101

    Re: Array of objects

    char n[29];Why not use std::string?
    I think you quoted more than what you intended because you didn't fix the unsafe practice of calling delete by hand which can be fixed with raii design at the...
  12. Replies
    15
    Views
    2,101

    Re: Array of objects

    cout<<"Enter name :";
    cin>>n;

    cout<<"Enter shares :";
    cin>>num;

    cout<<"Enter share value :";
    cin>>val;

    s1[0].setName(n);
  13. Replies
    6
    Views
    1,412

    Re: Code is crashing

    I want to point out the template way to determine the size which adds a little bit of safety as well.


    template< typename TYPE, int Size >
    size_t GetArrayLength( TYPE (&Array)[Size] )
    { ...
  14. Replies
    11
    Views
    1,595

    Re: allocating and deallocating

    Why not learn from tutorials as well? Also read faqs. They can provide common pitfalls and how to avoid them. Googling your question first is even better if you can generalize it.


    void...
  15. Replies
    42
    Views
    10,489

    Re: Windows 8 / Metro ?

    Actually I was thinking of a user's point of view. I can see how you got confused, but as a programmer I haven't actually looked at windows 8 ... yet ...

    So what if metro maybe the next big...
  16. Replies
    11
    Views
    2,442

    Re: Need opengl help.

    class UtilWindow
    {
    public:
    Reshape(int width, int height);
    ~Reshape();

    private:

    };You should look at some tutorials about classes and see how they declare a constructor and...
  17. Thread: Semantics

    by Joeman
    Replies
    11
    Views
    1,988

    Re: Semantics

    I wouldn't inherit a shared_ptr since the destructor isn't virtual. Also shared_ptr only destroys the object it contains only after all shared_ptrs destruct, so if a user clicks the exit button, you...
  18. Replies
    42
    Views
    10,489

    Re: Windows 8 / Metro ?

    I disagree. It is to make things easier by mapping one set of contexts to another and not to make things harder in general. I am fine with simplifying tools to make them more flexible and less ridged...
  19. Replies
    42
    Views
    10,489

    Re: Windows 8 / Metro ?

    Well I am glad you revised your words because I really didn't read it that way the first time :). I won't argue that they are more prone to write horrible code, but at least it won't blow up so...
  20. Replies
    42
    Views
    10,489

    Re: Windows 8 / Metro ?

    I disagree. A high level language should make it easier to write code since it abstracts away hardware dependency which abstracts away concepts related to hardware. For example, who aligns machine...
  21. Replies
    31
    Views
    31,408

    Re: difference between polymorphism and overloading

    I agree knowing how things work and why is important. That is why I like computers in the first place :) They are quite complicated.
  22. Replies
    31
    Views
    31,408

    Re: difference between polymorphism and overloading

    This is because of the c++ standard. The only type of polymorphic behavior that goes by its direct effect is class polymorphismThat is because c++ doesn't have another terminology for class...
  23. Replies
    3
    Views
    1,066

    Re: Inherintance or Variable

    example...


    class cMainWindow
    {
    cWindow Window;

    cButton SaveButton;
    cButton CloseButton;
  24. Re: SendMessage fails with WM_MDICREATE

    You could try CreateMDIWindow and if it fails, call GetLastError() and look at the system error codes.
  25. Replies
    7
    Views
    1,560

    Re: [RESOLVED] Creating a window in a DLL

    Also don't forget to unregister your class since dlls do not unregister classes automatically.

    Also are you sure there isn't a better way to pass HWND? Can you at least pass pointers?
Results 1 to 25 of 625
Page 1 of 25 1 2 3 4





Click Here to Expand Forum to Full Width

Featured