Click here to Skip to main content
15,915,094 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Login Form Pin
Aqueel12-Apr-06 21:33
Aqueel12-Apr-06 21:33 
AnswerRe: Login Form Pin
Cedric Moonen12-Apr-06 21:36
Cedric Moonen12-Apr-06 21:36 
GeneralRe: Login Form Pin
Aqueel12-Apr-06 21:45
Aqueel12-Apr-06 21:45 
GeneralRe: Login Form Pin
Nokoff13-Apr-06 3:10
Nokoff13-Apr-06 3:10 
GeneralRe: Login Form Pin
Nokoff13-Apr-06 3:11
Nokoff13-Apr-06 3:11 
GeneralRe: Login Form Pin
Cedric Moonen13-Apr-06 3:20
Cedric Moonen13-Apr-06 3:20 
GeneralRe: Login Form Pin
Nokoff13-Apr-06 7:00
Nokoff13-Apr-06 7:00 
QuestionFunctions and dlls Pin
Nokoff12-Apr-06 21:00
Nokoff12-Apr-06 21:00 
I've been struggling with this for a while. I'm hoping someone can help.

Let's say I have a standard set of commands, namely, to write all changes to a text file. Now I want to repeatedly implement this block of code in my program without having to copy and paste the entire block of code. How can this be done?

This is an example of the code

// Writes all the changes to the text file

StreamWriter^ rewrite = gcnew StreamWriter(file_path);

for (int i=0; i < listView1->Items->Count; i++)

{

rewrite->Write(listView1->Items[i]->Text);

// Remove the R from the price

String^ price = listView1->Items[i]->SubItems[1]->Text->Remove(0,2);

rewrite->Write(" ["+price+"]");

rewrite->WriteLine(" #"+listView1->Items[i]->SubItems[2]->Text+"##");

}

rewrite->Close();


Is it possible to store it in a dll file and call it from the code? Is it possible to store this code in another form or resource in the current project and call it as a function? How would I go about doing that?

If at all possible, take me through it slow, I'd really like to understand this concept.

Thank You for your time
Nokoff
AnswerRe: Functions and dlls Pin
Cedric Moonen12-Apr-06 21:45
Cedric Moonen12-Apr-06 21:45 
GeneralRe: Functions and dlls Pin
Nokoff13-Apr-06 3:13
Nokoff13-Apr-06 3:13 
GeneralRe: Functions and dlls Pin
Cedric Moonen13-Apr-06 3:23
Cedric Moonen13-Apr-06 3:23 
GeneralRe: Functions and dlls Pin
Nokoff13-Apr-06 9:01
Nokoff13-Apr-06 9:01 
QuestionStreamReader() Search and destroy lol Pin
Nokoff12-Apr-06 20:53
Nokoff12-Apr-06 20:53 
AnswerRe: StreamReader() Search and destroy lol Pin
toxcct12-Apr-06 23:36
toxcct12-Apr-06 23:36 
GeneralRe: StreamReader() Search and destroy lol Pin
Nokoff13-Apr-06 3:14
Nokoff13-Apr-06 3:14 
GeneralRe: StreamReader() Search and destroy lol Pin
toxcct13-Apr-06 3:38
toxcct13-Apr-06 3:38 
GeneralRe: StreamReader() Search and destroy lol Pin
Nokoff13-Apr-06 7:03
Nokoff13-Apr-06 7:03 
GeneralRe: StreamReader() Search and destroy lol Pin
toxcct13-Apr-06 7:06
toxcct13-Apr-06 7:06 
QuestionCost Calculation Problem Pin
Harsimran_Singh12-Apr-06 20:42
Harsimran_Singh12-Apr-06 20:42 
AnswerRe: Cost Calculation Problem Pin
thatsme_cool12-Apr-06 21:05
thatsme_cool12-Apr-06 21:05 
GeneralRe: Cost Calculation Problem Pin
Harsimran_Singh12-Apr-06 21:14
Harsimran_Singh12-Apr-06 21:14 
GeneralRe: Cost Calculation Problem Pin
toxcct12-Apr-06 22:28
toxcct12-Apr-06 22:28 
GeneralRe: Cost Calculation Problem Pin
Harsimran_Singh12-Apr-06 22:36
Harsimran_Singh12-Apr-06 22:36 
GeneralRe: Cost Calculation Problem Pin
Cedric Moonen12-Apr-06 22:40
Cedric Moonen12-Apr-06 22:40 
GeneralRe: Cost Calculation Problem Pin
toxcct12-Apr-06 22:42
toxcct12-Apr-06 22:42 

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.