|
I am about to write an application that synchronizes the outlook contacts with the shared contacts on the Exchange server. I easily connected to the outlook contacts (using interop.outlook).
now i am trying to connect to the server (using cdo) and get the shared contacts folder. okay I opend a session but how do I logon and get the contact folder later.
thanks
tim
|
|
|
|
|
I had inserted from InsertMenu->new ATL Object->Miscallenous->Dialog
Give it short name MyDialog.Then inserted Microsoft Web Browser(By Right clicking on dialog and choosing
insert ActiveX Control).Now my problem is how can i call www.yahoo.com
in the control and get Documentcomplete and events such as were user clicked.
Plz help Me
Thanks in advance
Devom
|
|
|
|
|
Since C# doesn't support ATL, you're in the wrong forum. I think your looking for the C++ Forum[^].
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi!
We created an application that runs stable without memory leaks under windows xp. now we run the same application under windows mobile or windows ce.net wit memory leaks.
is their any way to check memory leaks while the application is running on a pocket pc?
regards, zuschauer!
|
|
|
|
|
Hello Corinna
Add a streamWriter.Flush after the streamWriter.Write .
String myObject = "my text";
MemoryStream memoryStream = new MemoryStream();
XmlSerializer serializer = new XmlSerializer( myObject.GetType() );
serializer.Serialize(memoryStream, myObject);
memoryStream.Seek(0, SeekOrigin.Begin);
StreamReader streamReader = new StreamReader(memoryStream, Encoding.UTF8);
string xml = streamReader.ReadToEnd();
StreamWriter streamWriter = new StreamWriter(new MemoryStream());
streamWriter.Write( xml );
<big>streamWriter.Flush();</big>
streamWriter.BaseStream.Seek(0, SeekOrigin.Begin);
serializer = new XmlSerializer( typeof(String) );
Object content = serializer.Deserialize(streamWriter.BaseStream);
string str = (string)content;
Console.WriteLine(str);
Regards,
Nish
|
|
|
|
|
I have developed the web service and secured it using the WSE 2.0.
Problem is client of this web service is in Delphi 6.0.
What should i do to call this web service from the Delphi client.
Thanks in advance.
|
|
|
|
|
Hello
In a windows form i have some TextBox that are binding to my Dataset. In one of my TextBox , i fill data on it, but when i go to the another TextBox ,the last data lose from previous.
How can i do !?
|
|
|
|
|
Hello
In windows forms i have some TextBox that are binding to my Dataset.I want to get the current row to set my DataRow for delete the current row.How i can do it ?
|
|
|
|
|
Hi all,
I'm trying to respond to the letter 'a' being pressed . But some how when i ran the form, this KeyPress function was not activated at all. Is there something else I need to do ? I have
this.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.frmMain_KeyPress);<br />
inserted automatically already.
Please help. Does this mean that the form is no focus??? I already clicked on the form and tried typing 'a' but no messagebox shown or was did debug mode enter the source code.
private void frmMain_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)<br />
{<br />
switch ( e.KeyChar)<br />
{<br />
case 'a': <br />
MessageBox.Show("a");<br />
break;<br />
}<br />
}
|
|
|
|
|
Normally a form automatically receives all keyboard events, if it has no visible or enabled controls. But if it has controls, I think the focus is never on the form itself but always on a contained control.
Try setting the KeyPreview property of your form to true, so your form receives key events before the event is passed to the control that has focus.
www.troschuetz.de
|
|
|
|
|
Hi
I am having small problem in WMI related question.
The folowing function will accept username,password and process executable path as input parameter, and it will launch a new process in the host.and finally I will fetch Process ID and process name.
This code is working fine for the current user, that means passing username and password as null.
My requrement is I wand to run a process for a different user( with username and password)
Can any one guide me in this rehgard?
void LaunchProcess(string filename,string username,string password)
{
bool currentUser = false;
string processName = "";
uint processID = 0;
if( (username != null)&& (password != null))
currentUser = true; // LaunchProcess got username and Password.
ConnectionOptions objConnectionOptions = new ConnectionOptions();
if(currentUser ==true)
{
objConnectionOptions.Username = username;
objConnectionOptions.Password = password;
}
ManagementScope objManagementScope = new ManagementScope("root\\cimv2", objConnectionOptions);
objManagementScope.Connect();
ManagementClass processClass = new ManagementClass("Win32_Process");
processClass.Scope = objManagementScope;
//Get an input parameters object for this method
ManagementBaseObject inParams = processClass.GetMethodParameters("Create");
//Fill in input parameter values
inParams["CommandLine"] = filename;
// this will execute the command.
ManagementBaseObject outParams = processClass.InvokeMethod("Create",inParams, null);
// Wait for 1 Second to start the Process
System.Threading.Thread.Sleep(1000);
// Get the Unique Process ID after Process Creation
processID = (uint)outParams["processId"];
//Query based on the received processID and get the Process Name .
ObjectQuery objObjectQuery = new ObjectQuery("Select name from Win32_Process Where ProcessID = '" + processID + "'");
ManagementObjectSearcher objMagObjSearcher = new ManagementObjectSearcher( objManagementScope, objObjectQuery );
ManagementObjectCollection objMagObjCollection = objMagObjSearcher.Get();
foreach( ManagementObject objManagementObject in objMagObjCollection )
{
if(objManagementObject["name"] != null)
processName = objManagementObject["name"].ToString();
} // foreach
}
}
|
|
|
|
|
IIRC, the WMI Win32_Process class doesn't support RunAs.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks
Then Can you tell me how to achive to launch a process with different username /password.
Regards
|
|
|
|
|
On a remote machine? You can't. It's a HUGE security violation. You can, however, have a process on that machine launch the application for you under a different account. You might want to check into PSTools[^] from SysInternals.
Be warned though... Virus scanners are tagging PSEXEC as a suspect program and throwing up virus warnings about it. This goes for any other known application that allows a remote machine to launch a program locally.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi Dave Kreskowiak
This process launch is not in remote machine,for local machine only.
My requirement is I wand to launch a new process in the local machine with different username/ password
(Not the one user currently logged in)
Regards
|
|
|
|
|
If you want to launch a process as a different user, then you have several options, all of which involve P/Invoking various Win32 API functions. I would suggest you start by reading CreateProcessAsUser[^] on MSDN and compar your requirements with the options listed.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks a Lot for your information.
|
|
|
|
|
Is there some utility that can compile my project by just using .sln file? So, something small that can compile whole solutions by just using csc.exe along is what I'm looking for...
Am I asking too much?
Thanks for any comment or link to helpful web page...
|
|
|
|
|
http://nant.sourceforge.net/[^] is a command line tool, but it will do what your are looking for.
I can imagine the sinking feeling one would have after ordering my book,
only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon
|
|
|
|
|
I used the 'Handle' property of Form class to pass the window handle of my form to a winapi function, namely, 'WTOpen' used for opening a tablet context (present in wintab32.dll). This function returns a handle to the opened context. The problem is that this function is not opening a context (returning 0). I have imported the unmanaged function in the following way:
[DllImport("wintab32.dll")] public static extern HCTX WTOpen(IntPtr hWnd, ref LOGCONTEXT lpLogCtx, bool fEnable);
where HCTX is of type IntPtr.
The function prototype is as follows:
HCTX WTOpen(hWnd, lpLogCtx, fEnable)
where hWnd -- HWND Identifies the window that owns the tablet context, and receives messages from the context.
lpLogCtx -- LPLOGCONTEXT Points to an application-provided LOGCONTEXT data structure describing the context to be opened.
fEnable -- BOOL Specifies whether the new context will immediately begin processing input data.
It will be highly appreciated if someone could point out where i've made a mistake.... Thanku.
Nadir Khan
|
|
|
|
|
First, I think your import should look more like this:
[DllImport("wintab32.dll")] public static extern IntPtr WTOpen( IntPtr hWnd, ref LOGCONTEXT lpLogCtx, bool fEnable );
Second, there could very well be a problem with your structure definition, LOGCONTEXT. We'll need to see your code for that.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thank you for showing concern. I would really appreciate it if you could finally solve my problem.
I have defined the LOGCONTEXT structure as follows:
[ StructLayout( LayoutKind.Sequential, CharSet = CharSet.Auto )]
public struct LOGCONTEXT
{
[ MarshalAs( UnmanagedType.ByValTStr, SizeConst = 40 )]
public string lcName;
public uint lcOptions;
public uint lcStatus;
public uint lcLocks;
public uint lcMsgBase;
public uint lcDevice;
public uint lcPktRate;
public uint lcPktData;
public uint lcPktMode;
public uint lcMoveMask;
public uint lcBtnDnMask;
public uint lcBtnUpMask;
public int lcInOrgX;
public int lcInOrgY;
public int lcInOrgZ;
public int lcInExtX;
public int lcInExtY;
public int lcInExtZ;
public int lcOutOrgX;
public int lcOutOrgY;
public int lcOutOrgZ;
public int lcOutExtX;
public int lcOutExtY;
public int lcOutExtZ;
public uint lcSensX;
public uint lcSensY;
public uint lcSensZ;
public int lcSysMode;
public int lcSysOrgX;
public int lcSysOrgY;
public int lcSysExtX;
public int lcSysExtY;
public uint lcSysSensX;
public uint lcSysSensY;
}
Its actual form is as follows:
#define LC_NAMELEN 40
typedef struct tagLOGCONTEXT {
TCHAR lcName[LC_NAMELEN];
UINT lcOptions;
UINT lcStatus;
UINT lcLocks;
UINT lcMsgBase;
UINT lcDevice;
UINT lcPktRate;
WTPKT lcPktData;
WTPKT lcPktMode;
WTPKT lcMoveMask;
DWORD lcBtnDnMask;
DWORD lcBtnUpMask;
LONG lcInOrgX;
LONG lcInOrgY;
LONG lcInOrgZ;
LONG lcInExtX;
LONG lcInExtY;
LONG lcInExtZ;
LONG lcOutOrgX;
LONG lcOutOrgY;
LONG lcOutOrgZ;
LONG lcOutExtX;
LONG lcOutExtY;
LONG lcOutExtZ;
FIX32 lcSensX;
FIX32 lcSensY;
FIX32 lcSensZ;
BOOL lcSysMode;
int lcSysOrgX;
int lcSysOrgY;
int lcSysExtX;
int lcSysExtY;
FIX32 lcSysSensX;
FIX32 lcSysSensY;
} LOGCONTEXT;
There is another function;
UINT WTInfo(wCategory, nIndex, lpOutput)
wCategory--UINT Identifies the category from which information is being requested.
nIndex--UINT Identifies which information is being requested from within the category.
lpOutput--LPVOID Points to a buffer to hold the requested information.
I pass an object of LOGCONTEXT as reference to it. It works fine and fills up the object with specific values then when I pass the object to the other function (WTOpen) it fails to work. Hope u can come up with something. Take care.
|
|
|
|
|
This is code from Wine! A Win32 emulation library for Linux. God only knows what FIX32 and WTPKT types really are. Have fun with this one, this is as far as I can take it. There was a mistake near the bottom, lcSysMode is listed as a BOOL type and you had it as an integer.
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto )]
public struct LOGCONTEXT
{
[ MarshalAs( UnmanagedType.ByValTStr, SizeConst = 40 )] public string lcName;
public uint lcOptions;
public uint lcStatus;
public uint lcLocks;
public uint lcMsgBase;
public uint lcDevice;
public uint lcPktRate;
public uint lcPktData;
public uint lcPktMode;
public uint lcMoveMask;
public int lcBtnDnMask;
public int lcBtnUpMask;
public int lcInOrgX;
public int lcInOrgY;
public int lcInOrgZ;
public int lcInExtX;
public int lcInExtY;
public int lcInExtZ;
public int lcOutOrgX;
public int lcOutOrgY;
public int lcOutOrgZ;
public int lcOutExtX;
public int lcOutExtY;
public int lcOutExtZ;
public uint lcSensX;
public uint lcSensY;
public uint lcSensZ;
public bool lcSysMode;
public int lcSysOrgX;
public int lcSysOrgY;
public int lcSysExtX;
public int lcSysExtY;
public uint lcSysSensX;
public uint lcSysSensY;
}
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thank u very much for ur help. I managed to solve the problem by trial and error. I actually removed the "StructLayout Attribute" from top of the structure which solved the problem. Anyways, ur help is duly appreciated. Could u give me a link to "Wine" so that I can see how they have defined the other structures in wintab. Thank u.
|
|
|
|
|
Try typeing "Wine Win32" into Yahoo or Google.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|