Click here to Skip to main content
15,914,225 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Non-Blocking I/O From Within a Dialog Pin
David Crow9-Jul-04 8:40
David Crow9-Jul-04 8:40 
GeneralRe: Non-Blocking I/O From Within a Dialog Pin
pHaze4269-Jul-04 9:06
pHaze4269-Jul-04 9:06 
GeneralRe: Non-Blocking I/O From Within a Dialog Pin
David Crow9-Jul-04 9:12
David Crow9-Jul-04 9:12 
GeneralRe: Non-Blocking I/O From Within a Dialog Pin
palbano9-Jul-04 8:46
palbano9-Jul-04 8:46 
GeneralRe: Non-Blocking I/O From Within a Dialog Pin
pHaze4269-Jul-04 9:30
pHaze4269-Jul-04 9:30 
GeneralRe: Non-Blocking I/O From Within a Dialog Pin
palbano10-Jul-04 8:17
palbano10-Jul-04 8:17 
GeneralRe: Non-Blocking I/O From Within a Dialog Pin
pHaze42612-Jul-04 2:30
pHaze42612-Jul-04 2:30 
GeneralA pointer delimma (requesting help from pointer/dynamic array gurus) Pin
NTense9-Jul-04 7:45
NTense9-Jul-04 7:45 
Ok, I have a CArray container like so:

<br />
CArray <myObject, myObject> objectList;<br />


and I declared a dynamic array in a separate class like so:

<br />
class SelectionBox<br />
{<br />
public:<br />
   //constructor , destructor, etc...<br />
   void AddContent(myObject *); // <-- this is what's I can't figure out<br />
<br />
protected:<br />
   myObject *content;    // to be used as dynamic array<br />
   unsigned long numContents;  // counter that contains the number<br />
                               // of contents in the selection box<br />
}<br />


So now I built my AddContent() function like this:
<br />
void SelectionBox::AddContent(myObject *c)<br />
{<br />
   unsigned long counter;<br />
   myObject *tempObject;<br />
   tempObject = new myObject[numContents];<br />
<br />
   tempObject = content;<br />
<br />
   content = new myObject[numContents + 1];<br />
<br />
   for(counter = 0; counter < numContents; counter++)<br />
   {<br />
      content[counter] = tempObject[counter];<br />
   }<br />
<br />
   //c->IsSelected = true;  //<- this gives me the illusion that it's working<br />
   content[numContents] = c;<br />
   //content[numContents].IsSelected = true;  // <- this is what I need to work<br />
   <br />
   <br />
   numContents++;<br />
   delete [] tempObject;<br />
} <br />


Finally, in another part of the program, I shoot the address of one of the objects stored in the CArray to the AddContent function.

At first the function appeared to be working.. That is until I later tried to manipulate the original objects in the CArray by manipulating what I thought was the pointer to them in my SelectionBox class. Then I found out that I had copies of data stored and not a pointer to the CArray data. I can't for the life of me figure out how to declare the function and pass the data so that I can store an array of pointers/addresses to the data in the CArray container. Can someone show me an example, or maybe a link to a relevant tutorial?
GeneralRe: A pointer delimma (requesting help from pointer/dynamic array gurus) Pin
palbano9-Jul-04 8:13
palbano9-Jul-04 8:13 
GeneralRe: A pointer delimma (requesting help from pointer/dynamic array gurus) Pin
NTense10-Jul-04 7:22
NTense10-Jul-04 7:22 
GeneralTesting which OS I'm on Pin
Timothy Grabrian9-Jul-04 6:15
professionalTimothy Grabrian9-Jul-04 6:15 
GeneralRe: Testing which OS I'm on Pin
David Crow9-Jul-04 7:01
David Crow9-Jul-04 7:01 
GeneralRe: Testing which OS I'm on Pin
palbano9-Jul-04 7:04
palbano9-Jul-04 7:04 
GeneralRe: Testing which OS I'm on Pin
jmkhael9-Jul-04 7:05
jmkhael9-Jul-04 7:05 
GeneralRe: Testing which OS I'm on Pin
Michael Dunn9-Jul-04 10:05
sitebuilderMichael Dunn9-Jul-04 10:05 
GeneralRe: Testing which OS I'm on Pin
ThatsAlok9-Jul-04 19:25
ThatsAlok9-Jul-04 19:25 
Generaladding help to application Pin
BlackDice9-Jul-04 6:10
BlackDice9-Jul-04 6:10 
GeneralRe: adding help to application Pin
David Crow9-Jul-04 7:03
David Crow9-Jul-04 7:03 
GeneralRe: adding help to application Pin
BlackDice9-Jul-04 7:11
BlackDice9-Jul-04 7:11 
Generalfullscreening a dialog Pin
locoone9-Jul-04 4:47
locoone9-Jul-04 4:47 
GeneralRe: fullscreening a dialog Pin
Timothy Grabrian9-Jul-04 6:02
professionalTimothy Grabrian9-Jul-04 6:02 
GeneralCPtrList Pin
Mahendra_7869-Jul-04 4:46
Mahendra_7869-Jul-04 4:46 
GeneralRe: CPtrList Pin
Navin9-Jul-04 5:10
Navin9-Jul-04 5:10 
GeneralRe: CPtrList Pin
Mahendra_7869-Jul-04 6:12
Mahendra_7869-Jul-04 6:12 
GeneralRe: CPtrList Pin
Gary R. Wheeler10-Jul-04 2:38
Gary R. Wheeler10-Jul-04 2:38 

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.