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

 

ImperiusDamian

May 12, 2025, 01:45:35 AM
Quake II is not 27 years old. I refuse to accept THAT much time has gone by.
 

|iR|Focalor

May 11, 2025, 02:33:39 PM
 

-Unh0ly-

May 03, 2025, 08:02:46 AM
198.179.6.200:30634
 

Yotematoi

May 02, 2025, 10:27:47 AM
Note for Player-4109 "Remember, the Guinness Book of Records does not include cowards who shot at someone by treachery." :D
 

|iR|Focalor

April 02, 2025, 02:47:07 AM
 

Yotematoi

February 14, 2025, 12:41:48 PM
 :-*
 

|iR|Focalor

February 13, 2025, 07:31:24 AM
I was on DM this morning for the first time in a pretty long time. Seemed fine to me.

0rbisson

February 13, 2025, 04:54:21 AM
DM server is fucked. 2 point blank rockets from spawn and lava damage and player survived? WTF?" Also someone has fucked with the spawn points, every single time no matter how big the map you spawn right in front of the person who killed you last
 

rikwad

February 08, 2025, 10:48:18 PM
Seattle FFA now has working HTTP downloads. Thanks Unholy!
 
RIP Pepp   ✟
 

Show 50 latest
Welcome, Guest. Please login or register.
May 15, 2025, 12:44:23 PM

Login with username, password and session length