Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
S

spif2001

@spif2001
About
Posts
77
Topics
15
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Call XP Mode shortcut programmatically [modified]
    S spif2001

    Sorry sorry sorry... stupid me... I didn't notice my projects in Visual Studio was set to x86. Setting them to Any CPU solved my problems. I guess when run as x86, the System32 part of the path gets redirected to the SysWOW64 folder. In which of course the desired files are not placed.

    I'm in the high-fidelity first class traveling set. And I think I need a Lear jet.

    C# help question csharp workspace

  • Call XP Mode shortcut programmatically [modified]
    S spif2001

    Bad copy paste. :) Fixed... Fixing the System32 part does not make any difference though. It still fails.

    I'm in the high-fidelity first class traveling set. And I think I need a Lear jet.

    C# help question csharp workspace

  • Call XP Mode shortcut programmatically [modified]
    S spif2001

    Hi I'm trying to call a XP Mode shortcut programmatically, but I keep getting the same error message: "problem starting C:\windows\system32\VMCPropertyHandler.dll The specified module could not be found" I tried with the following: string startPath = @"C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup"; Process p = new Process(); p.StartInfo.FileName = startPath + "\\XPModeInitializer (Windows XP Mode).lnk"; p.StartInfo.UseShellExecute = true; p.Start(); But I have also done many variants. I even tried making a bat file, that just call the link. The bat file itself works when double-clicked, but when called from within my code like the following snippet, I get the same error message: Process p = new Process(); p.StartInfo.FileName = Environment.CurrentDirectory + "\\CallXPModeInitializer.bat"; p.StartInfo.UseShellExecute = true; p.Start(); I also tried taking the shortcut parameters and using them myself like this: string file = System.Environment.SystemDirectory + @"\rundll32.exe"; string arguments = System.Environment.SystemDirectory + @"\VMCPropertyHandler.dll,LaunchVMSal ""Windows XP Mode"" ""||a9c104ed"" ""XPModeInitializer"""; Process p = new Process(); p.StartInfo.FileName = file; p.StartInfo.Arguments = arguments; p.StartInfo.UseShellExecute = true; p.Start(); But it produces the same error message, I'm confused at to why a direct use of the bat file works, when the call to the bat file from within C# fails!? How can I call a XP Mode shortcut from within C# code?

    I'm in the high-fidelity first class traveling set. And I think I need a Lear jet.

    modified on Wednesday, December 1, 2010 4:35 AM

    C# help question csharp workspace

  • Last node is not visible in TreeView because of scroll bar.
    S spif2001

    I found that adding this line to the forms load event (or where you set the items in the treeview) helps:

    this.treeView.Height = (this.treeView.Height / this.treeView.ItemHeight) * this.treeView.ItemHeight + 3;

    I'm in the high-fidelity first class traveling set. And I think I need a Lear jet.

    C# help question

  • Detect sql server 2008 (Express)
    S spif2001

    That looks like a .NET library and I can't use .NET in InnoSetup - not directly anyway and I can't be sure of which .NET version is on the target machine, and if it has one at all. InnoSetup code is written in Pascal, so what I really need is a Pascal way of doing the check. :)

    I'm in the high-fidelity first class traveling set. And I think I need a Lear jet.

    Database question csharp database sql-server dotnet

  • Detect sql server 2008 (Express)
    S spif2001

    Hi First of all I have to say, that I'm in no way an SQL expert more likely an SQL dummy, so be warned. :) I'm am currently building an InnoSetup installer hierarchy and as a part of that I have made a prerequisite downloader+installer for various Microsoft items - .NET Frameworks, Windows Installers, Internet Explorers, MDAC etc. To detect the various components I use mostly registration keys, but as I played around with SQL Server 2005 Express I found out, that registration keys wasn't a good way detect it. Instead I tried creating an Ole object like this:

    function SQLServerExpress2005Exist(): Boolean;
    begin
    Result := True;
    try
    SQLServer := CreateOleObject('SQLDMO.SQLServer');
    except
    if MsgBox(CustomMessage('SQLServerExpress2005Msg'), mbConfirmation, MB_YESNO or MB_DEFBUTTON2) = IDYES then Result := False;
    end;
    end;

    This method works when trying to detect an SQL Server 2005, but when I try using the same method on my computer with a running SQL Server 2008 Express, it doesn't work i.e. the code enters the except block. What is the best way to detect an installed (not necessarily running) SQL Server 2008?

    I'm in the high-fidelity first class traveling set. And I think I need a Lear jet.

    Database question csharp database sql-server dotnet

  • BeforeUninstall event + Process problems
    S spif2001

    Hi I'm trying to auto-uninstall a COM service from componentservices with the help of Regsvcs.exe's /u command, but my code doesn't seem to work. I have a deployment project, which in CustomAction/uninstall uses af custom install class to, among other things, unistall the service. I have checked that my assemblypath(see code) is correct. I have tried to run Regsvcs /u from a command prompt, and the result is as expected - the service dissapears from the componentservices. When I use Regsvcs /fc during install via my custom install class it works. The service places itself nicely into componentservices. The only mysterious thing I can observe during the whole uninstallation process is, that the BeforeUninstall event seems to fire very late in the uninstall process. Can anyone tell me, why this code whont delete the service from the componentservices?:confused: private string regsvcsPath = Environment.GetEnvironmentVariable("windir") + @"\Microsoft.NET\Framework\v2.0.50727\regsvcs.exe"; public CustomInstaller() { InitializeComponent(); this.BeforeUninstall += new InstallEventHandler(CustomInstaller_BeforeUninstall); } void CustomInstaller_BeforeUninstall(object sender, InstallEventArgs e) { try { string parameters = @" /u " + this.Context.Parameters["assemblypath"]; ProcessStartInfo psi = new ProcessStartInfo(this.regsvcsPath, parameters); Process.Start(psi); } catch (Exception ex) { MessageBox.Show(ex.ToString(), "Uninstall error"); } }

    C# help csharp com sysadmin question

  • SD card properties
    S spif2001

    See solution here .

    C# question csharp

  • Programming windows form in .NET
    S spif2001

    Try a look around here: http://www.windowsforms.com I'm in the high-fidelity first class traveling set. And I think I need a Lear jet.

    C# csharp

  • SD card properties
    S spif2001

    Hi I have a SD card in a Pocket PC, and now I would like to get it's properties. Total size, used space and free space to be exact. How do I do that in C#?

    C# question csharp

  • How to make a setup project which install two applications
    S spif2001

    I guess you mean the .net framework and not the sdk. If so, take a look at 1 of these articles: Visual Studio 2005 http://msdn.microsoft.com/msdnmag/issues/04/10/Bootstrapper/ Visual Studio 2003 http://msdn.microsoft.com/vstudio/downloads/tools/bootstrapper/ I'm in the high-fidelity first class traveling set. And I think I need a Lear jet.

    C# help csharp tutorial workspace

  • Service will not start
    S spif2001

    Bad english - it does fire the afterinstall event. It is the sc.start() call that doesn't work.

    C# question csharp com workspace

  • How to call managed function from remote device?
    S spif2001

    Features not supported in .Net Compact Framework Being a subset of .Net Framework, not all features are supported by .Net Compact Framework. Following are some key features that are missing in compact framework. [Reference 2] 1. ASP .Net: Primarily being a rich client platform, it doesn’t provide any ASP .Net support. 2. Assemblies and GAC: There is no support for multimodule assemblies. 3. COM Interoperability: Even though interoperability with COM objects is not supported, there are other ways of accessing a COM object. Platform Invoke method can be used to call native DLLs which in turn can access COM DLLs. 4. Asynchronous Delegates: Not supported. 5. Reflection: No support for System.Reflection.Emit namespace. 6. XML Web Services: Developers cannot host web services under .Net Compact Framework. 7. Remoting: Cannot develop Remoting applications. 8. Printing: No support for printing functionalities. 9. GDI+: Advance GDI support is missing in Compact Framework. 10. XML: XML Schema validations and XPath are not supported. Taken from: http://www.c-sharpcorner.com/Code/2004/June/DevelopCFApps.asp [^] I'm in the high-fidelity first class traveling set. And I think I need a Lear jet. -- modified at 9:49 Monday 9th January, 2006

    C# csharp tutorial question

  • Service will not start
    S spif2001

    That is actually what I am trying :), but I need a CustomInstall event to fire AfterInstall in order to start the service - but it doesn't. I'm in the high-fidelity first class traveling set. And I think I need a Lear jet.

    C# question csharp com workspace

  • can we use .net dlls in win32 applicatiuons
    S spif2001

    Take a look at this article: http://www.codeproject.com/dotnet/cominterop.asp[^] I'm in the high-fidelity first class traveling set. And I think I need a Lear jet. -- modified at 9:46 Monday 9th January, 2006

    C# csharp delphi data-structures tutorial question

  • Service will not start
    S spif2001

    Why can't I install and start a service using the following code? private void Test() { try { Process p = Process.Start(@"C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\regsvcs", @"/fc C:\My.dll"); p.WaitForExit(); if(p.ExitCode != 0) { Console.WriteLine("My service install(RegSvcs) failed!!!"); Console.WriteLine("ExitCode was: "+p.ExitCode); return; } ServiceController sc = new ServiceController("My",Environment.MachineName); sc.Start(); Console.WriteLine("My service started!"); } catch(Exception ex) { Console.WriteLine("Install failed - Exception!!!"); Console.WriteLine(ex.ToString()); } } RegSvcs works fine and the service places itself in the COM+ services (I can see it via the ServiceComponents app), but when the code reaches sc.Start(), it throws an Exception with the following information: System.InvalidOperationException. Service My was not found on computer 'MBU'. InnerException = System.ComponentModel.Win32Exception (Danish)Den angivne tjeneste findes ikke som en installeret tjeneste (Translated)The service does not exists as an installed service Has it something to do with the service being a DLL and not an EXE and therefore you can't start it with a ServiceController? I can start it manually, by using the Componentservices app and right click on the "My" service. That means the service works, but just can't be started by the above shown code. What is going on?

    C# question csharp com workspace

  • Hide Form
    S spif2001

    I tried that too :) to no avail. And I got it working using Hide(), except at startup. I tried to Hide() it in another thread like this: public MainForm() { InitializeComponent(); Thread t = new Thread(new ThreadStart(HideFunc)); t.Start(); }//constructor private void HideFunc() { Thread.Sleep(1); this.Hide(); } It works (even though the Form flickers before hiding). If I remove the Sleep(1) call the Form whont hide!? Am I missing some fundamental programming issue here or what? I'm in the high-fidelity first class traveling set. And I think I need a Lear jet.

    C# question help

  • Form Inheritance
    S spif2001

    Try to write the whole namespace in front of the initialization. ex. System.Windows.Forms.Form f = new System.Windows.Forms.Form(); ^^replace with the _Form's namespace. There may be another Form with same name which is inaccesable (private or protected) I'm in the high-fidelity first class traveling set. And I think I need a Lear jet.

    C# help oop

  • Form Inheritance
    S spif2001

    Is the _Form declared as protected instead of public as it should be? I'm in the high-fidelity first class traveling set. And I think I need a Lear jet.

    C# help oop

  • Hide Form
    S spif2001

    hmmm - that works when my app starts, but when I Maximize it and the Minimize it again, the Form bar reappears... :confused: I'm in the high-fidelity first class traveling set. And I think I need a Lear jet.

    C# question help
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups