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
S

sashoalm

@sashoalm
About
Posts
453
Topics
95
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Why does Microsoft (MSDN) documentation suck so much?
    S sashoalm

    I don't agree with that, I've always found it quite thorough and detailed.

    In Soviet Russia the government regulates the companies.

    The Lounge question json

  • Abject Oriented Programming.
    S sashoalm

    I've been inspired to fully implement the Abject-Oriented Technology in my next project.

    There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition. Blaise Pascal

    The Lounge com question

  • How can I give write access to a file to all users? [modified]
    S sashoalm

    I need to programatically give write-access to a file that is created by my program (which runs from an administrator account) to all users. How can I set the access-control lists for a file? I'm using CreateFile to create the file. [Edit] I'm talking about doing the equivalent of 'chmod a+w' to a file. How can I do that on Windows? I know NT has file permissions called ACL. Is this the way to do it?

    There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition. Blaise Pascal

    modified on Thursday, October 21, 2010 4:49 AM

    C / C++ / MFC question delphi

  • Don't download this song
    S sashoalm

    Prepare your guitar-tommy gun and wait for the police.

    There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition. Blaise Pascal

    The Lounge delphi com architecture question

  • Don't download this song
    S sashoalm

    ... Go and buy the CD like you know that you should ...

    There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition. Blaise Pascal

    The Lounge delphi com architecture question

  • Don't download this song
    S sashoalm

    That actually's the name. It's one of Weird Al Yankovic's parodies. Very good though. Search for "don't download this song yankovic" on google video.

    There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition. Blaise Pascal

    The Lounge delphi com architecture question

  • Don't download this song
    S sashoalm

    Don't Download This Song[^] by Al Yankovic Lyrics: Once in a while maybe you will feel the urge To break international copyright law By downloading MP3s from file-sharing sites Like Morpheus or Grokster or Limewire or KaZaA But deep in your heart you know the guilt would drive you mad And the shame would leave a permanent scar 'Cause you start out stealing songs and then you're robbing liquor stores And sellin' crack and runnin' over school kids with your car So don't download this song The record store's where you belong Go and buy the CD like you know that you should Oh, don't download this song Oh, you don't wanna mess with the R-I-double-A They'll sue you if you burn that CD-R It doesn't matter if you're a grandma or a seven year old girl They'll treat you like the evil hard-bitten criminal scum you are So don't download this song Don't go pirating music all day long Go and buy the CD like you know that you should Oh, don't download this song Don't take away money from artists just like me How else can I afford another solid gold Hum-Vee And diamond-studded swimming pools These things don't grow on trees So all I ask is, "Everybody, please..." Don't donwload this song (Don't do it, no, no) Even Lars Ulrich knows it's wrong (You can just ask him) Go and buy the CD like you know that you should (You really should) Oh, don't download this song Don't donwload this song (Oh please, don't you do it) Or you might wind up in jail like Tommy Chong (Remember Tommy) Go and buy the CD (Right now) like you know that you should (Go out and buy it) Oh, don't download this song Don't download this song (No, no, no, no, no, no) You'll burn in hell before too long (and you'll deserve it) Go and buy the CD (Just buy it) like you know that you should (You cheap bastard) Oh, don't download this song

    There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition. Blaise Pascal

    modified on Friday, October 8, 2010 6:27 PM

    The Lounge delphi com architecture question

  • Bizarre error with Borland C++ and GetUserName
    S sashoalm

    My school teacher used to make the same mistake, because we had just recently switched to Borland C from Turbo Pascal. She would write on the blackboard programs like that:

    char* text;
    scanf("%s", text);

    // do stuff

    The computers were on DOS at that time, and because there are no access violations in DOS, it worked most of the time - unless you happened to overwrite something important. Now in hindsight, that explains why we had to reboot the computers so often.

    There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition. Blaise Pascal

    Clever Code help c++ delphi design tutorial

  • WM_COPYDATA fails with error RPC_E_CANTCALLOUT_ININPUTSYNCCALL [modified]
    S sashoalm

    I'm using dsoframer in my app, does this interfere with WM_COPYDATA? The error text is: "An outgoing call cannot be made since the application is dispatching an input-synchronous call." [Edit] I found a kb article[^] that seems to explain why this occurs: ------------------------------------------------------ See the beginning of chapter 13 in the OLE 2 Programmer's Reference Volume 1 for the categories of OLE calls. An understanding of these categories is required for this article. The majority of OLE calls are synchronous calls. A synchronous call to a different process yields to that process and waits for a reply from that process. In addition, OLE has input-synchronized calls that relate to the inplace-activation interfaces. Input-synchronized calls are implemented using an inter-process/inter-thread SendMessage. 16-bit Windows doesn't allow a task to yield while in an inter- process/inter-thread SendMessage because a system deadlock could occur. The deadlock occurs because a message for the sender could be present at the top of the shared system queue, and this prevents other tasks, including the recipient of the SendMessage, from retrieving their messages from the system queue until the sender does. The sender cannot retrieve its message because it is waiting for the inter-process/inter-thread SendMessage to return. In 32-bit Windows, each process has its own system queue and this architecture normally prevents deadlock problem from occurring. However, when one process is inplace active in another process's window, the system queues of the two processes are synchronized as in 16-bit windows, so the deadlock could occur. To prevent this, OLE stops synchronous OLE calls from being made while the caller is the recipient of an input-synchronized call. OLE determines if the caller of the synchronous call is a recipient of an input-synchronized call by using the InSendMessage() API. This broad check prevents a synchronous call from being made if the caller is currently a recipient of any inter-process/inter-thread SendMessage.

    There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition. Blaise Pascal

    modified on Tuesday, September 28, 2010 3:47 AM

    C / C++ / MFC help delphi com data-structures json

  • Who will write the game Trojans
    S sashoalm

    ???

    There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition. Blaise Pascal

    C / C++ / MFC game-dev question

  • Making an app single instance
    S sashoalm

    I've used FindWindow before, but I remember it had a lot of issues, for example (I don't remember) but didn't it fail if the window was minimized?

    There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition. Blaise Pascal

    C / C++ / MFC delphi business

  • Making an app single instance
    S sashoalm

    Hello, I have an app which I need to make single instance. When the second instance is called it needs to bring the window of the first instance to the front, and pass it its command line params in some way. And I need the program to be single-instance on session only - i.e. only one instance is allowed per user, but many users logged on can each have their instance. There are a lot of articles on this in codeproject, but I'm not sure which of them is the best and covers all the requirements.

    There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition. Blaise Pascal

    C / C++ / MFC delphi business

  • SetCursor question
    S sashoalm

    I set the cursor to IDC_WAIT but that shows me the hourglass cursor. However I want to show the arrow+hourglass cursor, where it is has both the arrow and the hourglass, but I can't find the ID for this cursor. Does anyone know what the ID is (i.e. IDC_what???)

    There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition. Blaise Pascal

    C / C++ / MFC question delphi

  • toolbars retain old settings
    S sashoalm

    See if CMFCToolBar::LoadState[^] is called. Find it in the MFC sources and put a breakpoint on it. On my computer it's in C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\src\mfc\afxtoolbar.cpp

    There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition. Blaise Pascal

    C / C++ / MFC c++ windows-admin question

  • toolbars retain old settings
    S sashoalm

    What type of toolbar are you using? I mean the name of the class. Standard MFC toolbar, or some customized class?

    There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition. Blaise Pascal

    C / C++ / MFC c++ windows-admin question

  • Reading .CDFS audio: Where to start
    S sashoalm

    Have you tried ffmpeg? Its an open source project with LPGP license. I haven't heard about cdfs, but there's a good chance it's supported.

    There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition. Blaise Pascal

    C / C++ / MFC c++

  • toolbars retain old settings
    S sashoalm

    I'm not sure what you mean by 'changes in the toolbar' (is it the layout you mean?), but what likely is happening is that when you make changes in your code, you change only the *default* layout. Your program first initializes the layout as your code specifies (the default layout), and then looks for user-customized layout. Since one is available, it *overrides* the changes you have made to your code. Again (if this is what I'm thinking it is), your code only sets the initial, default layout. If there is user-customized layout it supersedes it. I think this is how it's supposed to work.

    There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition. Blaise Pascal

    C / C++ / MFC c++ windows-admin question

  • switch by type_id (using RTTI)
    S sashoalm

    I use this to pass notification messages for progress updates, task finished, etc. from worker threads. I use it instead of callbacks. Some messages need their own userdata (hence derived classes, which contain the userdata). I could use callbacks with void* pParam for the userdata, and an ID to show the type of message (like PostMessage does), but RTTI already gives me the ID. The receiver of the message is not always derived from CWnd (otherwise I would have just used PostMessage instead of this whole thing).

    There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition. Blaise Pascal

    C / C++ / MFC delphi question

  • switch by type_id (using RTTI)
    S sashoalm

    I have multiple derived classes and a function that accepts their (abstract) base ptr. Right now I have a lot of code like this in my function:

    void foo(BaseClass* p)
    {
    if (DerivedClass1 *p1 = dynamic_cast<DerivedClass1 *>(p))
    {
    ...;
    }
    else if(DerivedClass2 *p2 = dynamic_cast<DerivedClass2 *>(p))
    {
    ...;
    }
    }

    I want to replace it with a switch if possible:

    switch (p.type_id)
    {
    case DerivedClass1.type_id: ...; break;
    case DerivedClass2.type_id: ...; break;
    }

    is that possible to do?

    There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition. Blaise Pascal

    C / C++ / MFC delphi question

  • AddPrinterDriver returning ERROR_IO_PENDING, what should I do?
    S sashoalm

    bResult = AddPrinterDriver(NULL, 3, (LPBYTE) &di3);
    TRACE("%d", (int) GetLastError());
    if (!bResult)
    return FALSE;

    The call to AddPrinterDriver fails returning FALSE, and GetLastError() returns ERROR_IO_PENDING. The Error Lookup tool shows for this error "Overlapped I/O operation is in progress." What does this mean, and what should I do to work around this problem?

    There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition. Blaise Pascal

    C / C++ / MFC help delphi debugging question
  • Login

  • Don't have an account? Register

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