|
Hi,
sounds like dsSearcher.FindOne() is returning null. Does its documentation tell
you anything in that direction ?
I suggest you assert srResult!=null to confirm this.
|
|
|
|
|
Hi,
Thanks for the reply. As u suggested I checked dsSearcher.FindOne() and it is returning a NULL. The trace doesnt sugest me anything other than this
Error: Object reference not set to an instance of an object.. Trace: at UBS.BLISS.UserInfo..ctor(UserDirectory parentDirectory, String userAttribute, UserSearchType searchType) in d:\BLISS\App_Code\UserInfo.cs:line 152
at UBS.BLISS.UserDirectory.GetByLegacyExchangeDN(String legacyExchangeDN) in d:\BLISS\App_Code\UserDirectory.cs:line 101
at UBS.BLISS.MessageReader.GetCapturedMessageItem(IMessage iMsg, MailRetentionType retentionType, MessageType messageType, Boolean hideContent) in d:\BLISS\App_Code\MessageReader.cs:line 395. InnerException: . Source: App_Code.714yokif
I have the same code to do the search based on the LegacyExchangeDN in my test page it works fine but when i do it as a part of the application it throws this exception.
The code also works fine in Production with windows server 2000.
I kinda of struck in this, Please help me
Thanks
Zach1983
|
|
|
|
|
Hi,
since you now realize the FindOne() method may return null, you must include
code to deal with that possibility, how unlikely it may seem (otherwise
it will bomb at an inappropriate point in time)
I dont know enough about Active Directory to pinpoint your problem right away.
Here are some ideas:
- AD not present or not enabled
- some parameter value (maybe the default value of some property) not appropriate
- security problem
Good luck.
|
|
|
|
|
Hi,
I am kinda of struck in this and I found that when I hardcode the legacyExchangeDN string its getting the entry from the Active Directory but when i Parse the string from th email address
say for example Doe, John <ex: o="First" organization="" ou="First" administrative
group="" cn="Recipients/cn=jdoe">.. i parsed the string using this
--------
int startIndex = -1;
int endIndex = -1;
startIndex = inString.IndexOf("<ex:", recindex)="" +="" 4;
="" if="" (startindex=""> recIndex + 4)
endIndex = inString.IndexOf(">", startIndex);
if (endIndex != -1)
lemail = inString.Substring(startIndex, endIndex - startIndex);
-------------
It returning NULL...I dont understand why its not working, what i am doing for Hardcoding is also just outputting the lemail and Coping the same to hard code it...
Any help would be Appreciated... I am struck for more than a week....
Thanks,
Zach1983
|
|
|
|
|
sorry for the junk code
Hi,
I am kinda of struck in this and I found that when I hardcode the legacyExchangeDN string its getting the entry from the Active Directory but when i Parse the string from th email address
say for example Doe, John <EX:/o=First Organization/ou=First Administrative
Group/cn=Recipients/cn=jdoe<...... i parsed the string using this
the code is
--------------
int startIndex = -1;
int endIndex = -1;
startIndex = inString.IndexOf("<EX:", recIndex) + 4;
if (startIndex > recIndex + 4)
endIndex = inString.IndexOf(">", startIndex);
if (endIndex != -1)
lemail = inString.Substring(startIndex, endIndex - startIndex);
int email = lemail.Length;
logger.LogDebug("email " + email);
-------------------
It returning NULL...I dont understand why its not working, what i am doing for Hardcoding is also just outputting the lemail and Coping the same to hard code it...
Any help would be Appreciated... I am struck for more than a week....
Thanks
Zach1983
|
|
|
|
|
Hi,
so you have 10 lines of code that go wrong ?
how about debugging it, this means:
- either you single step through it and look at intermediate results
- or you add output ("log") statements to see intermediate results.
Whatever method you choose, you should soon figure out you made a simple
mistake (that could have been avoided by applying a more defensive
programming style).
Good hunting !
|
|
|
|
|
Hi,
I am suppose to read XML files and extract some data from certain nodes based on its attribute. What I have done is to use XmlTextReader and loop through, using select case and hardcode (inefficient and poor practice) the nodes to be extracted. I have used XmlTextReader instead of XmlDocument initially as I would not be needing Xpath. Now, I would like to know if there are ways to select the nodes based on part of its attribute name like using wildcards. I have tried using Xpath but no success. Essentially, I want to select all the nodes with attributes beginning with a certain string eg) Wanted[…., regardless of the remaining text in the attribute name field.
Can anybody please kindly point to me how to go about doing it if possible? Any advice will be greatly appreciated.
Below are sample of my code and xml file.
reader = new XmlTextReader(link);
while (reader.Read())
{
switch (reader.NodeType)
{
case XmlNodeType.Element:
if (reader.Name == "A") //To select some nodes w/o attributes
{…. }
if (reader.MoveToFirstAttribute()) {
switch (reader.GetAttribute(0)) //To select somes nodes based on attributes.
{
case "Wanted[zxx]":
…
break;
case "Wanted[yyy]":
…
…
default:
break;
….
- <Root>
<A>XXX</A>
….
- <Elements>
<Element name="Num">XXX</Element>
<Element name="xxx">xxx</Element>
<Element name="B1">1424</Element>
<Element name="Unwanted1">xxx</Element>
<Element name="Unwanted2">xxx</Element>
<Element name="Wanted[XXX]">xxx</Element>
<Element name="Wanted[YYY]">xxx</Element>
<Element name="Wanted[ZZZ]">xxx</Element>
</Elements>
</Root>
|
|
|
|
|
drifters wrote: Now, I would like to know if there are ways to select the nodes based on part of its attribute name like using wildcards.
I don't think so.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Oh no. If that's the case than I'll have to hardcode the cases. Thanks for the help. Any other view or advice will be greatly appreciated.
|
|
|
|
|
Hi!
Im currently playing around with making a Keylogger (nothing malicious, I promise) and ive gotten everything to work properly thus far, but one feature I think would be helpful would be recognizing what window currently has focus for each keystroke, i.e. if "hello" is typed in an internet explorer window, and then "c# programming" is typed in a firefox window, is there any way for my application to both get the kaystrokes, and the window with focus... making me able to do something like this:
Internet Explorer - The Code Project:
hello
Mozilla Firefox - The Code Project:
c# programming
Hopefully ive been clear on what I would like, any help would be much appreciated. Thanks!
Dirk Williams
|
|
|
|
|
Hi,
you can get a window handle and then either get the window's title, or scan the
process list (Process class) to find the process it belongs to. Some PInvoke
would be required:
[DllImport("user32")]
public static extern IntPtr GetForegroundWindow();
[DllImport("user32.dll")]
public static extern void GetWindowText(IntPtr hWnd, StringBuilder sb, int capacity);
|
|
|
|
|
Hello everyone,
I am using the following code to specify a window to receive mouse and keyboard messages from the video window.
IVideoWindow.put_MessageDrain(this.DvdPanel.Handle);
I was wondering if I can do the following:
1- Can I distinguish between the right and the left mouse click?
2- Can I assign seprerate events to the mouse clicks?
- I would like to have ContextMenu once the right mouse is clicked; and follow the menu available on the Video Window once the left mouse is clicked.
Thank you very much and have a great day.
Khoramdin
|
|
|
|
|
What is an IVideoWindow ?
1 - in your event handler, you can. It's part of the event args
2 - no
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Helo Christian,
Thank you for your help. IVideoWindow is a DirectShow Interface. It is used for rendering Video images. If I am not mistaken your answer still stays the same regarding the mouse click. As I mentioned I can detect mouse click but I am unable to seperate the Left from Right mouse click.
Thank you very much for your help and have a great day.
Khoramdin
|
|
|
|
|
hi all,
let's say i have the following code:
public void GetAuthors_Click(Object sender, EventArgs E) <br />
{<br />
String selectCmd = "select * from Authors where state = @State";<br />
<br />
SqlConnection myConnection = new SqlConnection("server=(local)\\NetSDK;database=pubs;Trusted_Connection=yes");<br />
SqlDataAdapter myCommand = new SqlDataAdapter(selectCmd, myConnection);<br />
<br />
myCommand.SelectCommand.Parameters.Add(new SqlParameter("@State", SqlDbType.NVarChar, 2)); myCommand.SelectCommand.Parameters["@State"].Value = MySelect.Value;<br />
<br />
DataSet ds = new DataSet();<br />
myCommand.Fill(ds, "Authors");<br />
<br />
MyDataGrid.DataSource= ds.Tables["Authors"].DefaultView;<br />
MyDataGrid.DataBind();<br />
}
there is a text file i read with lines as follows:
DECLARE @VAR0 VARCHAR(40) --Variable0<br />
DECLARE @VAR1 INT --Variable1<br />
DECLARE @VAR2 BIT --Variable2
such that the second column gets stored in string[] strVarNames (i.e. strVarNames[1] = "@VAR1")
third column gets stored in string[] strVarTypes (i.e. strVarTypes[1] = "INT")
my question is in the following line from the above code:
myCommand.SelectCommand.Parameters.Add(new SqlParameter("@State", SqlDbType.NVarChar, 1));
how do i replace the 2nd parameter type as in the following example?
myCommand.SelectCommand.Parameters.Add(new SqlParameter(strVarNames[1], ***HOW from strVarTypes[1]?***, 1));
Thank you in advance.
I am a SysAdmin, I battle my own daemons.
|
|
|
|
|
First of all, please tell me you're not really putting all this code in your click event handler ?
Basically, if you have a string representation of the type, you probably need to write a switch statement that works out what type to return, or you may be able to use reflection.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I can't figure out the Mesh.Save() method. Does anyone know how to use this properly? I want to save my mesh data to a .x file so that I can use it in other programs, but I can't figure out this method.
-----
Note: *** Never give me an answer have anything to do with Visual Studio. I don't have this program, and it'll be that way for a long, long time. ***
|
|
|
|
|
What API are you using? (Managed DX? XNA?)
p.s. your signature sounds like something heard from a whiny slashdot linux fanboy. It discourages me, and probably others, from replying to your posts.
|
|
|
|
|
hello everybody,
I'm currently writing an Poker Odds Calculator.
I want this programm to read some informations from Online Poker Rooms like Pokerstars or PartyPoker. But the big problem that I have right now is that I dont know how to collect this Informations (like what text is stored in a textbox...) and transfer it to my Application so that I can calculate with it.
I searched the Internet but I didnt find anything.
Can you give me some inspirations?
This would be very great.
|
|
|
|
|
Do PartyPoker et al have a public API you could code against?
If not, you're left to stealing info from a behind-the-scenes browser (think System.Windows.Forms.WebBrowser). Such is possible, but not recommended because of difficulty and fragility, not to mention it's probably on shaky legal grounds.
|
|
|
|
|
I dont think that there is a special API, because other Odd Calculators (like 'Texas Calculatem' or 'Holdem Genius') need the Pokerwindow on top of the screen. So I think that they do Screenshots of special Parts of the Window and analyze this pictures. I'm not an very experienced Programmer so I dont know if this is correct.
But this sounds to me very 'unclean', there has to be a better way I think...
Here on Code Project I found an interesting article about a memory scanner. Would this be an option? I think I will write a little program to have a closer look to the memory befor I try the way with the screenshots.
How can I check the pokerprograms for an API?
A few weeks ago I found an article (dont know where right know) about someone who wanted to add his own controls to an external application. And he got it. Maybe it is possible to add a 'datareader' to the pokersoftware from which I can read the data in my calculator? (I dont know if this is possible and/or legal.)
I dont know what you mean with 'behind-the-scenes browser'. Can you explain it a bit for me? Or do you have a link?
I'm german, so if you dont understand something, please ask me...
|
|
|
|
|
hello
i made some report using crystal report .net
but when i ran the project on another pc exception appear like
this "CrystalDesision.Engine need it" or something
note i used crystaldesision propers to set page sizer to the report
and the project work on my pc completely
please help me
|
|
|
|
|
hi,
I used to meet the problem like you. I recoginized that when I made a Setup file, I forgot adding an assembly of Crystal Report. As a result, all tasks invovled CR can't run in another computer.
Please add this assembly in Setup file
It seem to be a solution or an answer.
|
|
|
|
|
Question 1) I'm just starting out in c# and am trying to figure out how to bind treeview and listview controls to the groovy new Windows RSS Platform. I see plenty of examples binding these controls to XML or databases, but none using the new platform. (FeedsManager, IFeedFolder, etc.)
Question 2) The new platform FeedsManager stores info under the application folder for the current system user. Can anyone suggest a way to create another instance of the feeds manager for different users and override the default directories that only pertain to the user signed in?
Thanks much!!
|
|
|
|
|
William,
Your question was well described and clear, unfortunately not too many people here have used the new Windows RSS platform. Perhaps if you ask this question on one of the RSS platform team member blogs on blogs.msdn.com, or in some other forum dedicated to this platform, you might get more help.
|
|
|
|