Author Topic: Part #2 - C programmers.. need assistance.  (Read 9444 times)

Offline [N]auTiCa

  • Jr. Member
  • **
  • Posts: 99
    • View Profile
    • Extreme Online Gaming
  • Rated:
Re: Part #2 - C programmers.. need assistance.
« Reply #30 on: April 10, 2007, 11:14:01 PM »
thanx quadz.. I'm understanding what needs to be done, but my problem is that I don't know how to output m_pNote to the preview window?
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus
Clan ^K][L^  co-leader! www.clankil.com
dC member! www.monsterkill.org

Offline [N]auTiCa

  • Jr. Member
  • **
  • Posts: 99
    • View Profile
    • Extreme Online Gaming
  • Rated:
Re: Part #2 - C programmers.. need assistance.
« Reply #31 on: April 10, 2007, 11:43:04 PM »
This is driving me nuts.. I cannot understand this shit and I'm getting restless, almost 3am.. excuse the language  :frustration:

would something like this seem adequate?

Code: [Select]
void CDlgRecycleBin::Preview(CString szFile)
{

POSITION pos;
CString szXML, szTemp;
CRect rc1, rc2;

if (theApp.m_bSortRecycleBinDescending)
pos = m_pNote.GetTailPosition ();
else
pos = m_pNote.GetHeadPosition ();

POSITION delpos;
int rgIndex[BUFFERSIZE];
m_pTitle.GetSelItems (BUFFERSIZE, rgIndex);
int iRow = 0;
int iCount = 0;

  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus
Clan ^K][L^  co-leader! www.clankil.com
dC member! www.monsterkill.org

Offline console

  • Brobdingnagian Member
  • ***
  • Posts: 4518
  • "Man, this is the way to travel," said my attorney
    • View Profile
    • tastyspleen.net
  • Rated:
Re: Part #2 - C programmers.. need assistance.
« Reply #32 on: April 10, 2007, 11:43:51 PM »
Hmm..

Well... take a look at:

Code: [Select]
void CDlgRecycleBin::DeleteMarkedNotes ()
{
POSITION pos;

if (theApp.m_bSortRecycleBinDescending)
pos = m_pNote.GetTailPosition ();
else
pos = m_pNote.GetHeadPosition ();

POSITION delpos;
int rgIndex[BUFFERSIZE];
m_pTitle.GetSelItems (BUFFERSIZE, rgIndex);
int iRow = 0;
int iCount = 0;

while (pos) {
delpos = pos;
tagNote note;

if (theApp.m_bSortRecycleBinDescending)
note = m_pNote.GetPrev (pos);
else
note = m_pNote.GetNext (pos);

if (iRow == rgIndex[iCount]) {

m_pNote.RemoveAt (delpos);
iCount++;
}

iRow++;
}
}


I mean, basically, you're dealing with a crappy Microsoft version of the STL.  Unfortunately, the STL, like Unix, was written by people with big-picture ideas of how a whole system would work.  Which would be great, if only you could use the STL or Unix.  But instead you're stuck with Microsoft, which was put together apparently by various smart people with no big-picture ideas and it's a big wasteland of poorly-cooperating co-existing system fiefdoms.  . . . Errr....

Well, anyway...  :lol:

What ???

:evilalien: :dohdohdoh:
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus

Offline [N]auTiCa

  • Jr. Member
  • **
  • Posts: 99
    • View Profile
    • Extreme Online Gaming
  • Rated:
Re: Part #2 - C programmers.. need assistance.
« Reply #33 on: April 10, 2007, 11:49:58 PM »
lol.. damn microsoft!

so do I create something like..

Code: [Select]
void CDlgRecycleBin::PreviewNotes ()
{
POSITION pos;

if (theApp.m_bSortRecycleBinDescending)
pos = m_pNote.GetTailPosition ();
else
pos = m_pNote.GetHeadPosition ();

POSITION delpos;
int rgIndex[BUFFERSIZE];
m_pTitle.GetSelItems (BUFFERSIZE, rgIndex);
int iRow = 0;
int iCount = 0;

while (pos) {
delpos = pos;
tagNote note;

if (theApp.m_bSortRecycleBinDescending)
IDC_Preview = m_pNote.GetPrev (pos);
else
note = m_pNote.GetNext (pos);

if (iRow == rgIndex[iCount]) {

m_pNote.RemoveAt (delpos);
iCount++;
}

iRow++;
}
}

dude.. I'm lost, I can imagine your laughing at my modified version of the above code...  :-[

I'm trying to figure out where IDC_Preview would go so that whatever is selected will be outputted to the preview pane.
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus
Clan ^K][L^  co-leader! www.clankil.com
dC member! www.monsterkill.org

Offline console

  • Brobdingnagian Member
  • ***
  • Posts: 4518
  • "Man, this is the way to travel," said my attorney
    • View Profile
    • tastyspleen.net
  • Rated:
Re: Part #2 - C programmers.. need assistance.
« Reply #34 on: April 10, 2007, 11:52:36 PM »
This is driving me nuts.. I cannot understand this shit and I'm getting restless, almost 3am.. excuse the language  :frustration:

would something like this seem adequate?

Code: [Select]
void CDlgRecycleBin::Preview(CString szFile)
{

POSITION pos;
CString szXML, szTemp;
CRect rc1, rc2;

if (theApp.m_bSortRecycleBinDescending)
pos = m_pNote.GetTailPosition ();
else
pos = m_pNote.GetHeadPosition ();

POSITION delpos;
int rgIndex[BUFFERSIZE];
m_pTitle.GetSelItems (BUFFERSIZE, rgIndex);
int iRow = 0;
int iCount = 0;


Well, that looks like a good start, actually!

From that point you could easily find, say, the FIRST selected element... and look up the note for that element index... and get the tagNote data structure from that note.


Regards,

quadz
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus

Offline [N]auTiCa

  • Jr. Member
  • **
  • Posts: 99
    • View Profile
    • Extreme Online Gaming
  • Rated:
Re: Part #2 - C programmers.. need assistance.
« Reply #35 on: April 11, 2007, 12:03:37 AM »
And to think I didn't know what I was doing... hahah

anyways...

would adding a line like:

if (m_pTitle.GetCount () == 0)
      return;

CString szImport;
   szImport.Format (_T("%s\\import.xml"), GetApplicationDataPath ());
   CreateImportXml (szImport);

   IDC_Preview (szImport);

work? ..i took that from the OnRestore function.

btw.. have you actually completed this assignment? I'm assuming something like this would take you 10 mins to complete, if not less than that.
« Last Edit: April 11, 2007, 12:05:47 AM by [N]auTiCa^K][L^ »
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus
Clan ^K][L^  co-leader! www.clankil.com
dC member! www.monsterkill.org

Offline [N]auTiCa

  • Jr. Member
  • **
  • Posts: 99
    • View Profile
    • Extreme Online Gaming
  • Rated:
Re: Part #2 - C programmers.. need assistance.
« Reply #36 on: April 11, 2007, 12:30:38 AM »
Any other hints or suggestions quadz.. I'm about to get some sleep, almost 4am and what I have thus far obviously doesn't work, so I'll try and wake up early and clean up any code that is wrong, although I don't think I'll successfully complete it.

If you have anything else to share, please do! I need this part of the project to help cushion my somewhat poor performance on the first part  :(

Let me know, I'll be off within the next half hour.. thanx again for your help on this one, I'm sure it's getting late for you too.

p.s. just forward me your code lol ~  ;)
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus
Clan ^K][L^  co-leader! www.clankil.com
dC member! www.monsterkill.org

Offline console

  • Brobdingnagian Member
  • ***
  • Posts: 4518
  • "Man, this is the way to travel," said my attorney
    • View Profile
    • tastyspleen.net
  • Rated:
Re: Part #2 - C programmers.. need assistance.
« Reply #37 on: April 11, 2007, 02:18:44 AM »
Hmm.. Well I guess it's too late, then :(

But essentially... when your dialog gets an ON_LBN_SELCHANGE event for the list box... You could ask for the selected items,  if there's more than one item, you could just display "(multiple selection") or somesuch in the preview pane.  If exactly one note title is selected in m_pTitle, then take that index number and find the corresponding tagNote data in m_pNote... and SetWindowText the note data into the preview pane edit box.


Regards,

quadz
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus

Offline [N]auTiCa

  • Jr. Member
  • **
  • Posts: 99
    • View Profile
    • Extreme Online Gaming
  • Rated:
Re: Part #2 - C programmers.. need assistance.
« Reply #38 on: April 11, 2007, 08:11:29 AM »
I technically still have two more hours before I have to turn this in.. if your around, I can still use some help! :)
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus
Clan ^K][L^  co-leader! www.clankil.com
dC member! www.monsterkill.org

 

El Box de Shoutamente

Last 10 Shouts:

Costigan_Q2

November 11, 2024, 06:41:06 AM
"Stay cozy folks.

Everything is gonna be fine."

There'll be no excuses for having TDS after January 20th, there'll be no excuses AT ALL!!!
 

|iR|Focalor

November 06, 2024, 03:28:50 AM
 

RailWolf

November 05, 2024, 03:13:44 PM
Nice :)

Tom Servo

November 04, 2024, 05:05:24 PM
The Joe Rogan Experience episode 223 that dropped a couple hours ago with Musk, they're talking about Quake lol.

Costigan_Q2

November 04, 2024, 03:37:55 PM
Stay cozy folks.

Everything is gonna be fine.
 

|iR|Focalor

October 31, 2024, 08:56:37 PM

Costigan_Q2

October 17, 2024, 06:31:53 PM
Not activated your account yet?

Activate it now! join in the fun!

Tom Servo

October 11, 2024, 03:35:36 PM
HAHAHAHAHAHA
 

|iR|Focalor

October 10, 2024, 12:19:41 PM
I don't worship the devil. Jesus is Lord, friend. He died for your sins. He will forgive you if you just ask.
 

rikwad

October 09, 2024, 07:57:21 PM
Sorry, I couldn't resist my inner asshole.

Show 50 latest
Welcome, Guest. Please login or register.
November 24, 2024, 03:15:47 PM

Login with username, password and session length