|
I use pipes with CreateProcess(), but my code works well on win98 and doesn't work on XP.
only special code for XP in my app looks like:
=========================
void*psd=0;
LPSECURITY_ATTRIBUTES psa=0;
DWORD bNT=(GetVersion()<0x80000000)?1 ;
if(bNT)
{
psd=::GlobalAlloc(GPTR,SECURITY_DESCRIPTOR_MIN_LENGTH);
::InitializeSecurityDescriptor(psd,SECURITY_DESCRIPTOR_REVISION);
::SetSecurityDescriptorDacl(psd,-1,0,0);
psa=(LPSECURITY_ATTRIBUTES)::GlobalAlloc(GPTR,sizeof(SECURITY_ATTRIBUTES));
psa->nLength=sizeof(SECURITY_ATTRIBUTES);
psa->lpSecurityDescriptor=psd;
psa->bInheritHandle=1;
}
const BOOL bOK=CreateProcess(0,pszCmdLine,psa,0,1,0,0,0,&si,&pi);
//======================================
do i need more special code for XP?
thx
includeh10
|
|
|
|
|
includeh10 wrote:
doesn't work on XP.
Define "doesn't work." Are you getting a compiler/linker error, a runtime error, a fired assertion, or a thrown exception?
includeh10 wrote:
void*psd=0;
Shouldn't this be:
PSECURITY_DESCRIPTOR psd = 0; includeh10 wrote:
::SetSecurityDescriptorDacl(psd,-1,0,0);
I'm not sure of the behavior of this function when bDaclPresent is neither 0 nor 1.
includeh10 wrote:
const BOOL bOK=CreateProcess(0,pszCmdLine,psa,0,1,0,0,0,&si,&pi);
What happens if you call this function with lpProcessAttributes set to NULL ?
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
"doesn't work" means that messages do not exchange between pipes at all, the dos app respones for command in CreateProcess(), after that, communication stops.
i will test ur suggestion.
includeh10
|
|
|
|
|
DavidCrow wrote:
What happens if you call this function with lpProcessAttributes set to NULL?
lpProcessAttributes!=0 is commented by docs, which say it is special for NT.
if lpProcessAttributes=NULL, it is the same (works on Win98 but not on XP).
I had many apps which use code above and work well on all platform - but they are Windows apps, not DOS one.
i can not find reason why the code has trouble on DOS app.
by the way, PSECURITY_DESCRIPTOR is just void*, some people define many sick definitions.
thx
includeh10
|
|
|
|
|
includeh10 wrote:
lpProcessAttributes!=0 is commented by docs, which say it is special for NT.
I see it saying that the handle cannot be inherited and the process gets a default security descriptor. In any case, ...
includeh10 wrote:
if lpProcessAttributes=NULL, it is the same (works on Win98 but not on XP).
Which should indicate to you that the following code has no bearing on the problem:
DWORD bNT=(GetVersion()<0x80000000)?1:0;
if(bNT)
{
psd=::GlobalAlloc(GPTR,SECURITY_DESCRIPTOR_MIN_LENGTH);
::InitializeSecurityDescriptor(psd,SECURITY_DESCRIPTOR_REVISION);
::SetSecurityDescriptorDacl(psd,-1,0,0);
psa=(LPSECURITY_ATTRIBUTES)::GlobalAlloc(GPTR,sizeof(SECURITY_ATTRIBUTES));
psa->nLength=sizeof(SECURITY_ATTRIBUTES);
psa->lpSecurityDescriptor=psd;
psa->bInheritHandle=1;
} Remove this and the problem becomes more refined. By removing unnecessary code, you'll eventually get down to just the few lines that are necessary to demonstrate the problem.
includeh10 wrote:
by the way, PSECURITY_DESCRIPTOR is just void*,
Fair enough, but it would make more sense to others if PSECURITY_DESCRIPTOR were used. There's also the (small) possibility that it may change from void* in the future.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Hello!
I need to interface my VC++ application with Outlook Express 6.0.
I'd need:
- access to email messages in Outlook folders,
- eventually, copy email messages in other files (with EML format and other
place);
- make email messages and send them with Outlook Express (Outbok).
I found a very useful sample on codeproject.com (made by Pablo Yabo), about using IStoreFolder and IStoreNamespace to manage Outlook Exp folders.
But ... what about outgoing emails? The sample can just make a "streamed" file, that's not sent by Outlook Express.
Do I need to use IMimeMessage interface?
Is there any sample that show the use of IMimeMessage interface?
Thank you in advance!
Chiara
|
|
|
|
|
|
|
|
|
Great!!!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
I use the RTC Client API v1.3 SDK
Configurations & Setup:
=======================
- OS = Windows XP, Windows 2000, 32-bit environments
- Build = Build all the files in Platform SDK Environment by
running nmake
How to use nmake?
|
|
|
|
|
Start by reading MSDN[^].
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it! Honoured as one of The Most Helpful Members of 2004
|
|
|
|
|
I make an dexit dialog but when i press ok it only close the exit dialog but it dosen't close the aplication what i make wrong.Thanks for helping me.
void CPractica6Dlg::OnClose()
{
if(MessageBox("Exit?","Bye",MB_YESNO)==IDYES)
CDialog::OnClose();
}
|
|
|
|
|
I reply myselft if any one has this problem may be can solve by this way
void CPractica6Dlg::OnClose()<br />
{<br />
if(MessageBox("¿Quieres salir de la aplicacion?","Bye",MB_YESNO)==IDYES)<br />
CPractica6Dlg::EndDialog(IDYES);<br />
<br />
}<br />
|
|
|
|
|
|
I wan to make a simple calculator with 3 edit box 2 of them to insert the values and the other for the result. Mi problem is that when i insert the numbers and make the operation the storage the values and in the next operation i can't change it.This is what i wrote.Thanks for your help.
void CPractica6Dlg::OnMultiply()
{
UpdateData(TRUE);
m_result=m_numA*m_numB;
}
void CPractica6Dlg::OnCalculate()
{
UpdateData(FALSE);
}
|
|
|
|
|
My suggestion would be to nix the calls to UpdateData() . Then create three CEdit member variables, one for each edit control. Now in the OnMultiply() method:
void CPractica6Dlg::OnMultiply()
{
CString strA,
strB,
strC;
m_editA.GetWindowText(strA);
m_editB.GetWindowText(strB);
strC.Format("%d", atoi(strA) * atoi(strB));
m_editC.SetWindowText(strC);
}
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Will it work?
void CPractica6Dlg::OnMultiply()
{
UpdateData(TRUE);
m_result=m_numA*m_numB;
UpdateData(FALSE);
}
http://www.priyank.in/
|
|
|
|
|
No it doesn't work i have the same problem.
|
|
|
|
|
|
I dont know what you mean?
Sorry i'm a little bit new with visual c++.
is this what are you talking about?
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CPractica6Dlg)
DDX_Text(pDX, IDC_NUMA, m_numA);
DDX_Text(pDX, IDC_NUMB, m_numB);
DDX_Text(pDX, IDC_RESUL, m_result);
//}}AFX_DATA_MAP
|
|
|
|
|
Situation out of control. Cease Fire!. But check the values of m_numA, m_numB & m_result by displaying in a message box jsut before the multiplication and just after the multiplication.
http://www.priyank.in/
|
|
|
|
|
Values
m_a=1
m_b=2
pick radiobuton +
pick solution
m_result=3
then I change values
m_a=3
m_b=4
radiobuton + activated
pick solution
m_result=3 and m_a and m_b changed to
m_a=1
m_b=2
but if i do this it works
m_a=3
m_b=4
radiobuton + activated but i pick it another time
pick solution
m_result=7
|
|
|
|
|