.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
MarieAdela
Imran Ghani
Post New Web Links

dllimport("mapi32.dll") changes the path context of application (i.e. relative paths start pointing

Posted By:      Posted Date: August 31, 2010    Points: 0   Category :WPF
 
I have a WPF desktop application. We use mapi32.dll to show a new outlook mail window to allow user to send an email. After user sends email / just closes the new mail window without sending email, relative path starts pointing to C:\Program Files\Microsoft Office\Office12. I have office 2007 installed.  How can I restore this relative path ?   Thanks & Regards, Nadeem Ullah


View Complete Post


More Related Resource Links

Designer crashes sometimes because application path becomes C:\Windows\system32

  
Sometimes VS crashes as it seems to execute the WPF designer in its directories or C:\Windows\system32. Sometimes it works fine as we can preview saved settings in the Designer. I have set application path as follows : ConfigFile = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "mixer.ser");<br/> When VS crashes I accept to debug it, the exception is : {"Access to the path 'C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\Common7\\IDE\\mixer.ser' is denied."}    System.Exception {System.UnauthorizedAccessException} ... or c:\windows\system32 Any ideas on how to fix this ?   Thank you !

how run my C# console application when i start the computer ?

  
hi i have build a console application (any listener) and i need that when i open the computer - this application will run. i don't have installation for hem (it a simple little .exe file) is there any way to do it through my C# code ? thank's in advance

How to Find out Windows service application path from Code ?

  
Dear frnds, Could you please help me to find out the path of  windows serivce exe ( application path ) from code?   Regards. Sajid P K  

"System.ArgumentException: Font '?' cannot be found" during application start up. Any ideas?

  
We have couple of users that get this error when they run our application.  I have never seen this problem before. Client says fonts are installed and Microsoft Sans Serif font is there as well. Also he states that user has Read permissions to %SytemRoot%Fonts folder. Any suggestions or ideas how to fix this problem will be appreciated. Thank you.  Here is the stack:   Exception: System.ArgumentException: Font '?' cannot be found.   at System.Drawing.FontFamily.GetGdipGenericSansSerif()    at System.Drawing.FontFamily.get_GenericSansSerif()    at System.Drawing.SystemFonts.get_DefaultFont()    at System.Windows.Forms.Control.get_DefaultFont()    at System.Windows.Forms.Control.get_Font()    at System.Windows.Forms.Control.AssignParent(Control value)    at System.Windows.Forms.Control.ControlCollection.Add(Control value)    at Bloomberg.SmartClient.Hosting.ErrorControl.InitializeComponent() in C:\Projects\Source\Client\ApplicationHosting\ErrorControl.cs:line 218    at Bloomberg.SmartClient.Hosting.ErrorControl..ctor(String appTitle, Boolean inPanel, Exception exception) in C:\Projects\Source\Client\ApplicationHosting\ErrorControl.cs:line 119    at Bloomberg.SmartClient.Hosting.ApplicationHost.OnDisplayError(ApplicationDescription appDescription, Excepti

"System.ArgumentException: Font '?' cannot be found" during application start up. Any ideas?

  
We have couple of users that get this error when they run our application.  I have never seen this problem before. Client says fonts are installed and Microsoft Sans Serif font is there as well. Also he states that user has Read permissions to %SytemRoot%Fonts folder. Any suggestions or ideas how to fix this problem will be appreciated. Thank you.  Here is the stack: Exception: System.ArgumentException: Font '?' cannot be found.   at System.Drawing.FontFamily.GetGdipGenericSansSerif()    at System.Drawing.FontFamily.get_GenericSansSerif()    at System.Drawing.SystemFonts.get_DefaultFont()    at System.Windows.Forms.Control.get_DefaultFont()    at System.Windows.Forms.Control.get_Font()    at System.Windows.Forms.Control.AssignParent(Control value)    at System.Windows.Forms.Control.ControlCollection.Add(Control value)    at Bloomberg.SmartClient.Hosting.ErrorControl.InitializeComponent() in C:\Projects\Source\Client\ApplicationHosting\ErrorControl.cs:line 218    at Bloomberg.SmartClient.Hosting.ErrorControl..ctor(String appTitle, Boolean inPanel, Exception exception) in C:\Projects\Source\Client\ApplicationHosting\ErrorControl.cs:line 119    at Bloomberg.SmartClient.Hosting.ApplicationHost.OnDisplayError(ApplicationDescription appDescription, Exception err

To get the relative path in the class library

  
Hello, I have to access a relative path of the XSD file to validate a XML file. The XML file and the XSD file are part of the class library. How do I access the relative path in the class library? In case of website, I would use server.mappath(path). Is there anything similar to get the virtual path to the corresponding physical directory on the server in the class library? Thanks

JS script file path screwed up after deploying MVC application

  
Hi,  I am relatively new to MVC, after deploying my MVC application as per Haack http://haacked.com/archive/2008/11/26/asp.net-mvc-on-iis-6-walkthrough.aspx i seem to have got a new problem. My Jquery doesnt seem to get recognized. I get "object doesnt support this property or method " at this line "jQuery(document).ready(function() {" i have tried all sort of things including changing the js script file path to relative and absolute, setting base tag etc. Kindly advice if the above method of deploying is right and if that is what is causing the issue and if there is some other way to handle the .mvc requests.   Thanks and Regards, Muzammil Ahmed

Relative path - different project

  

Hi there!

I have three projects inside my solution and i using some same images on all of three projects. How can i create relative path from one project to another?


How do I maintain relative paths and a navigation bar with master pages

  

Trying to integrate Expression Web project with Visual Studio .Net project, EW for design, VS for coding.

Master pages seem to be the approved model for 'consistent design' including nav bar etc., but a master

page in root with navbar containing relative path

eg: news/default.htm

when applied to a child page in

eg: register/login.aspx 

generates a composite path:

result: a href:[siteroot]/register/news/default.htm

vs intended result:

intended: a href:[siteroot]/news/default.htm

Rather defeats the object of master pages, if we can't use them 'down' the site tree, and manually building xml sitenode maps and using or coding providers seems overkill, especially since 'consistent look and feel' (including navigation) is precisely what master pages are already supposed to provide.

~/ application roots don't seem to work either (yet I used them profusely previously in custom controls for precisely this function) with web sites located under a server virtual directory

Bad enough needing ExpressionWeb dwt + master pages for a single site, but can't imagine relying on master pages (at all) until we get this basic functionality resolved. Trying hard to like Expression Web and MasterPages, and to learn to do things 'the proper way', but all th

Getting error when trying to start acroRd32.exe "Not a valid Win32 Application"

  

I am writing a .pdf file to a folder then attempting to silent print using acroRd32.exe. When I run the program I get the error 

"Not a valid win32 application"

The program is creating the pdf file correctly.


Thanks



 string pathToExecutable = @"c:\Program Files\Adobe\Reader 9.0\AcroRd32.exe";

     RunExecutable(pathToExecutable, @"/t ""C:\WR014v2_.pdf""     ""//ussnadprt/USNPA039""");




 private static void RunExecutable(string executable, string arguments)
        {
            ProcessStartInfo starter = new ProcessStartInfo(executable, arguments);
            starter.CreateNoWindow = true;
            starter.RedirectStandardOutput = true;
            starter.UseShellExecute = false;

            Process process = new Process();
            process.StartInfo = starter;
            process.Start();

            StringBuilder buffer = new StringBuilder();

            using (StreamReader reader = process.StandardOutput)
            {
                string line = reader.ReadLine();
                while (line != null)
                {
                    buffer.Append(line);
                    buffer.Append(Environment.NewLine);
                    line = reader.ReadLine();
                  

path relative

  

Hi to all,
I have a project in asp.net (VS2008) and I have a master page menu like this:

<li> <a href="contact.aspx"> contact </ a> </ li>
<li> <a href="archive.aspx"> archive </ a> </ li>
<li> <a href="hello/Default.aspx">story </ a> </ li>

And until they are root everything works fine.

On this site I have a folder named "hello".
Problem.
When I am inside the directory "hello" (a subdirectory), the menu shows me this link:

mysite / hello / hello / default.aspx

I tried to write
<li> <a href="~/contact.aspx"> contact </ a> </ li>
<li> <a href="~/archive.aspx"> archive </ a> </ li>
<li> <a href="~/hello/Default.aspx"> story </ a> </ li>

but going on the links I get redirected here:
mysite / hello / ~ / contact.aspx
or
mysite / hello / ~ / archive.aspx
or
mysi

application start

  

Hi


If I create a dataset in Application_Start - is that dataset available for the length of  application run time? if so how do I access it?


or do I have to store it in an application session (Application["SessionName"])



Thanks in advance


The virtual path '/_catalogs/masterpage/v4.master' maps to another application, which is not allow

  

Hi,

i am creating my asp.net solution on the sharepoint(asp.net website)

(i using sharepoint2010-s1 and visual studio2010 and .net3.5)

 i using the code 'this.MasterPageFile=_myTeamSite.MasterUrl'(_myTeamSite is instance of spweb)

when test the code,this point i recieved error:

The virtual path '/_catalogs/masterpage/v4.master' maps to another application, which is not allowed.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentException: The virtual path '/_catalogs/ma

MVC application won't start: code -2147023895

  

I started trying to refactor my code, and made some changes to the repositories of my application. The solution still builds successfully, but when I try to run it in debug mode, the app hangs for a time, then shuts down without starting completely. The error message I get is:

The program '[3256] WebDev.WebServer40.EXE: Managed (v4.0.30319)' has exited with code -2147023895 (0x800703e9).

Since I'm not getting an exception, and Googling the error didn't yield any useful results, I'm stuck at the moment. The exit code looks somewhat like the min value for an integer, but that doesn't really mean anything to me in this context.


Relative path

  

Hi


I have the following code in visual studio 2010:


TextBox1.Text = My.Computer.FileSystem.ReadAllText("C:\Users\Baby\Desktop\Simulator website\Resources\TextFile.txt")


It reads the text in the textfile and displays it in the textbox. However, this link only works on my computer. How do I change the code so that when published online, it still works on anybody's PC? I think i need to refer to a relative path, but do not know how this should be done.


Many thanks


How to get start facebook application development with asp.net c #

  

Hi friends

I want to make a simple application in facebook with asp.net c #, i have Visual Studio 2010

i dont have idea ! how to start with Visual studio 2010


- a facebook user can add my application in page & see some buttons & video over there & post somthing on application


Please help me !!


Thanks in advance


Start project from view => full view path appended to the URL => 404

  

Hello,

If I start the project while in a view, it appends that view name (and path) to the URL, and I get a 404 error.

http://localhost:37547/Views/Home/SomeView.aspx 

If I then switch to any non-view, like the controller and hit F5, it starts up with no additional URL and gets routed to the default controller.

http://localhost:37547/ 

 Is there a way to fix this? Is it an option (to not pass the view url on debug), or a routing cfg issue? I'm no MVC expert.

routes.MapRoute(	"Default", "{controller}/{action}/{id}", new { controller = "Home", action = "Index", id = "" } );

Thank you 


Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend