|
you are correct.. I can write dll. but i had already written in VB .Net so if i can find out the way of solving the problem then I don't have to write the dll again.
but I had tried using ShellExecuteEx to call the second program and passing arguments with Visual Studio 6.0. and HAD no problem.
but after I upadated those programs to .Net and I got error message on
VB.Command() to read the arguments, which are passed by first program (written in c++) in the second program.
the error message is telling
<br />
The application attempted to perform and operation not allowed by the security policy. The operation required the SecurityException. To grant this application the required permission please contact your system administrator, or use the Microsoft .NET security policy administration tool<br />
I click on HELP on the error message and I went to Microsoft .Net security policy administration tool and did all the steps as I found in HELP.
Then it works.. I had no more error and the programs are running as I wanted.
by the way.. all the programs are on shared drived.
BUT the problem is I can't do anything from different machine.. the programs are only running perfectly from my machine.. not from other machine. and everybody else also has the permission to access that Shared Drive.
So I dont' really understand why I'm getting error running the same programs which are perfectly running from my machine?
|
|
|
|
|
hi there
well there is not a problem with .NET
actually .NET is platform independent
there a special level of security implemented in .NET
Operating systems and runtime environments typically provide some form of isolation between applications running on the system. This isolation is necessary to ensure that code running in
one application cannot adversely affect other unrelated applications.
Typically, isolation means
A) Faults in one application cannot affect other applications by bringing down the entire process.
B) Applications can be independently stopped and debugged.
C) Code running in one application cannot directly access code or resources from another application; doing so could introduce a security hole.
D) The behavior of running code is scoped by the application it runs in.
In modern operating systems, this isolation has historically been achieved using process boundaries. A process runs exactly one application and that process scopes the resources that are available for that process to use. For example, memory addresses in Win32 are process relative---a pointer in one process is meaningless in the context of another process.
The Common Language Runtime relies on the fact that code is type safe and verifiable to provide fault isolation between domains. By relying on the type safe nature of the code, application domains provide fault isolation at a much lower cost than the process isolation used in Win32.
Because isolation is based on static type verification, there is no need for hardware ring transitions or process switches. In many respects, application domains are the Common Language
Runtime equivalent of a Win32 process.
The runtime creates an application domain for each runtime application; each application domain can have an associated configuration file. Application domains isolate separate applications which run within a process. The combination of an application domain and configuration information create isolation for the application
The way in which application domains are created affects the permissions which assemblies have when running in the domain. For basic web-application scenarios, where the web page does not provide a LINK tag to a configuration file, the runtime creates an application domain on a per-site basis. Domain-neutral assemblies are only shared between application domains and assemblies with identical permission sets. A domain-neutral assembly called by two application domains with dissimilar permission sets is loaded into the domain neutral area twice. With the
exception of mscorlib of which there is only one copy of the code, all statics and local data are cloned.
An application can have multiple application domains running on its behalf. An application domain is the unit of code loading and unloading. Note that you can have multiple application domains in one process. Each type is loaded into the same application domain as its caller, or a caller can request that a type be loaded into a new application domain.
There are no direct calls between objects in different application domains;
instead, a proxy is used. Application domains can be debugged independently
so go, create a application doamin , then set its security policy and then do your work
i think that this will help you
VickyMD A Specialist in Message Digest Security
|
|
|
|
|
I wrote excel automation using VB.Net
the program takes exiting excel file name and open it, do some fixing and code for the file and let the user printpreview it. Then the program call WaitForSingleObject(hwnd,INFINITE) to pause the program until the user close the excel application.
The problem:
WaitForSingleObject() is waiting forever because the excel application process is still exit ( if you go to process of TaskManager you will see excel is still there) eventhough the user close excel and it is not on the screen anymore..
why the excel application didn't get closed and how can i make sure the excel application get closed when the user closed the application?
|
|
|
|
|
It's still running because your app is holding a reference to an Excel app object.(Excel.Application) It won't close until you release that reference. But, you can't release that reference until the user clicks Close.
RageInTheMachine9532
|
|
|
|
|
I can't release that reference until the user clicks Close.. So how could I let WaitForSingleObject knows that excel application get closed by user?
how could I resume or unpause my program when the user to close the Excel application?
|
|
|
|
|
You can't use WaitForSingleObject to do that because the process never closes. You have to get the event that Excel fires when the Workbook is closed. Excel will never close until you release that Excel.Application reference...
RageInTheMachine9532
|
|
|
|
|
When you say release the Excel.Applicatin reference means..the code should be look like following
myExcel.Applilcation.Quit()<br />
myExcle.Application = Nothing<br />
Is it the way to realease the Excel.Application reference?
If so I have it in my code and it is still not terminating Excel process.
I have the function that gets the event when excel workbook is closed.
How about killing the process.
If I can get process ID of Excel application, is there any function that kills the process given by process ID??
|
|
|
|
|
You could kill the process off, but it's not necessary. It will close completely when your app quits. Here's a little code example to do it:
Dim proc As Process
appExcel.Quit()
appExcel = Nothing
Dim exProcess() As Process = Process.GetProcessesByName("Excel")
If exProcess.Length > 0 Then
For Each proc In exProcess
proc.Kill()
Next
End If
RageInTheMachine9532
|
|
|
|
|
This will also kill off instances of Excel that were started outside of the app in question. Not only that, but using Kill instead of CloseMainWindow (in this case, not generally) will ensure two things:
1) You won't get a save prompt for any workbooks that weren't saved in the instances you didn't want closed, making it quite likely that your users will lose data if they run multiple instances of Excel while using your app.
2) Your users will not like you very much.
Charlie
if(!curlies){ return; }
|
|
|
|
|
He asked, I supplied a method to do it! I know it's a bit of an overkill but its simple and it works.
RageInTheMachine9532
|
|
|
|
|
Anybody built their own property editors.
I have a gradient like object, with a start and end color, and some other custom stuff. I'd like to pop up a dialog to edit the details of the gradient, but I'm finding the docs on doing so a little hard to understand.
Nursey
|
|
|
|
|
anyone know about any webpage that teach ppl about text file handling in VB.net?
i wish to learn all the basic file and stream IO to handle a normal text associate with my project
heard that there are many methods in file and stream, i hope can get the easiest..
|
|
|
|
|
|
i am relatively new to visual basic .net so these questions will probably be on the dumb side. i bought visual basic .net standard Ed. (i couldn't afford to get the studio version) and was wondering if the .net framework SDK came with it, if not should i install it. does it also come with the redistributable package, or would i have to download that too. Finally, today i found an update for the SDK framework documentation that came out in October, should i download that also. any help on these things would be greatly appreciated.
Thanks.
Dave Pursey.
|
|
|
|
|
The framework and the SDK come with visual studio, you don't have to install them again.
The redistributable package contains only the framework, without the SDK. I think it is included in the visual basic installation - it has to be installed only on other machines to run .net applications.
|
|
|
|
|
Hi, does anybody know where how can I append new elements to an existing xml file with the xmltextwriter?.
Anyother apprach would be appreciated too...
Thanks in advance.
|
|
|
|
|
Hi all!
I’m new to the group; I had a friend in my computer science class tell me about the group. So my problem is this.
I’m building a program for a charity group what they want it to do is take a picture of someone via webcam and then email it to anyone the use specifies a lot like the one at the Microsoft Museum If anyone has been there. So it has turned into my class project. I have ran into a problem with the sending of the email.
The program won’t be using a local SMTP server it will be using one like Comcast (smtp.comcast.net) when I run the program everything is fine until it runs the last line of code and then I get this error message.
An unhandled exception of type 'System.Web.HttpException' occurred in system.web.dll
Additional information: Could not access 'CDO.Message' object.
I was wondering if anyone could help me with it?
I have tried declaring the SMTP server in different areas but nothing seems to work
Thanks for any help
<br />
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click<br />
Dim <big>objEmailMessage</big> As System.Web.Mail.MailMessage<br />
Dim objSMTPServer As System.Web.Mail.SmtpMail<br />
objSMTPServer.SmtpServer = "smtp.comcast.net"<br />
<br />
objEmailMessage = New System.Web.Mail.MailMessage<br />
With objEmailMessage<br />
.To = "crazyboutcomputers1@comcast.net"<br />
.From = txtFrom.Text<br />
.Subject = "Great Job!"<br />
.Body = "Want all my money?"<br />
<br />
End With<br />
<br />
<big>objSMTPServer.Send(objEmailMessage)</big><br />
<br />
End Sub<br />
The code in red at the bottom is what im have truble with
and when i click go to definition it gos to the one in green at the top.
Agen Thanks for any Help
|
|
|
|
|
Your problem is that you instantiated an SmtpMail object. You don't have to. SmtpMail is one of those objects that you just use, kind of like a service that's been declared already. Just a little tweak of your code results in this:
Dim objEmailMessage As System.Web.Mail.MailMessage
objEmailMessage = New System.Web.Mail.MailMessage
With objEmailMessage
.To = "crazyboutcomputers1@comcast.net"
.From = txtFrom.Text
.Subject = "Great Job!"
.Body = "Want all my money?"
End With
SmtpMail.SmtpServer = "smtp.comcast.net"
SmtpMail.Send(objEmailMessage)
This should work for you. Oh! Don't forget the reference to System.Web!
RageInTheMachine9532
|
|
|
|
|
the error I'm geting now is
( name smtpmail not decalrad )
Its refuring to the last 2 lines of code.
|
|
|
|
|
Do you have this at the top of your code? I assumed you did already, based on your example. My mistake!
Imports System.Web.Mail
RageInTheMachine9532
|
|
|
|
|
I want autogenerated column every time I save Information.
In case i delete a record then,
Eg
The auto generated Nos are 1 2 3 4 5, and i remove 3 and 4 then the 5th record must automatically take the place of the 3rd record(just like what happens in Excel)How do i do it?
|
|
|
|
|
If the autogen'd numbers are the primary key, then you don't get to do that. Once an autogenerated number is used it is never used again, even if it has been deleted.
The only way your going to accomplish this is if you generate the number yourself and keep track of which numbers have been used and which hasn't. More trouble than it's worth...
RageInTheMachine9532
|
|
|
|
|
Hai,
Any body know about disabling javascript errors/popups on AxWebbrowser?
Thanks in advance.
Ajai
|
|
|
|
|
Hi All,
How can i bind a datasource(dataset or datatable) for a crystal report in runtime.And also how can i insert a database field in the crystal report at runtime.
Can any one hep me on this?
Regards
Shabu.K
|
|
|
|
|
Hi
If any one knows about usage of Comm .net ,please help me ......let me say thanxs in Advance
Thanxs
|
|
|
|