Click here to Skip to main content
15,892,768 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generalbinary file stream Pin
SimpleProgramer4-Mar-05 8:00
SimpleProgramer4-Mar-05 8:00 
GeneralRe: binary file stream Pin
Tarundeep Singh Kalra4-Mar-05 8:06
Tarundeep Singh Kalra4-Mar-05 8:06 
GeneralRe: binary file stream Pin
SimpleProgramer4-Mar-05 8:14
SimpleProgramer4-Mar-05 8:14 
GeneralRe: binary file stream Pin
David Crow4-Mar-05 9:21
David Crow4-Mar-05 9:21 
GeneralRe: binary file stream Pin
SimpleProgramer4-Mar-05 20:59
SimpleProgramer4-Mar-05 20:59 
GeneralRe: binary file stream Pin
David Crow7-Mar-05 2:22
David Crow7-Mar-05 2:22 
QuestionLinking property sheets and multiple views ?? how do I ?? Pin
ur_unholyness4-Mar-05 7:20
ur_unholyness4-Mar-05 7:20 
GeneralDynamically Opening Files for Output Pin
ChemmieBro4-Mar-05 7:18
ChemmieBro4-Mar-05 7:18 
I have a pretty simple logger COM component that I am building right now that simply logs entries to a text file when the "LogEntry" call is made. However currently it only logs to one file and that file is declared at construction.

I am now trying to add both a "public" and "private" functionality.

First, I need to check a conditional that the "LogEntry" is either public or private. If it is public, I do everything the same as I do now, if it is private, I need to log it to it's private file.


I am trying to find a way to dynamically enter into a file.

I have tried this already:
I declared a std::map<string, ofstream=""> object. The string is the FileName.
I decided to use a map to make sure I open the file the first time I log to the private file. I run a .find on the string to see if the file is there.
If the file is there, I log to it. If it is not there, I open the file and log to it, leaving it open for future logging.

None of this is working for me.


Since there will be many different clients using this logger component, I need a way to determine which file to log to as they will all have separate files. Then log to that file. But since I don't know how many clients I will have, I need this to be dynamic.

Any help will be appreciated.
Thank you.
GeneralRe: Dynamically Opening Files for Output Pin
Blake Miller4-Mar-05 7:43
Blake Miller4-Mar-05 7:43 
GeneralRe: Dynamically Opening Files for Output Pin
Tarundeep Singh Kalra4-Mar-05 7:53
Tarundeep Singh Kalra4-Mar-05 7:53 
GeneralRe: Dynamically Opening Files for Output Pin
ChemmieBro4-Mar-05 8:35
ChemmieBro4-Mar-05 8:35 
GeneralEnumerating devices on LAN Pin
lastdays4-Mar-05 7:05
lastdays4-Mar-05 7:05 
GeneralRe: Enumerating devices on LAN Pin
Tarundeep Singh Kalra4-Mar-05 7:48
Tarundeep Singh Kalra4-Mar-05 7:48 
GeneralRe: Enumerating devices on LAN Pin
lastdays4-Mar-05 9:04
lastdays4-Mar-05 9:04 
GeneralRe: Enumerating devices on LAN Pin
lastdays4-Mar-05 9:52
lastdays4-Mar-05 9:52 
Generalautomate IE's image save as function Pin
tkarven4-Mar-05 6:59
tkarven4-Mar-05 6:59 
GeneralRe: automate IE's image save as function Pin
Tarundeep Singh Kalra4-Mar-05 7:54
Tarundeep Singh Kalra4-Mar-05 7:54 
QuestionIn VC++ how can i use a shared port ?? Pin
ali mehdi4-Mar-05 5:25
ali mehdi4-Mar-05 5:25 
GeneralChecking drop down toolbar menu items Pin
Kapgan4-Mar-05 5:24
Kapgan4-Mar-05 5:24 
GeneralRe: Checking drop down toolbar menu items Pin
David Crow4-Mar-05 7:15
David Crow4-Mar-05 7:15 
GeneralRe: Checking drop down toolbar menu items Pin
Kapgan4-Mar-05 8:21
Kapgan4-Mar-05 8:21 
GeneralRe: Checking drop down toolbar menu items Pin
David Crow4-Mar-05 8:28
David Crow4-Mar-05 8:28 
GeneralRe: Checking drop down toolbar menu items Pin
Kapgan4-Mar-05 9:56
Kapgan4-Mar-05 9:56 
GeneralRe: Checking drop down toolbar menu items Pin
David Crow4-Mar-05 10:03
David Crow4-Mar-05 10:03 
Questionhow to use of hotkey Pin
ali mehdi4-Mar-05 5:22
ali mehdi4-Mar-05 5:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.