|
|
How to program a app that can monitor the http request for some certain files of IIS?
That is went the http client request the files, the app can know it.
Thanks!
Let's roll!
|
|
|
|
|
|
Hello,
i wanna retrieve a contact persons from a WAB file and i wanna change a person in it.
I never made a wrapper class for accessing wab32.dll, maybe somebody can help me out??
Or somebody made a com object for accessing windows address book
|
|
|
|
|
First - read the documentation for the classes, interfaces, etc., in the System.Runtime.InteropServices namespace in the .NET Framework SDK, as well as the links to the articles mentioned in the text. You're going to have to learn how to marshal params, how to declare parameters correctly (when to use ref and out , and the differences between reference types and value types). Then see the the WAB reference[^] and declare the interfaces with the appropriate GUIDs (using the GuidAttribute ), which you can find in the header listed in the documentation.
Finally, P/Invoke the WAPOpen and WAPOpenEx functions which will get you instances of interfaces you defined previously.
If you don't care about the source of the contacts and would rather use the default MAPI contact container, you should make use of MAPI and do something similar as described above for interfaces like IABContainer , IAddrBook , and so forth. This way you can query and update any address book set as the system default (WAB, Outlook, Mozilla, etc.).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
You say: Then see the the WAB reference[^] and declare the interfaces with the appropriate GUIDs (using the GuidAttribute), which you can find in the header listed in the documentation.
Where can i find the GUIDs because i looked for them and i couldn't find it..
Sander
|
|
|
|
|
Good question. I'm having trouble finding them in any headers myself. It appears upon further inspection, however, that they are subsets at least of the corresponding MAPI interfaces. If the GUID is the same (and it isn't documented either way), you can download the Platform SDK[^] (if you installed VS.NET with the installation defaults, this is already in Vc7\PlatformSDK) and see the MAPIGuid.h header file. It uses a macro to define them, but it's not hard to determine how it constructs GUIDs using the macro and the input.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi,
Could you help me to understand how datagrid works.
I'm trying to make a datagrid editable. Now most of the tutorials I read says that i should turn the Enable ViewState off. Why is that?
If i turn this off then i need to support building the datagrid because the datagrid is not persistant.
Right?
If i put the EnableViewState off then i don't get any call to:
protected override void LoadViewState(object savedState).
Right?
If i put EnableViewState on then i get calls to this function but if i rebuild the datagrid in this function then is it still not recommended to have EnableViewState?
If i don't have the EnableViewState and have an editable datagrid and in the Page_Load function i have the recommended:
if (!Page.IsPostBack)
and in the if clause i have a function call to build the datagrid. Ok
If i click on the edit button in the datagrid then i will not get any events to EditCommand because the IsPostBack is true and no datagrid was built.
Right?
Please leave some comments/suggestions on this
Yours sincerely
Andla
|
|
|
|
|
|
Hi,
I am currently making a serial terminal (like Hyperterminal in Windows). I am using text boxes to view the sent and received data. I have enabled multiline, word wrap and both scroll bars.
But when new text is added, the text box does not automatically scroll down to show the last piece of text that was added. So if i receive a long menu of items or something, I have to scroll all the way down to see it. When I make a selection, the text box scrolls back automatically. So I have to keep scrolling down after each selection I make.
Is there any way to make the text box stop resetting the scroll position? How do all commercial serial applications do it?
Cheers
-Chad
ZT
|
|
|
|
|
In the future, please refrain from re-posting unanswered topics unless you allow ample time in between. If you have something that needs answering immediatley, you're definitely in the wrong place.
Most decent terminal applications derive their own control using buffered screen output. The TextBox control in .NET is very basic (this encapsulates the Edit Windows common control). You should consider deriving your own. This buffer stores past lines in a queue and a view is displayed over that buffer for X number of lines.
There's examples of this on the 'net, though few in C# of which I'm aware. The concept is pretty simple, though, and the concepts presented in other languages should work fine.
Note that to make the TextBox do this some work is involved and the pay-off isn't very good. You're still left with plain, single-font text. Even using a RichTextBox - which should scroll correctly - would be much better.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Sorry about that. I did not realise I had submitted the same question before. It will NOT happen again.
And thanks for the reply too. Atleast now I know how to go about doing it.
-ZT
ZT
|
|
|
|
|
Hi,
I am currently working with some devices with ethernet ports. I need to write a program for those devices to send out broadcast messages when they connect to the network so that the server can talk to them and download neccessary apps.
I tried using UDP Client but it fails to send datagrams to the remote endpoint with the IP address of IPAddress.Broadcast. When I try this i get a
"An unhandled exception of type 'System.ArgumentException' occurred in System.dll" error.
What is the best way for the server to automatically detect a client when a client plugs into the local network?
Cheers,
-Chad
ZT
|
|
|
|
|
ZigmaT wrote:
"An unhandled exception of type 'System.ArgumentException' occurred in System.dll" error.
What does your method call look like where the exception is thrown. This gets thrown when you are passing an invalid arguement to a method.
- Nick Parker My Blog
|
|
|
|
|
code
this.remoteEP = new IPEndPoint(IPAddress.Broadcast, 20000);
UdpClient myUDP = new UdpClient(20000);
myUDP.Send(System.Text.Encoding.ASCII.GetBytes("ImOnlineNow"), 11);
All I want to do is send a broadcast saying the device is available on the network.
So that the when the server receives this message on the specified port it can make a connection to the client and two way communication can occur.
ZT
|
|
|
|
|
ZigmaT wrote:
this.remoteEP = new IPEndPoint(IPAddress.Broadcast, 20000);
UdpClient myUDP = new UdpClient(20000);
myUDP.Send(System.Text.Encoding.ASCII.GetBytes("ImOnlineNow"), 11);
First, you will need to call the Connect method before you can call Send . What line does the exception get thrown at? You also might consider rewriting your send so it looks like:
Byte[] mBytes = Encoding.ASCII.GetBytes("ImOnlineNow");
myUDP.Send(mBytes, mBytes.Length);
- Nick Parker My Blog
|
|
|
|
|
According to my understanding, to call the connect method you need a remote end point. And a remote end point needs an ip address and a port number.
But my devices will not know the ip address of the host its connecting to. That is why the devices need to send out broadcast messages so that the host can respond by initiating a connection. Essentially the device will be like a client and the pc i log into will like be the server. I need to be able to communicate with the device no matter which pc i log onto inside the local network. Atleast that's the idea.
Is this the right way to go about doing this? Or am I barking up the wrong tree here? )
Thanks again for helping me out. Really appreciate it!
-ZT
ZT
|
|
|
|
|
In the UdpClient constructor, you're binding to the same local port for which broadcasts are answered. I'd recommend just using the default constructor and letting the subsystem pick a non-reserved local port as it typically will for most applications. If you need the port that was assigned, you can always get it via ((IPEndPoint)myUDP.Client.LocalEndPoint)).Port .
Ask Nick as before, on which line is the exception thrown and what is the full text (minus the stack trace if you don't mind) of the exception? In the case of a SocketException , more information is needed (and is provided). That's like saying "there was an error" and telling nothing about it. TIA
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi ,
I am currently prgramming a moderately large solution. Many projects have many dependancies with other projects within the same solution. When I try to compile it, VS.NET gives me an error saying it cannot copy certain (compiled) class libraries into the same directory. It says it is because there are already copies of the dlls in the output directory already.
Right now I have merely told the VS not to copy certain dlls locally. This works fine for debug compilations. But often the release compilations tend to crash half way through because it cannot find the specified versions of specific files (dlls).
Please help me Out.....
ZT
ZT
|
|
|
|
|
ZigmaT wrote:
This works fine for debug compilations. But often the release compilations tend to crash half way through because it cannot find the specified versions of specific files (dlls).
Just a guess. Maybe you set this setting for DEBUG setting and you didn't do the same thing in RELEASE setting.
Mazy
"Improvisation is the touchstone of wit." - Molière
|
|
|
|
|
Thanks for that. Now it compiles. It runs fine too, until it needs to find that particular version of the dll.
So if the program starts okay does it mean my dependancies are okay and the problem is probably with my program? Doesnt VS.NET perform a check of all dependancies before running an application?
Cheers
-Chad
ZT
|
|
|
|
|
The first step is making sur that all projects include project references (not assembly references) to other projects in your solution, which you seem to have done.
Second make sure that no designers are open and that the instance of the IDE was started in the build configuration for which you want to compile. Perform a rebuild.
There is known bugs in VS.NET that have gotten better from 2002 to 2003, but they still exist. Hopefully "Whidbey" (here's hopin' for 2004) will fix this once and for all.
Once more important aspect in large, multi-project solution is to NOT use automatic versioning (using asterisks in the AssembyVersionAttribute ). You can loose control quickly of assembly versions especially if you don't always compile the solution as a whole.
In a week I typically compile a solution with over 50 projects (don't ask) a couple times, but I usually only build a few projects for which I'm directly responsible and we control our versioning to facilitate better builds and assembly binding redirections for application updates.
While I still see and get over the problem you've stumbled on, following these guidelines usually helps.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thank you very very much for that. It helped tramendously.
-ZT
ZT
|
|
|
|
|
I'm running the following code, and have run into yet another misshap.
shellFolder is a valid COM object constructed by the ParentInterfacePointer from SHBindToParent. I know it's valid as it returns pointers via other functions, however, this function returns nothing.
The relativePIDL is the value returned from SHBindToParent.
Every time I run this method, mySTRRET is still null (well, IntPtr.zero).
<br />
mySTRRET = new IntPtr();<br />
result = shellFolder.GetDisplayNameOf(relativePIDL,SHGDN_Flags.SHGDN_NORMAL,out mySTRRET);<br />
The method is defined almost identicaly as the one in the tutorial (http://www.codeproject.com/csharp/csdoesshell1.asp), but I'm looking for a ptr to mySTRRET (I don't want the object, i want to forward it to another function):
<br />
int GetDisplayNameOf( <br />
IntPtr pidl,<br />
SHGDN_Flags uFlags,<br />
out IntPtr pName);<br />
This is bothering me because as far as I can see it is set up properly, and it also runs without exception.
Any ideas?
Cata
|
|
|
|
|
The Catalyst wrote:
mySTRRET = new IntPtr();
result = shellFolder.GetDisplayNameOf(relativePIDL,SHGDN_Flags.SHGDN_NORMAL,out mySTRRET);
STRRET is a structure, look it up in MSDN, you will need to define this, you can't just declare an IntPtr in it's place.
- Nick Parker My Blog
|
|
|
|