|
Good Day,
Ever since I've used DLL files, I'm always plagued by the problem of detecting whether they exist or not.
For example, A.exe uses A.dll , and then I delete A.dll then run A.exe
A.exe will run successfully even if A.dll does not exist, it will however crash when some function from A.dll was called.
Is it possible to display "Cannot find A.dll. Application will now close." message?
I don't want to use File.Exist("A.dll") in Program.cs, is there any other way to accomplish the task?
Thanks!
It is said that the most complex structures built by mankind are software systems. This is not generally appreciated because most people cannot see them. Maybe that's a good thing because if we saw them as buildings, we'd deem many of them unsafe.
|
|
|
|
|
If the DLL is optional, you could catch the exception that is thrown when the DLL is not present.
|
|
|
|
|
Thanks for the reply.
What if the DLL is really really needed? And I want to throw an exception before the main form starts (in program.cs)?
It is said that the most complex structures built by mankind are software systems. This is not generally appreciated because most people cannot see them. Maybe that's a good thing because if we saw them as buildings, we'd deem many of them unsafe.
|
|
|
|
|
Ian Uy wrote: What if the DLL is really really needed?
I thought your situation was that the DLL already is NOT there!
Ian Uy wrote: And I want to throw an exception before the main form starts (in program.cs)?
You could try loading all the DLLs you need at the beginning using Assembly.Load(), I suppose....
Cheers,
Vikram.
The hands that help are holier than the lips that pray.
|
|
|
|
|
Vikram A Punathambekar wrote:
You could try loading all the DLLs you need at the beginning using Assembly.Load(), I suppose....
Yup, after searching Google, I stumbled upon this solution. I am using Assembly.LoadFrom inside a try-catch block.
Thanks!
It is said that the most complex structures built by mankind are software systems. This is not generally appreciated because most people cannot see them. Maybe that's a good thing because if we saw them as buildings, we'd deem many of them unsafe.
|
|
|
|
|
Hi has anyone everbeen able to publish updates to wsus / 3 ?
There is an API but I haven't been able to find any good/usefull documentation/instructions .
I think this will be a usefull article if anybody knows how it works .
|
|
|
|
|
I am connecting to an MS Access Database with one of the tables containing an image field (OLE)
When I created a report that display that image, I faced 2 problems:
1- The resolution of the image turned very bad. So, how to control this?
2- How to adjust the image size to dynamically display proportional height and width that fit on A4 paper?
Mohammed Gouda
foreach(Minute m in MyLife)
myExperience++;
|
|
|
|
|
Attention Here .. Please
Mohammed Gouda
foreach(Minute m in MyLife)
myExperience++;
|
|
|
|
|
|
Hello,
in an application developped via ASP. if i run a table it take about 1 seconde to get the result.
but running the view of the corresponding table take about 3s.
Note : the view contain a complexe query.
So from where to get data from table or view in order to optimize my search.
best regards
dghdfghdfghdfghdgh
|
|
|
|
|
|
Its your choice really. If the table contains all the data you need and its quicker, use it. If not, use the view.
The only real way to tell is to benchmark the time it takes to do whatever you need to do with the data.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Hi all,
i got problem in replacing text in richtextbox with new text.
I using find and replace method,but it doesnt work..
The text will load in richtextbox when i run the system.Wht i need is just replace some text with new text in richtextbox..
Pls help me..
Thank You..
%#&kmpYrlHSGYG5@#($_+!@!(*JASnjshdk,cm_0ashjhdbn@#$!48mkhfbchsh))^%#W%&@YW7wsdfjw789';'][]\`~JKJQ4$!@#~)-HSKS^&*1)JK12@#@$~!1`DFGkqp][]\]?Zas;EWRG%!@~)(^&BVAG
|
|
|
|
|
And what is not working? What do you use to find and then replace? Show some code.
|
|
|
|
|
the code i did is like this,
richTextBox1.Find("XX");
richTextBox1.SelectedText = text.Replace("XX", text);
The string "XX" is i load into richtextbox.Then i open external file to replace this "XX" with some text.
The code i did is doesnt work.So got any other way to find solution for this case.
Thank You.
%#&kmpYrlHSGYG5@#($_+!@!(*JASnjshdk,cm_0ashjhdbn@#$!48mkhfbchsh))^%#W%&@YW7wsdfjw789';'][]\`~JKJQ4$!@#~)-HSKS^&*1)JK12@#@$~!1`DFGkqp][]\]?Zas;EWRG%!@~)(^&BVAG
|
|
|
|
|
kamalesh5743 wrote: richTextBox1.Find("XX");
richTextBox1.SelectedText = text.Replace("XX", text);
Try:
richTextBox1.Find("XX");
richTextBox1.Text = richTextBox1.Text.Replace("XX", text);
|
|
|
|
|
Hello
I am using multicast delegate as follows, but the effect in the server is undesirable:
Thing.OnEvent1 += new IThingEvents_OnEvent1EventHandler(OnEvent1);
Thing.OnEvent2 += new IThingEvents_OnEvent2EventHandler(OnEvent2);
Thing.OnEvent3 += new IThingEvents_OnEvent3EventHandler(OnEvent3);
The problem is that the (C++ COM) server it thinks it has all the connections for each event.
So in the below example it trys to send the event 3 times. Apart from the unecessary processing, I am worried it is making the inter-process call each time (the incorrect calls are being thrown away on the client side somewhere).
HRESULT Fire_OnOrderCancel(lots of params)
{
HRESULT hr = S_OK;
T * pThis = static_cast<t*>(this);
int cConnections = m_vec.GetSize();
for (int iConnection = 0; iConnection < cConnections; iConnection++)
{
pThis->Lock();
CComPtr<iunknown> punkConnection = m_vec.GetAt(iConnection);
pThis->Unlock();
IDispatch * pConnection = static_cast<idispatch*>(punkConnection.p);
if (pConnection)
{
CComVariant avarParams[20];
//set avarParams
CComVariant varResult;
DISPPARAMS params = { avarParams, NULL, 9, 0 };
hr = pConnection->Invoke(1, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, ¶ms, &varResult, NULL, NULL);
}
}
return hr;
}
What c# thing do I need to use to get the desired behaviour, namely events to be fired once and the c# client to do the correct delegation?
Many Thanks
deds
|
|
|
|
|
Hi to all,
I'm using the dll iTextSharp to fill a PDF file.
My question is how can i select an item in a combobox in the PDF file ?
Best regards and thanks in advance
Fady Sayegh
|
|
|
|
|
Hey!
I got a problem with a class of mine inheriting from xmldocument. When I have an actual xmldocument I can´t cast it to my class, I get System.InvalidCastException. Why is this? I have done the same with for instance another class inheriting from UriBuilder.
|
|
|
|
|
livez wrote: When I have an actual xmldocument I can´t cast it to my class, I get System.InvalidCastException. Why is this?
Because the instance you are trying to cast is obviously not of your inherited type!
|
|
|
|
|
This is what I tried:
class test : XmlDocument
{
public test()
{
}
public void testing ()
{
test t = new test();
XmlDocument doc = new XmlDocument();
t = (test)doc;
}
}
|
|
|
|
|
|
Didnt work
|
|
|
|
|
try leppies solution bellow
|
|
|
|
|
Why was the message deleted? Because the OP said the proposed solution didn't work? That's not a very good reason as now no one else who runs into the same (or similar) problem will know not to try that approach.
Scott.
—In just two days, tomorrow will be yesterday.
—Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
[ Forum Guidelines] [ Articles] [ Blog]
|
|
|
|