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
P

pl_kode

@pl_kode
About
Posts
85
Topics
45
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Problem with variables
    P pl_kode

    I had posted this earlier but no reply. Sorry for posting it again This is how it is... My Class is defined in newclass.h as...

    Class A
    {
    public:
    void out_func1();
    void out_func2();
    class B
    {
    public:
    string path;
    in_func1();
    };
    };

    I then Get the path at intialize.cpp as follows....

    void A::out_func1()
    {
    B obj;
    obj.path="c:\folder\file1.txt";
    }

    Then I try to open the file to write in write.cpp...

    void A::out_func2()
    {
    B obj;
    ofstream myfile;
    myfile.open (obj.path.c_str(), ios::app);
    ...
    }

    This crashes.I have included the header initialise.h too. Please let me know were I could have gone wrong. I think I am having problem with the scope of the varible. But I am not sure. THANKS.

    C / C++ / MFC c++ ios help

  • Accessing variables in nested classes
    P pl_kode

    Please help me out with the above problem. THANKS.

    C / C++ / MFC question ios help tutorial

  • Accessing variables in nested classes
    P pl_kode

    I am sorry. This is how it is... My Class is defined in newclass.h as...

    Class A
    {
    public:
    void out_func1();
    void out_func2();
    class B
    {
    public:
    string path;
    in_func1();
    };
    };

    I then Get the path at intialize.cpp as follows....

    void A::out_func1()
    {
    B obj;
    obj.path="c:\folder\file1.txt";
    }

    Then I try to open the file to write in write.cpp...

    void A::out_func2()
    {
    B obj;
    ofstream myfile;
    myfile.open (obj.path.c_str(), ios::app);
    ...
    }

    This crashes.I have included the header initialise.h too. Please let me know were I could have gone wrong. I think I am having problem with the scope of the varible. But I am not sure. THANKS.

    C / C++ / MFC question ios help tutorial

  • Accessing variables in nested classes
    P pl_kode

    I am doin the following...

    Class A
    {
    public:
    void out_func1();
    class B
    {
    public:
    string path;
    in_func1(); //Assigning the value of path in func1
    };
    };

    How do I use the value of path in 'out_func1()'?? I tried ...

    void A::out_func1()
    {
    B obj;
    obj.path;
    ofstream myfile;
    myfile.open (obj.path.c_str(), ios::app);
    ...
    }

    This causes problem during runtime and the program crashes Please let me know how to rectify this. THANKS.

    C / C++ / MFC question ios help tutorial

  • Converting string to bool
    P pl_kode

    true/ false is stored in that

    C / C++ / MFC

  • Converting string to bool
    P pl_kode

    Thanks for the reply. This can be done. But instead I am looking for some function that does this like atoi() or itoa() for string to int and vice versa. Is there any function for strings to bool.

    C / C++ / MFC

  • Converting string to bool
    P pl_kode

    I am getting a string from map that can be either true or false. Is there any function or some alternative to convert this string into bool. So that I can store it in a bool variable.

    string temp;
    temp=MyMap.find("Check")->second; // give either true or false

    I want to convert temp to bool. THANKS.

    C / C++ / MFC

  • How to overcome this error...
    P pl_kode

    I have a class as...

    class Log
    {public:
    Log(string);
    void InitializeLog(string);
    ...

    class Initialize
    { public:
    Initialize(string);
    void ReadPropfile(string);
    ....
    };
    };

    next I am doin this...

    void Log::InitializeLog(string p_path_name)
    {
    Initialize obj(p_path_name);
    obj.ReadPropfile(p_path_name);
    }
    void Log::Initialize::ReadPropfile(string log_path)
    {....}

    From the main I call...

    Log obj(path); // path is a string
    obj.InitializeLog(path);
    ...

    When I compile I get the following error. How do I get rid of this

    test_utility.obj :error LNK2001: unresolved external symbol "public: __thiscall Log::Log(class std::basic_string,class std::allocator >)" (??0Log@@QAE@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@
    @std@@@Z)
    properties.obj : error LNK2001: unresolved external symbol "public: __thiscall Log::Initialize::Initialize(class std::basic_string,class std::allocator >)" (??0Initialize@Log@@QAE@V?$basic_string@DU?$char_tra
    its@D@std@@V?$allocator@D@2@@std@@@Z)

    THANKS

    C / C++ / MFC question help tutorial

  • Getting rid of the following warnings..
    P pl_kode

    I am reading a file and getting the key and values. I am putting the keys and values in the map. When I run the program I get many number of warnings like... warningC4786: 'std::_Tree,std::allocator >,std::pair,std::allocator > const , std::basic_string,std::allocator > >,std::map,std::allocator >,std::basic_string,std::allocator >,std::less,std::allocator > >,std::allocator,std::allocator > > >::_Kfn,std::less,std::allocator > >,std::allocator,std::allocator > > >' : identifier was truncated to '255' characters in the debug information c:\program files\microsoft visual studio\vc98\include\map(46) : see reference to class template instantiation 'std::_Tree,std::allocator >,std::pair,std::allocator > const ,std::basic_string,std::allocator > >,std::map,std::allocator >,std::basic_string,std::allocator >,std::less,std::allocator > >,std::allocator,std::allocator > > >::_Kfn,std::less,std::allocato r > >,std::allocator,std::allocator > > >' being compiled F:\Main Project\Coding\DLL_logging_Utility\properties.cpp(41) : see reference to class template instantiation 'std::map,std::allocator >,std::basic_string,std::a llocator >,std::less,std::allocator > >,std::allocator,std::allocator > > >' being compiled THANKS

    C / C++ / MFC csharp c++ css visual-studio debugging

  • Requirements to create a game
    P pl_kode

    Suppose I want to make a 3d car racing game. Then in this case what things I need to be know. Please give me some examples of the requirements needed.

    C / C++ / MFC c++ game-dev business

  • Requirements to create a game
    P pl_kode

    Please let me know what are the requirements to create a game in VC++. By requirements I mean like SDK's or game engine's etc.

    C / C++ / MFC c++ game-dev business

  • Got deadlock when i run my multiThread FTP application
    P pl_kode

    Are you syncronizing threads. If there is a problem of Syncronization of threads then try using Mutex, critical section etc. try to syncronize the threads.

    C / C++ / MFC sysadmin

  • How to create timestamp
    P pl_kode

    Please let me know how do I create a timestamp. In the following format.. 2007.11.21 16:36:46.094+00:00 Thanks

    C / C++ / MFC tutorial question

  • making file path generic
    P pl_kode

    Ok fine.. But how do I store the path of the file in the registry. How does it work. THANKS

    C / C++ / MFC help question

  • making file path generic
    P pl_kode

    Now I do it in this way... char *prop_path; prop_path = getenv ("file.properties"); and get the following error.. error C2501: 'prop_path' : missing storage-class or type specifiers error C2040: 'prop_path' : 'int' differs in levels of indirection from 'char *' error C2440: 'initializing' : cannot convert from 'char *' to 'int' This conversion requires a reinterpret_cast, a C-style cast or function-style cast How shud i get rid of them .please suggest.

    C / C++ / MFC help question

  • making file path generic
    P pl_kode

    I have to read a property file to get the values from it. I am creating a generic DLL program were I have to put the path for this properties file in such a way that it can be accessed from anywere. At present I am hardcoding it like.. char path[]="c:\properties\file.properties" Now if the dll gets created with this path and the properties file is in another folder. how do I access it. Please help me with some suggestions. I have to make it generic. THANKS.

    C / C++ / MFC help question

  • Use of appender in log4j
    P pl_kode

    Please let me know what is the use of appenders that is included in the properties file of log4j. And how it works? THANKS.

    Java question

  • Get file size
    P pl_kode

    I am reading the value of the size from the properties file... e.g. file_size=500. I have to check for the file size limit. The max limit is set as done above. During runtime the following function checks for the file size with the above by using the following function to get the current file size.

    int get_file_size()
    {
    long file_size;
    ifstream myfile;
    myfile.open(path.c_str());
    myfile.seekg(0, ios::end);
    file_size = myfile.tellg();
    myfile.close();
    return file_size;
    }

    But if I do this I get the file size in bytes. I want to do everything in kb's. Any suggestion please. THANKS.

    C / C++ / MFC ios

  • convert string to bool
    P pl_kode

    I got it correct. THANKS.. ;)

    C / C++ / MFC help

  • convert string to bool
    P pl_kode

    on doing that I get the following. error C2664: '__thiscall std::basic_string,class std::allocator >::std::basic_string,class std::allocator >(const cla ss std::allocator &)' : cannot convert parameter 1 from 'bool' to 'const class std::allocator &' Reason: cannot convert from 'bool' to 'const class std::allocator' No constructor could take the source type, or constructor overload resolution was ambiguous I get the same even if I do the way Pallini said. :(

    C / C++ / MFC help
  • Login

  • Don't have an account? Register

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