Click here to Skip to main content
15,923,374 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: how to vary the size of the view using SDI formview? Pin
coda_x4-Dec-03 18:51
coda_x4-Dec-03 18:51 
GeneralWhether a is Socket alive question Pin
Stan the man3-Dec-03 19:43
Stan the man3-Dec-03 19:43 
GeneralRe: Whether a is Socket alive question Pin
Johnny ²3-Dec-03 21:56
Johnny ²3-Dec-03 21:56 
GeneralLogin Password Pin
Member 6488283-Dec-03 18:38
Member 6488283-Dec-03 18:38 
GeneralRe: Login Password Pin
Shanmuga Sundar3-Dec-03 18:43
Shanmuga Sundar3-Dec-03 18:43 
GeneralRe: Login Password Pin
Member 6488286-Dec-03 2:36
Member 6488286-Dec-03 2:36 
Generalquery on SDI doc/view and opengl Pin
coda_x3-Dec-03 18:20
coda_x3-Dec-03 18:20 
Generalpointers question Pin
alex.barylski3-Dec-03 17:33
alex.barylski3-Dec-03 17:33 
EDIT: I seem to have solved my problem using pointer pointers, but i'm not sure why or how without sitting down and thinking about it, someone care to shed some light still and get me started?

Someone explain why this isn't working please:

MyFunc(char* pBuf1, char* pBuf2, int nSize1, int& nSize2)
{
  ASSERT(pBuf2==0); // Make sure caller hasn't allocated memory

  pBuf2 = new char[SOMENUMBER];

  // Fill previously allocated buffer with valid data
  // ...
}


However when I call this function like:

int nSize = 0; // Size of buffer allocated by functions below

char* pOut = NULL; // So function doesn't ASSERT

MyFunc(pOrg, pOut, 100, nSize);

delete[] pOut; // Delete memory allocated by function


The code is straight forward, but when I step through it pOut doesn't retain the pointer to memory that is allocated inside the function? Inside the function everything is fine and a memory block is allocated, however once the function is complete and I continue with caller code the pointer to the allocated memory block remains ZERO???

What am I doing wrong...?

Thanks Smile | :)

The word of the day is legs, let's go back to my house and spread the word Poke tongue | ;-P
GeneralRe: pointers question Pin
User 5838523-Dec-03 17:41
User 5838523-Dec-03 17:41 
GeneralWindows Sounds Pin
User 5838523-Dec-03 17:27
User 5838523-Dec-03 17:27 
GeneralRe: Windows Sounds Pin
KaЯl3-Dec-03 23:35
KaЯl3-Dec-03 23:35 
GeneralRe: Windows Sounds Pin
Steve S4-Dec-03 0:38
Steve S4-Dec-03 0:38 
GeneralRe: Windows Sounds Pin
KaЯl4-Dec-03 4:21
KaЯl4-Dec-03 4:21 
GeneralRe: Windows Sounds Pin
User 5838524-Dec-03 10:29
User 5838524-Dec-03 10:29 
GeneralRe: Windows Sounds Pin
KaЯl4-Dec-03 11:00
KaЯl4-Dec-03 11:00 
GeneralRe: Windows Sounds Pin
Steve S5-Dec-03 0:57
Steve S5-Dec-03 0:57 
GeneralRe: Windows Sounds Pin
KaЯl5-Dec-03 1:32
KaЯl5-Dec-03 1:32 
GeneralRe: Windows Sounds Pin
Steve S5-Dec-03 2:38
Steve S5-Dec-03 2:38 
GeneralRe: Windows Sounds Pin
KaЯl5-Dec-03 2:52
KaЯl5-Dec-03 2:52 
Generalstupid socket question Pin
bryce3-Dec-03 16:03
bryce3-Dec-03 16:03 
GeneralRe: stupid socket question Pin
Shanmuga Sundar3-Dec-03 18:40
Shanmuga Sundar3-Dec-03 18:40 
GeneralRe: stupid socket question Pin
Johnny ²3-Dec-03 21:59
Johnny ²3-Dec-03 21:59 
GeneralRe: stupid socket question Pin
bryce4-Dec-03 12:31
bryce4-Dec-03 12:31 
GeneralRe: stupid socket question Pin
Jörgen Sigvardsson6-Dec-03 2:24
Jörgen Sigvardsson6-Dec-03 2:24 
GeneralRe: stupid socket question Pin
Anonymous4-Dec-03 1:06
Anonymous4-Dec-03 1:06 

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.