|
I all, i am becoming mad for this problem!
i am using ShellExecuteEx to launch an external program.
When i pass parameters these must be separed with spaces, then
if i pass the parameters "pippo.txt pluto.ppp", my program work fine,
but if pass "c:\Documents and Settings\.....pippo.txt pluto.ppp", then
the word "and" is used by ShellExecuteEx as parameter,
then how can i quote the spaces???
The voice is inside us
|
|
|
|
|
use \" to put a quote in string
CString str = "\"test.exe\" test.doc"
Live as if your were to die tomorrow. Learn as if you were to live forever.
-Mahatma Gandhi
|
|
|
|
|
i have done it but don't work!!!
Leto
|
|
|
|
|
Placing space in the parameter traditionally is considered as end of the parameter, So i guess you need to apply some logic to avoid space where needed and where not. like passing "Program files" as "program_files" and then remove the _ in the program to whome you are passing the paramter.
My God is more powerfull Than Your God. (the line that divides the world)
|
|
|
|
|
you'll probably need to enclose your full filepath in enclosing quotes. e.g:
<br />
CString strFilepath = "\"c:\\program files\\this file.txt\"";
I Dream of Absolute Zero
|
|
|
|
|
NOW IT WORK,,, thank you very much!!!!!
|
|
|
|
|
Hi Guys,
I am getting a very strange error when every I pass the CStringArray to the function.
the error is "cannot convert parameter 4 from 'class CStringArray' to 'class CStringArray'"
Any idea.
Thanks,
Best Coder
|
|
|
|
|
Pass your array by reference, instead of by value.
Something like:
void SomeFunction(CStringArray& arrParamArray);
I Dream of Absolute Zero
|
|
|
|
|
I successfully Solved the problem.
Thanks a Lot.
"And they do not show off their charm (Zeena) except only that which is apparent and let them draw their head coverings (khumur) over their necks and bosoms (juyub)"
|
|
|
|
|
Is there a way to get a function name in a macro? Something similar to __FILE__.
Basically I use the class name and function name in debug statements through-out my code and I want a way to automate the insertion of these values. Ideally I want the values at compile time.
Thanks
Mike
|
|
|
|
|
Functor or pointer to function?
Not sure if this is the thing you want.
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
What I want is the function name as a string. What I currently use is
DB((_T("ClassName::MethodName Some message")));
What I want to be able to do is get the "ClassName::MethodName" bit without having to type it in each time.
|
|
|
|
|
Hi,
I am trying to change the configuration of the service SQLSERVER AGENT using the API ChangeServiceConfig. In that I am passing a new user name and password as arguments. That API returns successfully and I can change the StartType (AUTOMATIC,DEMAND_START etc) as well. But after that when I try to start the service using the API StartService, it returns the error:"The user doesn't have the permission to log on as a service".
Why is this so? How can I change the configuration successfully through the program? Is ChangeServiceConfig is not the API for this?
When I manually set the User name and password using the properties dialog of that particular service a message appears that this particular user "has been given the right to Log on as a Service" (that is when I click the Apply button on that dialog).After that it is possible to start and stop the service through program. But for the first time it fails. So how can I achieve the functionality which the Apply button (of the properties dialog, provided by windows) is doing??
Plz help,
thnx in advance,
AK.
***
|
|
|
|
|
Look at the PSS article 132958, entitled "HOWTO: Manage User Privileges Programmatically in Windows NT".
Essentially, it's a step-by-step guide to using the LSA (Local Storage Authority) subsystem, from LsaOpenPolicy(), LsaAddAccountRights() etc
In fact, it's exactly what you want, I suspect;
"This sample will grant the privilege SeServiceLogonRight to the account specified on argv[1]. "
Steve S
|
|
|
|
|
Yes, you are absolutely right.
I implemented it successfully.
thnx...
AK.
*******
|
|
|
|
|
As you said I implemented it and its working fine with WindowsNT, Windows2000 os. But it fails in WindowsXP. Again the same error: "Logon as Service right not given".
How to rectify it??
thnx...
AK.
********
|
|
|
|
|
Hi,
I was wrote a service, I want write an application to communicate with this service, I use Socket mechanism but when I start service it generate error.
Have you resolve for this problem?
Please help me.
Thank you .
L.H.Dung
|
|
|
|
|
What errors do you get?
Can your service start without the socket start listening?
Your question is ambiguous.
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
Anthony_Yio wrote:
Your question is ambiguous.
I wish there was a warning box or something that states that before posting only "I get an error" you should fully explain the error or no one will be able to help. I see this question every day on the forums...
John
|
|
|
|
|
What error? Is it a socket error? Or does the service not start? Did you call GetLastError to get the error code?
John
|
|
|
|
|
I have buld a static library and also a test program to check out the library.
However when I try and build my test program I get the warning:
: defaultlib 'LIBCD' conflicts with use of other libs; use /NODEFAULTLIB:library
I have place the line: /NODEFAULTLIB:WAPI_AIM.lib in the Ignore Specific Library option of the Linker properties, but still get the warning. Note WAPI_AIM.LIB is my libray.
I would like to clear this warning.
Any suggestions?
|
|
|
|
|
Use __AFXWIN_H__ instead of _AFXDLL to determine MFC presence.
its nested in
#ifdef _AFXDLL
#endif
(found somewhere)
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
Cant find any reference to _AFXDLL;
only this code below:
#ifndef __AFXWIN_H__
#error include 'stdafx.h' before including this file for PCH
#endif
|
|
|
|
|
Do you have a mixture of static and dll based MFC?
This could lead to the symtoms you are describing.
Who is 'General Failure'? And why is he reading my harddisk?!?
|
|
|
|
|
Yes. I have developed a static library on top of a 3rd party API, which uses DLLs.
The reason for the static library is to remove the single source dependance on a single supplier.
Is this the problem and can it be resolved?
|
|
|
|