|
I try to terminate the application from other library of main library. The scene like this.
1st at the main library I reference the second library.
2nd at the Application.Run I attach form from second library (call formx).
3rd at formx I try terminate the main application call Application.Exit().
The phase third is not passed, so anyone have experience to terminate application from other assembly, I try to manage my project (each controls, classes, forms, etc. have it own libraries).
Thanks.
|
|
|
|
|
That's not proper form. A library should NEVER determine when an application should terminate. It should only send back exceptions or some other signal that the root of your application uses to determine IF it should terminate or not, then take proper action on its own.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi All
Is there a simple way to solve subject in C#, Visual Studio 2003, .NET 1.1 (way wich were simpler then learning AOP and big Inversion of control frameworks like Spring.NET)
PS sorry my poor english
|
|
|
|
|
No, there is no way to do this using the tools that come with the .NET Framework or Visual Studio .NET. You'll need a third party tool to log every call your application makes, though I've never had the need for such a tool.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
|
Hello...
There is a requirement of burning data into a CD from my application which i developed in VC++.net
I tried to use Imapi.h related functionalities. but its not in my XP SDK.So i used another dll file(acclImapiWrapper.Dll) which i downloaded from the website...
http://www.vbaccelerator.com/home/NET/Code/Libraries/Writing_CDs/IMAPI/article.asp
Using this dll file i tried the following code...
try{
DiscMaster* DM ;
SimpleDiscRecorder* sRecorder ;
DiscRecorders* DRs;
` DiscRecorder * DR;
DM = new DiscMaster();
sRecorder = DM->SimpleDiscRecorder;
DRs = DM->DiscRecorders;
int i,cnt;
cnt = DRs->get_Count() ;
for (i=0;i<cnt;i++)
{
="" dr="DM-">DiscRecorders->get_Item(i);
}
DR->OpenExclusive();
DR = DM->DiscRecorders->get_Item(0);
Cursor::Current = System::Windows::Forms::Cursors::WaitCursor ;
if (sRecorder->HasRecordableDrive())
{
//sRecorder->Burn(this->Handle);
DM->RecordDisc(true,true);
}
MessageBox(0,"CD Burning completed successfully","CD Burning",0);
Cursor::Current = System::Windows::Forms::Cursors::Default ;
DR->CloseExclusive();
sRecorder->Dispose();
DR->Dispose();
DM->Dispose();
}catch(COMException* e)
{
e->Message;
}
The data is staging on CD but burning Cd is not successful..
Could any one help me out??
Regards
Salai
Salai
|
|
|
|
|
There's a component called XPBurn, if your app is XP only, that does the trick nicely.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
i am able to add .NET (with C#)in-built calendar control but there are no controls for year navigation within the calendar.Please suggest how i can add my own navigation button for year .
Only month navigation is supported in the calendar.So i need to click 24times to go back 2 years.
Please help...
sumit
|
|
|
|
|
Hi,
just click onto the year in your MonthCalendar and up/down arrows will appear which you can use to navigate.
Robert
|
|
|
|
|
Hi I am writing a large program where I am using three text boxes. I am performing validation controls on these text boxes however there are some conditions
Names of textboxes
1. x
2. y
3. z
The conditions are
1. x , y , z should be numeric.
2. x and y can be blank ( x = “” , y = “”) at a time
3. z can never be blank, it should always have a numeric value.
4. if x has a value y cannot be blank and x should be non negative
5. if y has a value x cannot be blank and y should not be non negative.
6. if x and y have values y > x
7. z should be non negative
A message box should pop up each time the user clicks a button with the appropriate error ( eg : x cannot be negative , or y cannot be greater than x , etc… )
Since I am actually dealing with cells in a data grid I cannot use any sort of validation controls. I need to perform the validation using code. I am using visual studio 2005 , Visual Basic
Any sort of help will be gratefully appreciated.
|
|
|
|
|
I don't have time to give you a complete answer since it's my bedtime. Nevertheless, I have used validation controls with datagrids in .NET 1.1. I believe I created child validation controls that occupied the same cell as the active input control (e.g. textbox). I had some elaborate condition like you do. I believe I had to write some javascript to call some of Microsoft's validation javacript code to perform these special conditions. I don't know if this could be done with .NET 2.0, or there may be a more standard way of doing it.
|
|
|
|
|
Welcome to the Code Project.
Please don't post the same question all over the place.
---
b { font-weight: normal; }
|
|
|
|
|
And don't use urgent in the subject line. Your homework isn't urgent.
only two letters away from being an asset
|
|
|
|
|
I have a UserControl which i load in IE using the following html code:
<object classid="Bluap.dll#Bluap.Preloader" width="300" height="120">
The control starts an async download of a file by using HttpWebRequest.
Once the file completes, it fires an event. The event handler can't directly present the contents of the file in the UI, cause the event comes from another thread.
So, i have to do check for 'InvokeRequired' and perform an Invoke(). But once i do so, i get the following error:
An unhandled exception of type 'System.Security.SecurityException' occurred in mscorlib.dll<br />
<br />
Additional information: Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
What's going on, where? Is there a workaround?
Please note that tweiking security in the .Net Configuration is not an option. I want to know what is possible with the default setting.
If Invoke is indeed restricted, this also makes events from other threads usesless in the majority of situations.
Do I have to build my won messagequeue/Invoke/Event functionality? Please tell me that there is a workaround! I don't want to leave 'Web'-UserControls as totally useless compared to applets and swfs.
|
|
|
|
|
Hi,
are you really sure that Invoke is the problem? As I have never heard of such a thing I would assume the code within the invoked method generates the error. You could check the exceptions stack trace (and probably the stack trace of the inner exception also) to determine this.
Robert
|
|
|
|
|
First,
thanks for your interest so far.
Here are some information from the thrown System.Security.SecurityException...
InnerException: null (!)
Zone: System.Security.SecurityZone.Intranet
Action: System.Security.Permissions.SecurityAction.Demand
Source: mscorlib
StackTrace:
at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet)<br />
at System.Security.CodeAccessPermission.Demand()<br />
at System.Windows.Forms.Control.MarshaledInvoke(Control caller, Delegate method, Object[] args, Boolean synchronous)<br />
at System.Windows.Forms.Control.Invoke(Delegate method, Object[] args)<br />
at Bluap.Preloader.myRequestState_CompletedEvent(Object sender, EventArgs e)<br />
at Bluap.RequestState.Completed()<br />
at Bluap.Preloader.ReadCallBack(IAsyncResult asyncResult)<br />
at System.Net.LazyAsyncResult..ctor(Object myObject, Object myState, AsyncCallback myCallBack, Object result)<br />
at System.Net.ConnectStream.BeginReadWithoutValidation(Byte[] buffer, Int32 offset, Int32 size, AsyncCallback callback, Object state)<br />
at System.Net.ConnectStream.BeginRead(Byte[] buffer, Int32 offset, Int32 size, AsyncCallback callback, Object state)
The thread starts with a call to Stream.BeginRead().
Inside myRequestState_CompletedEvent is where i check for InvokeRequired and i call Invoke (save result with BeginInvoke).
The main thread never recieve a message to call my Invoked method. Everything stop inside System.Security.CodeAccessPermission.Demand().
I am totally clueless in .Net security!
Can i bypass this by calling a SecurityPermision.Assert() before calling invoke? Should i start threads in special ways?
I find it odd if Invoke() is really forbited inside Intranet zone. There might be a secury issue with Invoke or MarshaledInvoke, but also there should be a way to allow Invoke inside the same assembly.
Regards.
|
|
|
|
|
Hi,
you seem to be right, but I don't know why this is happening. I never had any problems while using Invoke.
Robert
|
|
|
|
|
Ok, Thanks.
|
|
|
|
|
hi all
i want to catch my com port input from my window service ,, but i could not understand how to manage this ,, is there any code examle or code hint ,,,
i am not cleared how to create a window service like that
thanks in advance
hello
|
|
|
|
|
hellow to all ..
i wanna get the date and the time from the main server that i am connected to , how can i do this ?
thxx
|
|
|
|
|
u want to get it from a sql server or windpws server
if sql than
select getdate()
use this query
hello
|
|
|
|
|
Hi all,
i am currently working on security component. I develop the component as a http module and the same can be used by the developers by just adding the hhttp module to their application. But, the problem is what if i want the same to be worked with Windows applications. Is there any way the windows applications can make use of the http modules and http handlers.
ThanX in advance
Ramesh.Kanjinghat
|
|
|
|
|
Not really because you are not interacting with the ASP.NET pipeline in your Windows Forms. Without this pipeline, you will have no access to things like the Session or Response objects.
Arthur Dent - "That would explain it. All my life I've had this strange feeling that there's something big and sinister going on in the world."
Slartibartfast - "No. That's perfectly normal paranoia. Everybody in the universe gets that."
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hi
can we create a windows service in which we could detect that which key of the key board is pressed ,, if possible so how can we do that , thanks in advance
hello
|
|
|
|
|
Yes ,This can be done using windows Hooks
|
|
|
|