|
Not sure if you still need help with this... being that I am 12 hours late.
Here is how I would do it using toolhelp32
PROCESSENTRY32 pe32 = {0};<br />
pe32.dwSize = sizeof(PROCESSENTRY32);<br />
DWORD dwMYPID=GetCurrentProcessId();<br />
DWORD PID_parent =0;<br />
HANDLE hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0);<br />
if (Process32First(hSnapshot, &pe32))<br />
{<br />
while (Process32Next(hSnapshot, &pe32))<br />
{<br />
if(pe32.th32ProcessID==dwMYPID)<br />
{<br />
PID_parent=pe32.th32ParentProcessID;<br />
}<br />
}<br />
}
At this point PID_parent contains the PID of the parent process.
You could get the filename of the parent process in another loop by doing something like:
GetFileNameFromPath(pe32.szExeFile);
Best Regards,
-Randor (Dave)
|
|
|
|
|
Thanks for the help..It helped..
Suraj Gupta
|
|
|
|
|
hi all,
i want to give the facility for my users to undo redo multiple times
in a cricheditctrl.
when user opens some project and starts editing the files and if saves the changes then also he should be able to undo the changes untill when he opened the project.
is there any any sample code for multilevel undo redo??
and how much big this task is??
and what will be the right strategy to tackle this problem??
please help me
thanks and regards
Harshal
|
|
|
|
|
Where do i look for webbrowser control to add it to my application?
Thanks in Advance
Z.A
|
|
|
|
|
zubair_ahmed wrote: i look for webbrowser contro
See here.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
To add Microsoft Web Browser Control
If u want to place the Microsoft Web Browser control in a dialog right click and select insert activex control then select Microsoft Web Browser
or you can add it by selecting the menu Project->Add To Project->Components and controls
Rinu Raj
|
|
|
|
|
See here[^] maybe it is some helpful to you
|
|
|
|
|
is someone how can help me with an example on how to implement DoBulkFieldExchange ? (in my class CRecordset) ?
Bravoone
|
|
|
|
|
See here[^] maybe it is some helpful to you
|
|
|
|
|
I need an example on how to fetching records in bulk !?
Bravoone
|
|
|
|
|
how to fetch records in bulk ? This example not help me mutch please help me!
Bravoone
|
|
|
|
|
stop badger WhiteSky and ask a specific question instead. tell what's your problem, where you can't do things.
people here won't do the job for you ; they'll only give you hints.
|
|
|
|
|
how to fetch records in bulk ?
ok?!!!!!!!!!!!!!!!!!!!!!!!??????
Bravoone
|
|
|
|
|
know what ?
shoot yourself in the ass...
|
|
|
|
|
Hi,i am trying to sent structures through SOCKETS,but the information is not reaching the server. I need source code to sent structures and delimit at server side
|
|
|
|
|
Hope you would be sending commands in those structures.
you can do like this.
send this to client.
struct SomeData
{
int command;
int param1[100];
int param2[100];
}
on client side read the sizeof(int) to get the command type the structure contains.
once you know the command , you should read the 100 bytes for first param and then 100 for another param.
This way your structure will be transmitted across wire.
Hope this helps.
Z.A
|
|
|
|
|
Thankq Mr. zubair_ahmed,
But i want 2 give clear idea abt the problem which i got.
This is the data which i want 2 send:
struct data
{
int id;
CString str1;
CString str2;
}pt;
UpdateData();
CString str;
pt.str1=m_ID;
pt.str2=m_Name;
pt.id="A";
str.Format ("%d#%s#%s",pt);
send(clientsock,str,str.GetLength(),0);
Here Iam sending structure data tru string but.. is there any way to send data by structure address??
and How to get back the data at server side
...Thanks swamy
|
|
|
|
|
You can send structures that don't contain any pointers or structs/classes that contain pointers. A CString has a pointer to the actual string data, so you can't send the struct in your example code code directly over a socket.
|
|
|
|
|
Hello Narasimha,
swamy Narasimha wrote: is there any way to send data by structure address?
I think u have both client server on same PC. And u want to do Inter Process communication via socket.
Isn't it?
regards,
Divyang Mithaiwala
System Engineer & Software Engineer
|
|
|
|
|
hi Divyang Mithaiwala,
Iam sending data from one sys to another sys (two seperate systems) with IP and port.
|
|
|
|
|
Hello swamy Narasimha,
For that u have to type cast ur struct pointer to char pointer.
But it is quit risky.
Becoz as u know that differeint platform use different size for int datatype.
And also change possion for date in struct to optimize best space.
In both of this case ur data at other end is useless.
And that's why some COM component provide fisrt field as sizeofstruct.
To conform that both end use same style for data arrangment.
regards,
Divyang Mithaiwala
System Engineer & Software Engineer
|
|
|
|
|
Ca nyou post the code for the transmit receive that you have already ? I never worked with socket before but I suppose it works like any other 'communication' media. So for example if you are trying to pass the address of your structure, it will only transmit the address and not the content.
Can you post your code to clarify the situation ?
|
|
|
|
|
I want to add some specific files and folder to the list control in my application. And also at run time am creating folder how can i add this also?
Then how this tree or list control works as Explorer?
|
|
|
|
|
Hi
Use FindFirst and FindNext to explorer directory and files
More help about FindFirst/FindNext is on MSDN
regards
KK
|
|
|
|
|
I am asking first how can i add files and folders?
|
|
|
|