Click here to Skip to main content
15,906,467 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralHelp with CExpire Pin
Juan Carlos Cobas29-Jul-03 12:28
Juan Carlos Cobas29-Jul-03 12:28 
GeneralRe: Help with CExpire Pin
pranavamhari29-Jul-03 18:04
pranavamhari29-Jul-03 18:04 
GeneralRe: Help with CExpire Pin
Toni7829-Jul-03 18:14
Toni7829-Jul-03 18:14 
GeneralRe: Help with CExpire Pin
Juan Carlos Cobas30-Jul-03 3:04
Juan Carlos Cobas30-Jul-03 3:04 
GeneralRe: Help with CExpire Pin
pranavamhari30-Jul-03 6:11
pranavamhari30-Jul-03 6:11 
Questionhow to create a sub DC in a DC? Pin
CaesarCZ29-Jul-03 12:17
CaesarCZ29-Jul-03 12:17 
AnswerRe: how to create a sub DC in a DC? Pin
Ravi Bhavnani29-Jul-03 12:30
professionalRavi Bhavnani29-Jul-03 12:30 
Generalfilling and passing SAFEARRAYS Pin
bigeyedfish8129-Jul-03 10:56
bigeyedfish8129-Jul-03 10:56 
I am trying to pass an empty variant array from VB, fill it (as a SAFEARRAY) in my c++ dll and then pass it back to VB. My overall goal is to populate the passed in array with a list of PID's of processes that are currently running in a job (JobName), and send it back. I am able to send and receive it, but when I receive it, I only have 1 PID in the returned array (even if I know I have two or three processes running in a job)

here is my code:

c++ DLL:

STDMETHODIMP CJob::ProcessesInJob(BSTR JobName, VARIANT* arrPID)
{


USES_CONVERSION;

SAFEARRAYBOUND abound[1];
SAFEARRAY *psa = NULL;
DWORD i;
HRESULT result;

HANDLE hOpenJob = OpenJobObject(JOB_OBJECT_ALL_ACCESS, FALSE, OLE2CT(JobName));
if (NULL == hOpenJob)
return 3;

//fill a structure with PID information for processes associated with the specified job;

JOBOBJECT_BASIC_PROCESS_ID_LIST jobinfoID = {0};
QueryInformationJobObject(hOpenJob, JobObjectBasicProcessIdList, &jobinfoID, sizeof(jobinfoID), NULL);

long *AEL;
abound[0].lLbound = 0;
abound[0].cElements = jobinfoID.NumberOfProcessIdsInList;

arrPID->vt = VT_ARRAY | VT_I4;

psa = V_ARRAY(arrPID);

//lock the data to access it
SafeArrayAccessData(psa, (void**)&AEL);
for(i=0; i
GeneralGet ChildFrame from CDocument (MDI app) Pin
Wim Jans29-Jul-03 10:41
Wim Jans29-Jul-03 10:41 
GeneralRe: Get ChildFrame from CDocument (MDI app) Pin
Neville Franks29-Jul-03 11:08
Neville Franks29-Jul-03 11:08 
GeneralRe: Get ChildFrame from CDocument (MDI app) Pin
Wim Jans29-Jul-03 11:28
Wim Jans29-Jul-03 11:28 
GeneralSpeeding Up ComboBox Entry Pin
vss11129-Jul-03 10:04
vss11129-Jul-03 10:04 
GeneralRe: Speeding Up ComboBox Entry Pin
John M. Drescher29-Jul-03 10:15
John M. Drescher29-Jul-03 10:15 
GeneralRe: Speeding Up ComboBox Entry Pin
Alexander M.,29-Jul-03 10:29
Alexander M.,29-Jul-03 10:29 
GeneralRe: Speeding Up ComboBox Entry Pin
Beer2629-Jul-03 10:34
Beer2629-Jul-03 10:34 
GeneralRe: Speeding Up ComboBox Entry Pin
armentage30-Jul-03 3:03
armentage30-Jul-03 3:03 
QuestionHow to save/delete files from within console program Pin
Anonymous29-Jul-03 8:58
Anonymous29-Jul-03 8:58 
AnswerRe: How to save/delete files from within console program Pin
David Crow29-Jul-03 9:24
David Crow29-Jul-03 9:24 
GeneralWeird linking Error Pin
Janayma29-Jul-03 8:48
Janayma29-Jul-03 8:48 
Generalseeing TRACE() ouputs Pin
Le centriste29-Jul-03 8:27
Le centriste29-Jul-03 8:27 
GeneralRe: seeing TRACE() ouputs Pin
David Crow29-Jul-03 8:36
David Crow29-Jul-03 8:36 
GeneralRe: seeing TRACE() ouputs Pin
Le centriste29-Jul-03 8:37
Le centriste29-Jul-03 8:37 
GeneralRe: seeing TRACE() ouputs Pin
David Crow29-Jul-03 8:42
David Crow29-Jul-03 8:42 
GeneralRe: seeing TRACE() ouputs Pin
Le centriste29-Jul-03 8:43
Le centriste29-Jul-03 8:43 
GeneralRe: seeing TRACE() ouputs Pin
Ryan Binns29-Jul-03 18:41
Ryan Binns29-Jul-03 18:41 

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.