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

C / C++ / MFC

 
GeneralRe: AppendChunk bombs Pin
Ravi Bhavnani8-Aug-02 3:00
professionalRavi Bhavnani8-Aug-02 3:00 
GeneralRe: AppendChunk bombs Pin
nss8-Aug-02 5:08
nss8-Aug-02 5:08 
GeneralRe: AppendChunk bombs Pin
Ravi Bhavnani8-Aug-02 5:43
professionalRavi Bhavnani8-Aug-02 5:43 
GeneralRe: AppendChunk bombs Pin
nss8-Aug-02 7:08
nss8-Aug-02 7:08 
GeneralRe: AppendChunk bombs Pin
Ravi Bhavnani8-Aug-02 11:43
professionalRavi Bhavnani8-Aug-02 11:43 
GeneralRe: AppendChunk bombs Pin
Joel Lucsy8-Aug-02 6:11
Joel Lucsy8-Aug-02 6:11 
GeneralRe: AppendChunk bombs Pin
nss8-Aug-02 7:18
nss8-Aug-02 7:18 
GeneralRe: AppendChunk bombs Pin
nss8-Aug-02 7:40
nss8-Aug-02 7:40 
I made some modifications (didnt use cString) and it never gets into the if to do the memcpy:

if(SafeArrayAccessData(psa,(void **)&pByte) == NOERROR)
memcpy((LPVOID)pByte,(LPVOID)pImage,size+1);
SafeArrayUnaccessData(psa);


The changes I made are:

size = fileSize;

char *pImage;

pImage = new char[size+1];

fread(pImage, size, 1, pFile);

fclose(pFile);

SAFEARRAY FAR* psa;
SAFEARRAYBOUND rgsabound[1];
rgsabound[0].lLbound = 0;
rgsabound[0].cElements = size * sizeof(TCHAR) + sizeof(TCHAR);

// create a single dimensional byte array
psa = SafeArrayCreate(VT_I1, 1, rgsabound);

// set the data of the array with data in the edit box
if(SafeArrayAccessData(psa,(void **)&pByte) == NOERROR)
memcpy((LPVOID)pByte,(LPVOID)pImage,size+1);
SafeArrayUnaccessData(psa);
        //delete pImage[];
varArray.vt = VT_ARRAY | VT_UI1;
varArray.parray = psa;


WHat can I do to get to the memcpy statement?
Thanks,
ns
GeneralRe: AppendChunk bombs Pin
Joel Lucsy8-Aug-02 12:54
Joel Lucsy8-Aug-02 12:54 
GeneralHmmmm Pin
nss8-Aug-02 14:22
nss8-Aug-02 14:22 
GeneralSimple parameter return question (strings) Pin
-Dy8-Aug-02 1:12
-Dy8-Aug-02 1:12 
GeneralRe: Simple parameter return question (strings) Pin
8-Aug-02 1:32
suss8-Aug-02 1:32 
GeneralRe: Simple parameter return question (strings) Pin
Tomasz Sowinski8-Aug-02 1:32
Tomasz Sowinski8-Aug-02 1:32 
GeneralRe: Simple parameter return question (strings) Pin
Rutger Ellen8-Aug-02 1:48
Rutger Ellen8-Aug-02 1:48 
GeneralHELP ME........... Pin
Anonymous8-Aug-02 0:30
Anonymous8-Aug-02 0:30 
GeneralRe: HELP ME........... Pin
Ravi Bhavnani8-Aug-02 3:14
professionalRavi Bhavnani8-Aug-02 3:14 
Generalquestion on recv() function Pin
zecodela8-Aug-02 0:30
zecodela8-Aug-02 0:30 
GeneralRe: question on recv() function Pin
markkuk8-Aug-02 0:45
markkuk8-Aug-02 0:45 
GeneralRe: question on recv() function Pin
zecodela8-Aug-02 15:53
zecodela8-Aug-02 15:53 
GeneralIrregular fatal error Pin
s_k7-Aug-02 23:42
s_k7-Aug-02 23:42 
GeneralRe: Irregular fatal error Pin
Tomasz Sowinski8-Aug-02 0:57
Tomasz Sowinski8-Aug-02 0:57 
GeneralRe: Irregular fatal error Pin
s_k8-Aug-02 23:34
s_k8-Aug-02 23:34 
Questionhow to get location like VB's "app path" Pin
nss7-Aug-02 23:22
nss7-Aug-02 23:22 

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.