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

Sardaukar

@Sardaukar
About
Posts
36
Topics
3
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Read MSDN !
    S Sardaukar

    Here is a quote from a reply (someone post a question about an FTP client extended error into an article about... default mail client). I don't feel stressed when people asks me questions - I do this often myself - but this guy obviously didn't perform a basic MSDN search. And I dislike this... Suggestion: search, then search, then search again. Meanwhile, trace and debug. Is nasty, but definitely worth it. * * * "[...]You may also want to do your own search using the preferred search engine, as well as to sign-up to wininet-related newsgroups on Microsoft (or anything else) and look for similar problems and solutions or ideas. The power of MSDN is often misused and underrealized. Search extensively, debug better (if breakpoints introduces timeouts, use a verbose logfile to trace everything interesting and read it to understand what happens). Although it may look primitive and require a lot of typing, write some short macros, printf-like trace __cdecl functions with variable arguments - it definitely pays the price. Not only you'll be able to get a clear picture of error point(s) and cause, but also you can reuse them in further projects. [...]"

    The Lounge debugging help question

  • What's your last "Run" command?
    S Sardaukar

    None. I'm a tweaking monster, so all last command, documents, web pages etc. are cleared at logoff. ;P

    The Lounge algorithms json help question

  • Which API can set a image file as wallpaper?
    S Sardaukar

    [MSDN October 2001] IActiveDesktop::SetWallpaper Sets the wallpaper for the Active Desktop. HRESULT SetWallpaper( LPCWSTR pwszWallpaper, DWORD dwReserved ); Parameters pwszWallpaper String value containing the file name of the wallpaper to be set. dwReserved Reserved. Must be set to zero. Return Values Returns S_OK if successful, or an OLE error code otherwise. See Also IActiveDesktop Requirements Version 4.71 and later of Shell32.dll Windows NT/2000: Requires Windows 2000 (or Windows NT 4.0 with Internet Explorer 4.0 or later). Windows 95/98/Me: Requires Windows 98 (or Windows 95 with Internet Explorer 4.0 or later). Header: Declared in Shlobj.h. So it should work from IE 4.0+. Hope it helps. For a lower version, try SystemParametersInfo: BOOL SystemParametersInfo( UINT uiAction, // system parameter to retrieve or set UINT uiParam, // depends on action to be taken PVOID pvParam, // depends on action to be taken UINT fWinIni // user profile update option ); SPI_SETDESKWALLPAPER Sets the desktop wallpaper. The value of the pvParam parameter determines the new wallpaper. To specify a wallpaper bitmap, set pvParam to point to a null-terminated string containing the name of a bitmap file. Setting pvParam to "" removes the wallpaper. Setting pvParam to SETWALLPAPER_DEFAULT or NULL reverts to the default wallpaper.

    C / C++ / MFC json question

  • __pctype & ___mb_cur_max
    S Sardaukar

    If all this is in V6... I don't know settings in V7, then: Probably you have checked in project settings "Ignore default libraries". Try to add in libraries section libcd.lib (for debug builds) or libc.lib (release). The best way to detect such missing link symbols - at least for me - is to copy the offending symbol name, modify project settings to: - uncheck "Ignore default libraries" - check in Link --> Customize --> Print Progress messages and rebuild all. The linked with produce a verbose output wher you can search for the symbol. Usually, it will look like this: [Unsuccesful build] xxxxxxxx.obj : error LNK2001: unresolved external symbol _yyyyyyy [Rebuild with ignore default lib. off] Searching \.lib: Found __yyyyyyy Referenced in xxxxxxxx.obj Loaded DDDDDDDD.lib(DDDDDDDD.dll) Now you see that the missing lib is DDDDDDDD.lib; put back your project settings, add the new lib to Link section and rebuild. Usual trap libraries: - CRT: libc.lib (C), libcp.lib (C++), libcmt.lib (C multithread), libcpmt.lib (C++ MT) - msvcrt.lib (add a 'd' for debug builds, so Release uses libc.lib, Debug uses libcd.lib etc.) - COM support classes (_com_error) in comsupp.lib - Common dialogs in commdlg32.lib - shell API (shlwapi.lib) just to point some of (my :) ) usual mistakes.

    C / C++ / MFC help c++ tools question announcement

  • Identical Resource IDs
    S Sardaukar

    Unfortunately, yes. I discovered this working inside the company I'm currently employed during the Veritest's "exam" for Windows 2000 Logo. The problem occured having a central executable and a set of DLLs called from it. Everything is MFC. Suppose you have into dll 1 a string resource with IDC_STRING, and into dll 2 a string resource with ID = IDC_STRING2, and IDC_STRING1 = IDC_STRING2. If dll 1 is loaded, loading dll 2 will give in the point of IDC_STRING2 loading a call to FindResource with ID = IDC_STRING1 = IDC_STRING2. Most probably it will find it in dll 1 and load from there, since all are mapped in the same process. If you manually specify the dll instance, that's ok (I think...) but I don't think you call ::LoadString(hInstDll2, IDC_STRING2, szText, sizeof(szText)); instead of CString str; str.LoadString(IDC_STRING2); or AfxMessageBox(IDC_STRING2). Things are even worse if you have different or custom resource types. I've seen several crashes so bad just because this resource clash. In fact this made us to write a resource align tool that reads resource ranges for a dll. The basic idea is to make a resource partitioning tool (parses .rc and rewrites resource.h) in such a way that: ResourceIDs(dll_i) AND ResourceIDs(dll_j) = EMPTY for any i <> j, 1 <= i, j <= n (number of modules using resources you have). The thing may not be so simple as you think, there are external details to consider. Think a MDI application that has to specify a CLIENTCREATESTRUCT's ID for first MDI child window. Accordingly to MSDN (and this one is true :) ) these IDs should not conflict with existing resource IDs. There may be other restrictions as well, I've pointed only one of the most obvious. A dll starts with a default range of resources of 100. If the internal parser decides that this is not enough, it will modify the input "ranges" file and adds a new 100 sized range and try to resort the IDs in such way that each resource ID will be placed inside that range. The process is performed until all resource IDs from dll have room in the allocated ranges. A rebuild all is, of course, required after resource alignment. In this way, there is no worry that a dll will ever have a resource ID conflicting with another dll's resource IDs. Now we all live happily :), having 3 different development offices compiling all in the same place over main website. The internal objects detects if there are resource changes, these MUST be recorded inside the task (I'm no

    C / C++ / MFC question c++ help learning

  • Attack of the Language Police!
    S Sardaukar

    thanks for the tip, i'll watch pulp fiction now "you're ... jimmie, right? this is your house?" "for sure is" "i'm winston wolf. i solve problems."

    The Lounge html database com learning

  • What can over 400K programmers do?
    S Sardaukar

    You're absolutely right... d) Code name is easy: call it "Project". c) Tetris will fire some fierce battles since one wants to see the women naked, other wants to undress first ;P a) Sure. :-O b) ... z) All of the above. qsort (d, c, b, a) Oh, I know the CEO already. I have a friend with a "void main(void)" tatoo on left arm. What do you think, he is THE one for the job?

    The Lounge hardware question

  • What can over 400K programmers do?
    S Sardaukar

    It will take forever. Better a small team (< 50) than a 400K coders... Maybe all can contribute with various tools - that's something else. 400000 = 400000 teams * 1 coder or 1 team * 400000 coders? :~

    The Lounge hardware question

  • Drinking beer will not prevent SARS
    S Sardaukar

    Release a patch, if possible, after... :laugh:

    The Lounge career php database hardware question

  • Drinking beer will not prevent SARS
    S Sardaukar

    You're absolutely right. That's why I drink vodka. No SARS at all.

    The Lounge career php database hardware question

  • List of processes (Save My Day #1)
    S Sardaukar

    MSDN Search: HOWTO: Enumerate Applications in Win32 Q175030 The information in this article applies to: Microsoft Win32 Application Programming Interface (API), used with: the operating system: Microsoft Windows NT, version 4.0 Microsoft Windows 95 the operating system: Microsoft Windows 2000 Definitely one of the best starting points to do it.

    C / C++ / MFC

  • Linux/Windows: I don't want replies to this new thread...
    S Sardaukar

    maybe because i'm a sensible person :)

    The Lounge c++ sysadmin linux help question

  • Linux/Windows: I don't want replies to this new thread...
    S Sardaukar

    Please, but please, only read this (if you want) and post no replies. (Unless you want to embarass me). Stop with all this Linux/Windows problem. You feel comfortable with Linux and you can do your job? Perfect. So am I with Windows. Does Bill Gates says about Office 'this' and 'this'? Ok, it's his bussiness. It can be true. Install, run and evaluate. (There's always an uninstall button). Does RedHat pretend 'we are the best on server market'? Ok, I agree too. It can be true (and I'm sure they have a consistent slice of this market). Do I have a (web) server at home, or at least I am developing software in thsi area? Me, no. Does RedHat helps me writing something on Windows? No. (At least not the documentation). If you are a Linux programmer, are you interested what routines are exported from NTDll.dll? I don't think so. So? This site starts - if I remember well - for Windows (if not MFC only). So what? There are Linux guys interested to post code? It's ok for me. (Although this code is not so significant for me). They have ideas to share? Great. You can borrow something useful from Windows to use on Linux? Perfect. (Nobody says that if you are in a heavy metal band you cannot use Latin percussionists - at least Sepultura did this :) ). But to say M$ instead of MS, or, even worse, 'CRAP'... This is an insult and I take it personally. (It's not my fault that I'm from Romania, I'm not so happy. But to make me a communist, this is too much). It remains for you, people (aka Linux zealots) to make explosive Linux distribution, put 100 of them in a bag, go to a coffee shop where Windows programmer come and to throw the CD bag inside. What are you, people, a some kind of OS Fundamentalists or what?

    The Lounge c++ sysadmin linux help question

  • People who complain about Microsoft are like...
    S Sardaukar

    I have (or at least I had) almost all NT 4 with all service packs (or without). But Workstation service was ok. (At least if you did not changed the account under this service is to be run). Did you examine Event Viewer? This is another incredible useful errors explanations' source, often misused and underrealized. 'Chief, can we remove ReportEvent from our service?' 'Why??' 'I just asked the customer X what's the latest in event viewer.' 'And what he says?' 'My daughter's wedding, why?'

    The Lounge csharp hardware tutorial question discussion

  • People who complain about Microsoft are like...
    S Sardaukar

    It was only about new/delete. But, anyway, this is not the main idea. The fact was the programmer (?) was too lazy to debug the code. For sure he/seh tried to delete more than allocated, or to delete a 0xcdcdcdcd pointer, or something like this. If you want to avoid these malloc/delete, new/free, Local, Global etc., you have always the alternative of COM allocator CoGetMalloc...

    The Lounge csharp hardware tutorial question discussion

  • People who complain about Microsoft are like...
    S Sardaukar

    ...since our servers, for example, are alive and running (with an exception, thanks to electric power company :( ) from 5? 6 months? True, there were seevral restarts (but that's because some patches and upgrades were applied and Windows requires restart. This is, indeed, unpleasant, but is something else). And these servers hosts SQL Servers, IIS, Exchange, Terminal Server, schedulers, printers - that means everything you need for a Windows NT/2000 server to get into trouble :)... And that's not all. Also some guys from our company - not me, of course :) - are testing NT services, network managers, IP tracers, remote system editing tools, user and printers manager, desktop switchers, an economical software - which is not big, but it has several thousands windows inside :) - , all of us perform huge print jobs etc. etc. etc. (Let's not forget the Starcraft combats during work time). Also, we have here Windows 2000 workstations (with no service packs, or with SP1, or with SP2) and servers, NT 4 workstations and servers with all kind of service packs, dual boot NT/98 machines, 95, 95 OSR2, 98, 98 SE workstations (did I forgot something?). We are all running happily programs like DOS/4GW Heretic shareware (I don't want to know how is able to run on a W2K machine :) - and I finished the first episode :)) I believe that over 90% of these 'restart' (??) problems are caused by wrong installation or configuration, misunderstandings or bad using... A visit - from time to time - on http://www.ntfaq.com/ - shows (for me, at least) how stupid I was (hope I'm not still stupid...), how I did not used help, read documentations and articles etc. Example? RedCode removal. After two days or installing Exchange, running isinteg and eseutil, a simple visit to MS website offered me the 5 minutes solution to get rid of RedCode 2. 'What's worst than a stupid person? A stupid person that is also an administrator' PS Speaking of 'restarting engineers': there are also 'restarting programmers'. A friend of mine told me how a programmer avoided to call delete for previously allocated memory. Of course, a simple run of BoundsChecker showed a zillion of memory leaks. Asked 'why you don't free the memory?', the man replied: 'because the program crashes'. In this way, the restart seems, indeed, the one and only solution. And that is valid also for people like him that creates a font and don't "DeleteObject" it, calls NetApi_XXX and forget to NetApiBufferFree, or pMalloc->Release(), or whatever you have in mind. X|

    The Lounge csharp hardware tutorial question discussion

  • The end of DLL hell... Long live WFP hell!
    S Sardaukar

    try to search on http://www.ntfaq.com - it can be something useful there

    The Lounge c++ csharp html visual-studio com

  • Windows 2000 or Windows XP?
    S Sardaukar

    Also doom i, doom ii, quake i (rebuild from sources of idSoftware) for nt, even Dune II (!!) works on all NT4/W2K/W98 computers. This shouldn't be an issue... :)

    The Lounge question

  • Help!! ADO and NT
    S Sardaukar

    Try to load dynamically the component... The #import is almost always a bad idea. LoadTypeLibrary, CoCreateInstance, even old LoadLibrary can help. Or it can be a different version control that has some methods on 95 and other on NT. Trying to call the method "7" when the interface implements only "6"... By the way, application doesn't tell nothing? No crash, no "Debug", nothing? What does it mean "doesn't start at all"?

    Database help c++ question announcement

  • Opinions on .NET beta 2?
    S Sardaukar

    Thank you for the complete answer. Now is clear enough also for me - I understand a little bit slower these kind of details since I'm writing my own setup any time. If that is what MSDN peoples' said, it should be so. Thank you again!

    The Lounge discussion csharp visual-studio beta-testing json
  • Login

  • Don't have an account? Register

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