Author Topic: Part #2 - C programmers.. need assistance.  (Read 9231 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:

 

RyU

September 03, 2024, 05:15:49 PM
And wow Derrick is still playing lol
 

RyU

September 03, 2024, 05:15:15 PM
Just know yesterday is gone and soon tomorrow will be gone too  :)
 

Lejionator

August 08, 2024, 07:28:01 PM
It's tiem to QuakeCon!!!  ;)

https://www.youtube.com/watch?v=ThQd_UJaTys
 

ImperiusDamian

July 26, 2024, 09:34:53 PM
In nomine Quake II et Id Software et Spiritus John Carmack, Amen.
 

QuakeDuke

July 26, 2024, 05:10:30 PM
Hey, shout, summertime blues
Jump up and down in you blue suede shoes
Hey, did you rock and roll? Rock on!!  ...QD
 

Yotematoi

July 24, 2024, 01:31:20 PM
Ayer me mato 5 veces para robarme en la vida real hará lo mismo? [img]<iframe src="https://www.facebook.com/plugins/post.php?href=https%3A%2F%2Fwww.facebook.com%2Fzoloyoze.torito%2Fposts%2Fpfbid0wXU2VgS7atesBcSoMz5BWMJCJajeZFVT6GzSU6TtpJGddN9kLTvWNgcZaskkbKFQl&amp;show_text=true&amp;width=500
https://www.facebook.com/plugins/post.php?href=https%3A%2F%2Fwww.facebook.com%2Fzoloyoze.torito%2Fposts%2Fpfbid0wXU2VgS7atesBcSoMz5BWMJCJajeZFVT6GzSU6TtpJGddN9kLTvWNgcZaskkbKFQl&show_text=true&width=500" width="500"
 

Yotematoi

July 24, 2024, 01:25:59 PM
hi ya está la basura de Martin, se cambió el nombre es un ladron estupido, asi llegó a 10000[img]<iframe src="https://www.facebook.com/plugins/post.php?href=https%3A%2F%2Fwww.facebook.com%2Fzoloyoze.torito%2Fposts%2Fpfbid03hZrkDUBJPZKCuFgy5hRUy831ekKJYVRzC7ajXaKQbJ6xcPgKftLukUDfovFyEq3l&amp;show_text
https://www.facebook.com/plugins/post.php?href=https%3A%2F%2Fwww.facebook.com%2Fzoloyoze.torito%2Fposts%2Fpfbid03hZrkDUBJPZKCuFgy5hRUy831ekKJYVRzC7ajXaKQbJ6xcPgKftLukUDfovFyEq3l&show_text
 

Yotematoi

July 24, 2024, 01:25:59 PM
hi ya está la basura de Martin, se cambió el nombre es un ladron estupido, asi llegó a 10000[img]<iframe src="https://www.facebook.com/plugins/post.php?href=https%3A%2F%2Fwww.facebook.com%2Fzoloyoze.torito%2Fposts%2Fpfbid03hZrkDUBJPZKCuFgy5hRUy831ekKJYVRzC7ajXaKQbJ6xcPgKftLukUDfovFyEq3l&amp;show_text
https://www.facebook.com/plugins/post.php?href=https%3A%2F%2Fwww.facebook.com%2Fzoloyoze.torito%2Fposts%2Fpfbid03hZrkDUBJPZKCuFgy5hRUy831ekKJYVRzC7ajXaKQbJ6xcPgKftLukUDfovFyEq3l&show_text
 

-Unh0ly-

July 05, 2024, 05:20:36 AM

Show 50 latest
Welcome, Guest. Please login or register.
September 21, 2024, 12:55:42 AM

Login with username, password and session length