|
Hi
I am using static binding i.e the use of dll of MS OUTLOOK 2003 in my Windows application to extract FROM,TO,CC,BCC,MESSAGE email addresses and their names etc. and store it into an MS ACCESS database. The module is working fine in my machine and also in client machines, but some of the clients are complaining that they are getting the error at the time of running the module. They are also using MS Office Outlook 2003. They are getting the error when try to run the application.
The error is like this:
System.IO.FileNotFoundException: The specified module could not be found.
I think sometimes CLR fails to load unmanaged dll of OUTLOOK. I have tried by using most of things but till now there is no success. All the dlls are present in applications root folder.
Is there any idea?
regards
|
|
|
|
|
Elena,
Try the utility FUSLOGVW.exe. Enable tracing and try again. It should tell you in which directories the module was looked for and what happened. It may help you in diagnosing the problem.
Regards,
|
|
|
|
|
Thanks for your reply.
I am using FUSLOGVW.exe and getting the log below but still it is unsolved. Please give some suggestions.
*** Assembly Binder Log Entry (10/5/2006 @ 5:20:22 PM) ***
The operation failed.
Bind result: hr = 0x80070002. The system cannot find the file specified.
Assembly manager loaded from: C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\fusion.dll
Running under executable D:\Projects\TestApp\bin\Debug\TestApp.exe
--- A detailed error log follows.
=== Pre-bind state information ===
LOG: DisplayName = TestApp.resources, Version=1.0.2470.31203, Culture=en-US, PublicKeyToken=null
(Fully-specified)
LOG: Appbase = D:\Projects\TestApp\bin\Debug\
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = NULL
Calling assembly : TestApp, Version=1.0.2470.31203, Culture=neutral, PublicKeyToken=null.
===
LOG: Processing DEVPATH.
LOG: DEVPATH is not set. Falling through to regular bind.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Post-policy reference: TestApp.resources, Version=1.0.2470.31203, Culture=en-US, PublicKeyToken=null
LOG: Attempting download of new URL file:///D:/Projects/TestApp/bin/Debug/en-US/TestApp.resources.DLL.
LOG: Attempting download of new URL file:///D:/Projects/TestApp/bin/Debug/en-US/TestApp.resources/TestApp.resources.DLL.
LOG: Attempting download of new URL file:///D:/Projects/TestApp/bin/Debug/en-US/TestApp.resources.EXE.
LOG: Attempting download of new URL file:///D:/Projects/TestApp/bin/Debug/en-US/TestApp.resources/TestApp.resources.EXE.
LOG: All probing URLs attempted and failed.
Regards
|
|
|
|
|
Well, this log is not related to Outlook but to the assembly "TestApp.resoures"...
|
|
|
|
|
Thanks again for reply.
Can you give any idea how to fix the bug.
Regards
|
|
|
|
|
Dear friends, consider the following 'dirty' html code:
<P> </P> <P> </P> <P>[BodyStart]</P> <P>Soccer is our national game</P> <P>[BodyEnd]</P> <TABLE cellSpacing=1 cellPadding=1 width="100%" border=1> <TBODY> <TR> <TD>[PT_FName]</TD> <TD></TD> <TD></TD></TR> <TR> <TD></TD> <TD></TD> <T
In the above html code, there is a special tag [BodyStart] and [BodyEnd]. I want to extract this tag from the html. Moreover, i also want to extract the text written inside this tag. How can i do so in C#
Imtiaz
|
|
|
|
|
Look for the regular expressions subject, there are few snippets that will extract exacly what you need.
cheers,
Liron.
|
|
|
|
|
Imtiaz, will this[^] article help?
/ravi
|
|
|
|
|
Hello,
I'm programming my own application in C#, and I need to know the type of an object in execution time. I need to do a dynamic cast.
In C++ there is dynamic_cast<>, but I don't know how to do this in C#. I expect that you can help me.
Bye!
|
|
|
|
|
Type t = myVar.GetType() will give you the type.
For dynamic conversion, you might also do something like this:
public bool compare(object a, object b)
{
if ((a is int) && (b is int))
return (int)a < (int)b;
...
}
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Thank you greeg!
|
|
|
|
|
WSonck wrote: I need to do a dynamic cast.
It has been a while since I did any C++, if the following doesn't help can you remind me of the properties of a dynamic_cast.
There are two casting operators in C#
SomeClass castedReference = (SomeClass)objectReference;
SomeClass castedReference = objectReference as SomeClass;
The first will cast an object and raise an exception if the cast fails. You can cast to a the base, or if you have a base reference already you an cast to a more specific derived version.
The second will cast an object and return null if the cast is invalid. Again you can cast to any valid point on the inheritance tree for that object.
There is also the is operator which you can use to tell if an object is some particular type. e.g.
bool isSomeObject = objectReference is SomeClass;
The result will be true if the referenced object is at a valid point on the inheritance hierarchy for given type.
Does this help?
|
|
|
|
|
Of course. This helps me very much. What a great explaination!
Thank you!
|
|
|
|
|
WSonck wrote: In C++ there is dynamic_cast<>, but I don't know how to do this in C#. I expect that you can help me.
Don't use is when your casting because first you must find its type and then make the apropriate cast. The as statement is a much better choice as it does both type checking and casting in one operation. Using the is way forces you to check the types type twice because you must first check the type using is and then cast which also checks the type. The as will return null if it not compatible with that type.
SomeObject sobj = new SomeObject();
ADifferentObject diffObj = sobj as SomeObject();
=====Brain melting code=====
static int Sqrt(int x){ if (x<0) throw new ArgumentOutOfRangeException(); int temp, y=0, b=0x8000, bshft=15, v=x; do { if (v>=(temp=(y<<1)+b<<bshft--)) { y+=b; v-=temp; } } while ((b>>=1)>0); return y; :omg:
====TSI TLFL EEOOLHTG=====
^^^^^^^^^^^^^^^^^
Decode that and you will win.;P
============Hint===========
cout << "33 20 57 4F 52 44 53 62 63 6B 77 6F 72 64 73";
|
|
|
|
|
So, if you don't want to do two checks, what do you do if the reference you are casting may be null in the first place? How do you determine whether the null after the cast was because of an invalid cast, or because the reference was null in the first place?
|
|
|
|
|
Colin Angus Mackay wrote: How do you determine whether the null after the cast was because of an invalid cast, or because the reference was null in the first place?
if ( originalObject == null )
{
... action ...
}
else
{
NewObjectType newObj = originalObject as NewObjectType;
if ( newObj == null )
{
... alternative action ...
}
}
The approach listed above, BTW, is used in some framework code to determine if a specific object is IDisposable before committing to an action.
|
|
|
|
|
But that introduces a second check on the object being cast, which was the main thrust of Henize's argument against using if(x is Y){}
BTW, I agree with your code. It was Henize's argument that was a little odd.
|
|
|
|
|
Colin,
Actually my logic avoids the if (x is y) by doing the cast and then comparing for null. So in the entire logic flow only a single cast occurs. However if there is no loop, I find no problem with also checking if (x is y) then do something. the logic is naturally self documenting -- and that takes precedence over performance (in Agile at least).
Michael
|
|
|
|
|
But you are still doing two checks, one before the cast on whether the object is null, and one after the cast to see if it is null due to an invalid cast - Henize was arguing against doing two checks. (I agree with your code and, like I said, It was an odd argument by Henize)
|
|
|
|
|
Hi All,
I'm a tester in a company (and programmer as well), and I have a small bizzare request ...
I'm checking a windows xp system (with admin. permission) and I have a test case that i'm requested not to move mouse or keyboard for 120 minutes (it's hard coded value that can't be changed) in order to see if the password protected screensaver will show up.
I want to write a small utility (C#) that will make the screensaver show up earlier by changing the time of mouse/keyboard not moved or any other solution (changing the system time with some delay didn't worked for me, I guess the screensaver is counting the seconds key/mouse not moved).
Thanks,
I hope someone have an idea.
|
|
|
|
|
Liron,
If I were you I would just wait 120 minutes and go for one or more beers
Gael
|
|
|
|
|
hehehehehe ... I wish ...
Just want ot be a little bit more effective :->
|
|
|
|
|
Liron Hirsch wrote: Just want ot be a little bit more effective
I would rather the program itself be more effective, like being able to change the idle time to something more reasonable. Why leave a computer open for 2 hours? Just how did the developers expect you to test this bit of functionality?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
you are right, but, this is the application for now and i need to handle the problem.
|
|
|
|
|