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
A

Axonn Echysttas

@Axonn Echysttas
About
Posts
172
Topics
63
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Bug in ShowWindow in Windows 7
    A Axonn Echysttas

    Hello everybody. For *two weeks*, each day since I installed Windows 7, I have been struggling to get something to work. Something which worked perfectly ok in XP. It's driving me mad, poisoning my life, ruining my days. Why such a simple task works SO CHAOTICALLY!? I think I discovered a bug in Windows 7, specifically in the way the ShowWindow function works in the standard theme (Aero). To demonstrate this, I uploaded 2 C# WinForms applications and their source code. http://www.axonnsd.org/W/P007/BugsDemo.rar HideableApplication represents an application which you can hide in the SysTray when you close it. Double clicking the SysTray icon reveals it and right clicking will reveal the "Exit" option. HideableApplicationRevealer attempts to show HideableApplication's window. The reason I need to accomplish this task is because I minimize my Total Commander and FireFox to the Tray and I want to bring them back via a HotKey. Total Commander offers such a functionality but it is broken. On Windows XP I managed to accomplish both these tasks without any problems, using the code I attached. On Windows 7, the behavior is erratic at best, and non-functional at worst. When HideableApplication runs inside Visual Studio everything works: - Trying to reveal it via HideableApplicationRevealer from Visual Studio => SUCCESS - Trying to reveal it via manual execution of HidebleApplicationRevealer.exe from Debug folder => SUCCESS - Trying to reveal it via running HideableApplicationRevealer.exe via keyboard shortcut => SUCCESS - Trying to reveal it via running HIdeableApplicationRevealer.exe via a Scheduled Task with Admin Rights => SUCCESS. When HideableApplication was executed manually (via .exe from Debug folder) AND Visual Studio IS STARTED, it works if I use admin rights or run it manually: - Trying to reveal it via HideableApplicationRevealer from Visual Studio => FAIL - Trying to reveal it via manual execution of HidebleApplicationRevealer.exe from Debug folder => SUCCESS - Trying to reveal it via running HideableApplicationRevealer.exe via keyboard shortcut => FAIL - Trying to reveal it via running HIdeableApplicationRevealer.exe via a Scheduled Task with Admin Rights => SUCCESS. - Trying to reveal it via running HideableApplicationRevealer.exe via keyboard shortcut (start menu) which has been given ADMIN RIGHTS => SUCCESS. When HideableApplication was executed manually (via .exe from Debug folder) AND Visual Studio HAS BEEN SHUT DOWN: it only works if I run it manually (double clic

    C# csharp visual-studio winforms debugging help

  • In Windows 7 I can't get a window to be shown in foreground (Win32 API)
    A Axonn Echysttas

    Anybody? ::- (

    I thank you for helping me... by contributing! Axonn @ SourceForge ^

    C# csharp visual-studio windows-admin json tutorial

  • In Windows 7 I can't get a window to be shown in foreground (Win32 API)
    A Axonn Echysttas

    Hello ::- ). I've recently upgraded to Windows 7 and, naturally, some of my apps have run into a black, merciless wall of changed behaviors. One of the things which stopped working are my applications to bring stuff out of SysTray. Some applications don't have good methods to bring them out of SysTray via hotkey. Total Commander for example sometimes fails and you have to press Enter. So I made an application which worked fine on XP. But now, instead of bringing it back from SysTray and popping it in my face, it just blinks it on the Taskbar. Before you say "ForegroundLockTimeout", know that I already set this to 0 across the registry. What I'm trying to do is to make Total Commander come out from SysTray via a hotkey. The hotkey actually launches my C# application. In my C# application I do this:

    int hwndTC = Win32API.FindWindow("TTOTAL_CMD", null); //Try to find the Total Commander window.
    Win32API.ShowWindow((IntPtr)hwndTC, Win32API.ShowWindowCommand.Show);
    Win32API.ShowWindow((IntPtr)hwndTC, Win32API.ShowWindowCommand.ShowMaximized);
    Win32API.ShowWindow((IntPtr)hwndTC, Win32API.ShowWindowCommand.Maximize);
    Win32API.SetForegroundWindow(hwndTC);

    But the result is that instead of TC showing itself in my face, I see it blinking on the TaskBar. One very strange thing is that when Visual Studio is running (and thus, the .vshost.exe is running), everything works fine. As soon as I shut down VS, the blinking stuff happens again.

    I thank you for helping me... by contributing! Axonn @ SourceForge ^

    C# csharp visual-studio windows-admin json tutorial

  • Microsoft Document Explorer is driving me CRAZY
    A Axonn Echysttas

    *laugh* nice reply Alan. Thanks! It worked! ::- D. Pfew. So it was me who was stupid and didn't investigate well enough the options. Thanks again for showing the way and getting me rid of one of my greatest frustrations EVER.

    -= E C H Y S T T A S =- The Greater Mind Balance Blending C++ with COM ^ Have a break on my website! Spread the word? Please?

    C# c++ css com tools regex

  • Microsoft Document Explorer is driving me CRAZY
    A Axonn Echysttas

    Does anybody know to work with this junk of help system Microsoft made? I search for "apples oranges cucumbers" and I get 500 results of pages that match ANY of the terms, not ALL the terms as one would normally surmise. No wonder all Microsoft's search tools get a beating from Google. This is less functionality that friggin Notepad! GRRRRRRRRRRRRRR. ^ |_______ and hey, I'm not angry at you ::- D. Maybe it's my fault and I don't know how to use it. Does ANYBODY know???

    -= E C H Y S T T A S =- The Greater Mind Balance Blending C++ with COM ^ Have a break on my website! Spread the word? Please?

    C# c++ css com tools regex

  • ClientID messes with my textbox - please help
    A Axonn Echysttas

    Hi and thanks for answering Abhishek! No, this is not an IsPostBack problem. I'm not a beginner. Simply uncommenting that line will make the value reach the server again! That's the weird thing. And it works for you perhaps because you don't have that textbox in a dinamically created User Control. What I'm wondering is WHY EXACTLY uncommenting that shitty line makes everything work! I can't believe it!

    -= E C H Y S T T A S =- The Greater Mind Balance Blending C++ with COM ^ Have a break on my website! Spread the word? Please?

    ASP.NET question c++ com tools help

  • ClientID messes with my textbox - please help
    A Axonn Echysttas

    Hi everybody. Does anybody even IMAGINE why writing this in a RegisterStartupScript block would cause my textbox to lose its value upon postback???

    Page.ClientScript.RegisterStartupScript(GetType(),"document.getElementById('" + txtp.ClientID + "').value; "...... etc
    txtp.Text = "-1";

    Let me say that one more time. I am reffering to the ClientID of "txtp" in a RegisterStartupScript. I merely take the value from it, that's all. And when the page retuns, txtp always has its default value, the one I populate in it, see the next line, when I set -1. But if I comment out that line with the .ClientID, then when the pages posts back, after I repopulate, even if I set -1 to the textbox, I DO GET THE CORRECT number in it, which was entered client-side, before the user presses the submit button. With .Client ID line uncommented: 1. Load dynamic user control in which txtp is. 2. Set -1, register startup script 3. User writes 2 in the textbox 4. Submit 5. Value in textbox is -1. WRONG With .Client ID line commented: 1. Load dynamic user control in which txtp is. 2. Set -1, register startup script 3. User writes 2 in the textbox 4. Submit 5. Value in textbox is 2. CORRECT Somebody please help me out here....... I'm way over my head, I don't understand a bit of what is happening, even though I have studied the lifetime of the page and I am loading the control dinamically at the master's page Init. But even if I messed something up in the lifetime, THIS STILL DOESN'T explain why a silly .Client ID messes everything up! Weird!

    -= E C H Y S T T A S =- The Greater Mind Balance Blending C++ with COM ^ Have a break on my website! Spread the word? Please?

    ASP.NET question c++ com tools help

  • Microsoft Sync Framework
    A Axonn Echysttas

    Hi everybody. Maybe some of you have better experience with the Sync Framework than I have. I am trying to sync an XML file and some images between my desktop and a PDA, using C#. I saw there is a sample of using Microsoft Sync Framework with a device, but it uses Web Services and I would very much prefer to do without those. I already built a .Net Framework 3.5 C# Windows Forms Application and a similar thing (3.5) on the Mobile device. Do you think it is possible to use WCF or SyncFramework to get some files Desktop <-> PDA? Thank you for your time ::- ) !

    -= E C H Y S T T A S =- The Greater Mind Balance Blending C++ with COM ^ Have a break on my website! Spread the word? Please?

    C# csharp wcf c++ dotnet winforms

  • FOR EXPERTS: Template Class: Type Constraints
    A Axonn Echysttas

    Ah, damn. I had using System.Collections.Generic; but not using System.Collections; Thank you Mirko! ::- ) That fixed it.

    -= E C H Y S T T A S =- The Greater Mind Balance Blending C++ with COM ^ Have a break on my website! Spread the word? Please?

    C# help csharp html visual-studio tutorial

  • FOR EXPERTS: Template Class: Type Constraints
    A Axonn Echysttas

    Note that the MSDN sample uses the non-generic version of IEnumerable (where T : IEnumerable[T]), meaning that T can be any enumeration.

    You mean where T : IEnumerable Ok but how do you declare it so? Because if I declare it so, it says Error 1 Using the generic type 'System.Collections.Generic.IEnumerable' requires '1' type arguments D:\Order\A1.FunFoll Administrator [FFA]\2009-01-25\FunFollAdmin\frmMain.cs 48 33 FunFollAdmin I used the code directly from MSDN interface IMyInterface { } class Dictionary[TKey, TVal] where TKey : IComparable, IEnumerable where TVal : IMyInterface { public void Add (TKey key, TVal val) { } } Same error as above!!! I don't get it! Oh boy......... ::- ( Error 1 Using the generic type 'System.Collections.Generic.IEnumerable' requires '1' type arguments D:\Order\A1.FunFoll Administrator [FFA]\2009-01-25\FunFollAdmin\frmMain.cs 48 33 FunFollAdmin

    -= E C H Y S T T A S =- The Greater Mind Balance Blending C++ with COM ^ Have a break on my website! Spread the word? Please?

    C# help csharp html visual-studio tutorial

  • FOR EXPERTS: Template Class: Type Constraints
    A Axonn Echysttas

    Hey everybody... I got a question for advanced C# programmers. I've been playing around with type constraints for template classes, and I got stuck. I used [ and ] instead of < and > for template classes because I wanted to have HTML code for you to see better what code I got. In the C# 3.0 specification (and I will quote directly from Microsoft's document), it's said that this will work:

    class B[T] where T: IEnumerable {...}
    class D[T]: B[T] where T: IEnumerable {...}
    class E[T]: B[List[T]] {...}

    Because (so they say): "Since type parameters are not inherited, constraints are never inherited either. In the example below, D needs to specify the constraint on its type parameter T so that T satisfies the constraint imposed by the base class B[T]. In contrast, class E need not specify a constraint, because List[T] implements IEnumerable for any T." Now... I put this pre into VS 2008 and the compiler won't work. My pre:

    class B[T] where T : IEnumerable[T] { }
    class D[T] : B[T] where T : IEnumerable[T] { }
    class E[T] : B[List[T]] { }

    Error: "Error 1 The type 'System.Collections.Generic.List[T]' cannot be used as type parameter 'T' in the generic type or method 'FunFollAdmin.frmMain.B[T]'. There is no implicit reference conversion from 'System.Collections.Generic.List[T]' to 'System.Collections.Generic.IEnumerable[System.Collections.Generic.List[T]]'. D:\Order\A1.FunFoll Administrator [FFA]\2009-01-25\FunFollAdmin\frmMain.cs 46 10 FunFollAdmin" Even more......... not even this works:

    B[test] test = new B[test]();

    Error: "Error 1 The type 'FunFollAdmin.frmMain.test' cannot be used as type parameter 'T' in the generic type or method 'FunFollAdmin.frmMain.B[T]'. There is no implicit reference conversion from 'FunFollAdmin.frmMain.test' to 'System.Collections.Generic.IEnumerable[FunFollAdmin.frmMain.test]'. D:\Order\A1.FunFoll Administrator [FFA]\2009-01-25\FunFollAdmin\frmMain.cs 216 9 FunFollAdmin Error 2 The type 'FunFollAdmin.frmMain.test' cannot be used as type parameter 'T' in the generic type or method 'FunFollAdmin.frmMain.B[T]'. There is no implicit reference conversion from 'FunFollAdmin.frmMain.test' to 'System.Collections.Generic.IEnumerable[FunFollAdmin.frmMain.test]'. D:\Order\A1.FunFoll Administrator [FFA]\2009-01-25\FunFollAdmin\frmMain.cs 216 28 FunFollAdmin" Even though I have implemented the class test correctly:

    class test : IEnumerable\[int\]
    {
      public test () { }
      #region IEnumerable\[int\] Memb
    
    C# help csharp html visual-studio tutorial

  • Strange VC++ Debugger behavior
    A Axonn Echysttas

    We replied in the same time : D. Thank you anyway! Appreciated.

    -= E C H Y S T T A S =- The Greater Mind Balance Blending C++ with COM ^

    C / C++ / MFC c++ debugging sharepoint com question

  • Strange VC++ Debugger behavior
    A Axonn Echysttas

    Hm. Found my own answer in the meantime. Apparently, the VC++ IDE has administrator privileges. If you're a little program like me, check this out: http://msdn2.microsoft.com/en-us/library/aa376868.aspx (see SE_SHUTDOWN_NAME) http://msdn2.microsoft.com/en-us/library/aa375202.aspx ...and for a nice example... http://msdn2.microsoft.com/en-us/library/aa376871.aspx

    -= E C H Y S T T A S =- The Greater Mind Balance Blending C++ with COM ^

    C / C++ / MFC c++ debugging sharepoint com question

  • Strange VC++ Debugger behavior
    A Axonn Echysttas

    Hi : D. I'm running XP SP2 and Visual C++ 6 SP 6. I'm very curious about why this behavior occurs. If I call this function while I'm debugging, it works! ExitWindowsEx(EWX_POWEROFF, 0); But if I run the debug-built or even release-built executables from my hard disk, it does't work! Why!? This is very strange. From the debbuger, the computer starts shut down procedure, but otherwise, no way. Thank you...

    -= E C H Y S T T A S =- The Greater Mind Balance Blending C++ with COM ^

    C / C++ / MFC c++ debugging sharepoint com question

  • HBITMAP size
    A Axonn Echysttas

    Ultra short question : D. hbmpBackground = (HBITMAP)LoadImage(NULL, (LPCSTR)Path, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE | LR_CREATEDIBSECTION); Can I find out the size of hbmpBackground? With x Heigh in pixels?

    -= E C H Y S T T A S =- The Greater Mind Balance Blending C++ with COM ^

    C / C++ / MFC question c++ com

  • BSTR in C++
    A Axonn Echysttas

    What's very interesting is that I managed to solve everything just like this: LPCSTR a = (LPCSTR)myBSTR; MessageBox(0, a, 0, 0); //-> it works, if you can believe it!!! Probably because I send only non-Unicode stuff from VB. Anyway, this is how it's gonna stay for a while and I don't intend to ever switch this program to Unicode. Works just fine like it is.

    -= E C H Y S T T A S =- The Greater Mind Balance Blending C++ with COM ^

    C / C++ / MFC question c++ com help

  • BSTR in C++
    A Axonn Echysttas

    Hhahahaah, Hi : D. That should be a lesson to me huh? To better remember stuff. Hm, however, this is to return a BSTR, I need the other way around. A Char from a BSTR. : D.

    -= E C H Y S T T A S =- The Greater Mind Balance Blending C++ with COM ^

    C / C++ / MFC question c++ com help

  • BSTR in C++
    A Axonn Echysttas

    LPCSTR d = _com_util::ConvertBSTRToString(FontInformation.Name); MessageBox(0, d, 0, 0); This still returns garbage data : ( ... what do you make of: "???r" instead of "Arial". And it's sure that it's a BSTR there. For example, my function works but doesn't process the BSTR correctly. It would be easier for me to fix my function ... if only I knew what's wrong : D.

    -= E C H Y S T T A S =- The Greater Mind Balance Blending C++ with COM ^

    C / C++ / MFC question c++ com help

  • BSTR in C++
    A Axonn Echysttas

    I replaced with wcslen and still same problem. I would prefer to understand how to convert it corectly, manually. That way I don't have to depend on more links and stuff that can break from one windows release to the other : ).

    -= E C H Y S T T A S =- The Greater Mind Balance Blending C++ with COM ^

    C / C++ / MFC question c++ com help

  • BSTR in C++
    A Axonn Echysttas

    Hi everybody. I got a tiny question about a strange problem I'm having when I'm trying to receive a string from Visual Basic into C++. I got a VB string saying "Arial". But when I'm receiving it in C++, it becomes "Ail". Probably some wide characters versus normal characters problem, as i get 1 character and the next not, and then the next, I get. In order to make the conversion I'm using these two functions. //Finds out the length of a BSTR. long GetLengthOfBSTR (BSTR Target) { long iRet = 0; //Result to return. long iCursor = 0; //Interator through the BSTR. bool bForever = false; //To cycle forever. //If the string is NULL. if (Target == NULL) return(0); //Returning zero length. while (!bForever) //Cycling forever. { unsigned int uiPiece = Target[iCursor]; //Piece by piece. //Until reaching the null termination of the string. if (uiPiece == 0) return(iRet); //Returning the computed length. else iRet++; //Increasing the length. iCursor++; //Increasing the BSTR iterator. } return -1; //Mostly to avoid warnings ::- ). } //Converts a BSTR to a Char. Needed when working with strings with Visual Basic. char *ConvertBSTRToChar (BSTR Target) { char *sResult; //Result to return. long iCounter; //Iterator. long iLength; //Length of Target. iCounter = iLength = GetLengthOfBSTR(Target); //Initializing. sResult = new char[iLength + 1]; //Creating a character big enough to hold the result. strcpy(sResult, ""); //Initializing. for (iCounter = 0; iCounter < iLength; iCounter++) //Going through the Target BSTR. { unsigned int uiPiece = Target[iCounter]; //Taking it piece by piece. sResult[iCounter] = uiPiece; //Adding it in the final result. sResult[iCounter + 1] = '\0'; //Adding null termination. } return sResult; //Returning computed char. } And then I do: LPCSTR c; c = ConvertBSTRToChar(StuffFromVB); MessageBox(0, c, "Test", 0); SO? Anybody here to enlighten me a bit about this? : ). Thank you very much for your time here anyway!

    -= E C H Y S T T A S =- The Greater Mind Balance Blending C++ with COM ^

    C / C++ / MFC question c++ com 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