|
I create service with SERVICE_ALL_ACCESS, SERVICE_WIN32_OWN_PROCESS and SERVICE_INTERACTIVE_PROCESS
|
|
|
|
|
Did you try my first suggestion of changing the Service to run as a specific user account ?
Darka [ Xanya]
"I am not a slave to a god that doesn't exist."
|
|
|
|
|
Ok, if the service run in other user account it work. But it is necessary to start service from LocalSystem account.
|
|
|
|
|
Then you need to impersonate another user, see the LogonUser() and ImpersonateLoggedOnUser() functions.
Darka [ Xanya]
"I am not a slave to a god that doesn't exist."
|
|
|
|
|
I am sorry. And it is impossible little bit more in detail? I all time developed programs on a low level. Simply we had a situation, that more anybody is not present at the moment, and to make it is necessary urgently.
|
|
|
|
|
Try something like this:
<code>TCHAR szDomain[] = 'DomainName';
TCHAR szUserName[] = 'Username';
TCHAR szPassword[] = 'Password';
HANDLE hUser = NULL;
BOOL bLoggedOn = LogonUser(szUserName, szDomain, szPassword, LOGON32_LOGON_NEW_CREDENTIALS, LOGON32_PROVIDER_WINNT50, &hUser);
if(!bLoggedOn)
{
DWORD dwErr = GetLastError();
return;
}
if(!ImpersonateLoggedOnUser(hUser))
{
DWORD dwErr = GetLastError();
return;
}
CoInitialize(0);
SHDocVw::IShellWindowsPtr spSHWinds;
HRESULT hr = spSHWinds.CreateInstance (__uuidof(SHDocVw::ShellWindows));
RevertToSelf();
Darka [ Xanya]
"I am not a slave to a god that doesn't exist."
|
|
|
|
|
|
IElementBehaviorFactory* pEBFactory = NULL;
//Create my com object of implementing IElementBehaviorFactory interface
CoCreateInstance(CLSID_Factory, NULL, CLSCTX_INPROC_SERVER,IID_IElementBehaviorFactory, (void**)&pEBFactory);
//Mashal IElementBehaviorFactory
hr = CoMarshalInterThreadInterfaceInStream(IID_IElementBehaviorFactory, pEBFactory, &pStm);
The return value hr is 0x80004002, why?
|
|
|
|
|
0x80004002 has the symbolic name E_NOINTERFACE .
IID_IElementBehaviorFactory : {3050F429-98B5-11CF-BB82-00AA00BDCE0B}
On the face of it the return value of E_NOINTERFACE seems not to make any sense. If the search of the IID in the registry however there is no proxy/stub registered; I'd guess that's the reason.
Steve
|
|
|
|
|
The default value of [HKEY_CLASSES_ROOT/Interface/{3050F429-98B5-11CF-BB82-00AA00BDCE0B}/ProxyStubClsid32] is {B8DA6310-E19B-11D0-933C-00A0C90DCAA9}.
{B8DA6310-E19B-11D0-933C-00A0C90DCAA9} is the class id of actxprxy.dll.
I think that actxprxy.dll is the proxy/stub for IElementBehaviorFactory, but I don't know why CoMarshalInterThreadInterfaceInStream call fail for IElementBehaviorFactory.
|
|
|
|
|
jinhaibo wrote: The default value of [HKEY_CLASSES_ROOT/Interface/{3050F429-98B5-11CF-BB82-00AA00BDCE0B}/ProxyStubClsid32] is {B8DA6310-E19B-11D0-933C-00A0C90DCAA9}.
My system doesn't have this key. Yours does?
Steve
|
|
|
|
|
|
The environment is Visual Studio 2005 and my project was created via extensibility -> shared add-in.
How can I debug efficiently?
At present, I have to SETUP the add-in and start outlook manually each time I want to see the differences I have made to the program ...
|
|
|
|
|
A poor man's hack would be to insert __asm int 3 somewhere in the code. That will trigger windows into invoking a debugger. You will get a dialog asking you what to do: debug or quit. Choose debug, and use the running instance of VS.NET to debug. It's not pretty, but it works.
As for starting and quiting outlook: you'll have to learn to live with it. Outlook will lock your add-in dll while it's loaded, making it impossible to link the dll while it's running.
--
Not Y3K Compliant
|
|
|
|
|
Using DebugBreak is the slightly more portable version. It does mean that the debugger stops inside the DebugBreak function rather than in the calling function, so you need to do a Step Out when the debugger stops.
|
|
|
|
|
I am trying to use the settings.designer.cs file for a value that needs to be put into the app.config file.
My config(auto-generated by VS2005) file now looks like this:-
<configuration>
<configSections>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="Settings1" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</sectionGroup>
</configSections>
<applicationSettings>
<General.Settings1>
<setting name="DatabasePath" serializeAs="String">
<value>C:\Web\App_Data\Messages.mdb;</value>
</setting>
</General.Settings1>
</applicationSettings>
</configuration>
In the C# code i am trying to access this property by this code:
Settings1 set = Settings1.Default;
string str = set.DatabasePath;
return str;
The above line of code returns null.can anyone explain what am i missing here?
|
|
|
|
|
hi Shilpa,
how to access a COM component developed in vc++6.0 from ASP.net?
what r the issues need to be considered in this case??
Thanks in advance.
Prashanth.v
|
|
|
|
|
hi experts,
I'm quite new to the topic of COM and Automation and I have a few basic problems and questions:
I modified my existing MFC application to a multithreaded Automation server with the help of a tutorial i found on http://www.codeproject.com/com/mfc_autom.asp and made it via coinitializeex running as multithreaded, the application is a .exe
and lateron call COleTemplateServer::RegisterAll(),
but when I try to get an active instance via hr=GetActiveObject(clsid) I get as result: 0x800401e3 operation unavailable
and if i try to create a new instance via
hr=::CoCreateInstance(clsid, NULL, CLSCTX_LOCAL_SERVER, IID_IApplication1, (void**)&m_IApplication))
it returns the active instance instead of creating a new one
I also use another project with automation and there getactiveobject and cocreateinstance works fine
I think as COleTemplateServer::RegisterAll() returns TRUE it should correctly register my objects with the ROT (which if not, could be the reason for getactiveobject returning an error) or am I wrong?
So has anyone an idea how I become it working to getactiveobject() returning the active object and cocreateinstance() creating a new one
with best regards Stefan Buchner
|
|
|
|
|
Hi guys,
This activex control has optionals parameters for GetData method:
this.axWinsock1.GetData(ref object data,object type,object maxlen)
i tried these:
object rec= string.Empty;
object type = 0;
object maxlen = 0;
this.winsock.GetData(ref rec, type, maxlen);
or
object rec= string.Empty;
object type = string.Empty;
object maxlen = string.Empty;
this.winsock.GetData(ref rec, type, maxlen);
but all i get is "Unsupported variant types" error message, do you know how to call this getdata method in c#? i know if you call it in vb.net you dont need to pas optional parameteres.
Please help
|
|
|
|
|
Don't use this control in C#. Instead, use the System.Net.Sockets.Socket class, or the TcpClient , UdpClient , TcpListener classes which are a little more friendly to use.
The data you get from the socket will be in raw bytes. You will need to use one of the System.Text.Encoding classes to turn text from the byte-oriented wire format into a string . As a starting point, try Encoding.Default .
|
|
|
|
|
ActiveDocument gives error whenever i open any existing document..
CType(applicationObject, Word.Application).CustomizationContext = CType(applicationObject, Word.Application).ActiveDocument
CType(applicationObject, Word.Application).ActiveDocument.Saved = True
"You can do any thing you set to your mind" - theGhost_k8
|
|
|
|
|
oh !! i missed out the important part..
well this works fine when i go:- start-> run-> winword
it works fine when i go with debuging..
but if i run existing document by double clicking... it gives error .. specifying activeDocument not exist..
"You can do any thing you set to your mind" - theGhost_k8
|
|
|
|
|
Hai,
I am Installing an application after building .But at the time of Installation ,i got following error ,
Error 1309.Error Reading from file:
C:\Windows\Downloaded Installations\
{FD9A9617-3D4A-4B1A-BA58-D87368B26335}\prograam files\SaleMask\...\nanaDisp.exe.
Verify that the file exists and that you can access it.
Any one please help me to recognize the problem and solving the same.
Thanks in advance
Jeeva
|
|
|
|
|
Jeeva Mary Varghese wrote: Verify that the file exists and that you can access it.
As error says, verify it.
|
|
|
|
|
Prasad,
Yes the files are existing and they are not in read Only.
Jeeva
|
|
|
|