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
P

Patje

@Patje
About
Posts
94
Topics
37
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Performance problem in Vista Windows explorer if /SWAPRUN:NET is set on an executable.
    P Patje

    I have rather big executables (about 25-35 MB). Because I want my users to easily execute my application, I don't want them to install a bunch of DLL's, just xcopy-install is OK for me (and my customers). Because my software is often run from a network drive, and my customers' networks are not always reliable, I link my executables using the /SWAPRUN:NET option. This guarantees that the whole EXE is loaded in memory before the application starts, and prevents crashes if the network connection is dropped while my application is running. This worked fine so far, BUT ... under Windows Vista, if a network folder has lots of such executables (10, 50, 100, ...) then opening this folder in the Windows explorer takes a lot of time (minutes!). Especially, the visualization of the executables' icons takes a lot of time. This problem did not appear on Windows XP. Today, I found out that the problem is caused by the /SWAPRUN:NET option. If I remove this linker option (or disable this flag with EDITBIN), than the Vista Windows explorer immediately shows all icons. Disabling this flag is not really an option (see reasons above). Is there another way to tell Vista that it should not load the complete executable file if it only needs to show the icon (or other version information) in the explorer? Thanks, Patrick

    Enjoy life, this is not a rehearsal !!!

    Windows API performance sysadmin help question announcement

  • Data Consistency
    P Patje

    I'm afraid that's almost all the information I can give without going into the gory details. The problem is that in many cases, if the user changes constraint X it only has an impact on interactive field Y, and in 90% of the cases, the user knows this, but the application doesn't. The application can only know this after performing a global consistency check, which can take several minutes, due to the use of complex mathematical formulas. Compare this with pivot tables in Excel. Changing the slightest value in a sheet may invalidate a cell in the pivot table. Excel doesn't automatically recalculate the whole pivot table because it probably takes too much time, but in practice and in most cases the user could know what the exact effect is, and live without a pivot table that is not necessarily up-to-date.

    Enjoy life, this is not a rehearsal !!!

    Algorithms css help tutorial question

  • Data Consistency
    P Patje

    Imagine the following interactive mathematical application: - the data loaded in the application is split in two different 'types' - the first type, let's call it the 'interactive' side of the application, contains data that is manipulated (added, deleted, changed, ...) by the user. It's effect on other data can be immediately calculated and we can quite easily determine which parts of the screen needs to be redrawn to make the screen back consistent - the second type, let's call it the 'constraint' side of the application, contains data that is less frequently manipulated by the user. But if it is manipulated, it could have an impact on any element of the 'interactive' side. The problem is that there is no one-to-one relation between elements in the 'constraints' side and elements in the 'interactive' side. If we want to show the user an always-up-to-date 'interactive' view, certain complex calculations are needed which can easily take up several minutes. My current approach is to disable the 'interactive' side from the moment anything is changed on the 'constraint' side. The user can then continue to work on the 'constraint' side, but if he wants to go back to the 'interactive' side of the application, he will have to perform a full recalculation. Result: a slow, but always consistent application (regarding the 'interactive' side). The alternative could be to keep the 'interactive' side enabled while the user is changing elements in the 'constraint' side. Often the user can know what the impact is of his changes on the 'interactive' side and simply pressing F5 on the correct cell in the interactive grid can then calculate the effects from the 'constraint' side to that specific cell of the 'interactive' side. Result: a faster, but not always consistent application, meaning the user could draw conclusions from incorrect values. Does anyone of you have an application with a similar problem (choosing between slow and consistent or fast and inconsistent)? Any tips on how to have a fast(er) application with still having a quite good data consistency in the 'interactive' side? Thanks in advance for your tips.

    Enjoy life, this is not a rehearsal !!!

    Algorithms css help tutorial question

  • SOAP Timeout
    P Patje

    Thanks for the tip. I cannot use caching because every SOAP call is different, even if all the input arguments are the same (it's a kind of complex reservation system using mathematical formulas). I like the trick using the sequence number, but I would keep this as a last alternative. I was just hoping there would be a method to get from the .Net framework that the client has left (because of a time-out) before actually returning the result, but apparently, this isn't the case. Thanks for the tip anyway. Patje

    Enjoy life, this is not a rehearsal !!!

    .NET (Core and Framework) help csharp wcf sysadmin data-structures

  • SOAP Timeout
    P Patje

    I have an application that behaves as a SOAP server, using the ChannelServices::RegisterChannel and RemotingConfiguration::RegisterWellKnownServiceType calls. Although my SOAP service will not be called intensively by clients, it is still possible that it gets a burst of a few hundreds of calls at the same time. Problem is that the logic in the SOAP service typically take 5 to 10 seconds, and cannot be executed in parallel (complex mathematical calculations, results of one SOAP call may influence the results of later SOAP calls, it's a bit difficult to explain all the underlying details of it). In normal situations this is not a problem since the SOAP timeout is typically about 100 seconds. However, if I get a burst of 100 SOAP calls at the same time, some of them will get a timeout (which is acceptable). The real problem is that I cannot see in the server that the client has got a timeout, which means that the server will go on performing its calculations (or the calculations needed for the SOAP call will be queued) even if the client is not there anymore, and the results cannot be sent to it anymore. If I would be able to see that the client is not there anymore, I could abort the calculations, or I could remove the pending calculations from the queue again. I've looked in the .Net API but I haven't found a way yet to see if the client is still there or not. Is there an easy way to obtain this information? Or should I start to investigate asynchronously SOAP calls, or any other complex concept? Any code examples that might help? Thanks. Patje

    Enjoy life, this is not a rehearsal !!!

    .NET (Core and Framework) help csharp wcf sysadmin data-structures

  • Embedded Reporting
    P Patje

    Yep, that's one alternative, but reporting is not our core business and you cannot beat 3rd party reporting components regarding look and feel. We have a very simple reporting tool written ourselves in our software, but this is limited to some iterations over records and some column values. No nice formatting (fonts, colors, alignment), no graphs, ... These simple reports are sufficient for 80% of the normal daily users, but for the more demanding users, and for creating management reports, we use the embedded Crystal Reports. Unfortunately, as I said before, they have no 64-bit flavor, regular crashes, etc. That's why I started looking for an alternative embedded reporting tool.

    Enjoy life, this is not a rehearsal !!!

    IT & Infrastructure com performance design hardware question

  • Embedded Reporting
    P Patje

    Hi, at this moment I use Crystal Reports as an embedded reporter in my application. This means that my customers can design their own reports from within my application (provided they have the correct Crystal Reports licenses) and view the final report based on data that comes directly from my application's memory (it is passed from my application to CR using a record set). Unfortunately, I have quite some problems with CR at this moment: - terrible performance under Vista - regular crashes in the embedded CR report designer when creating complex reports - there's no 64-bit version of the CR ActiveX/COM components So, my questions: - does anyone of you use an embedded reporting component? - if it is CR, what are your experiences with it? - if it's another one, which one do you use (as I am thinking about switching to another component) Or do you have any other suggestions regarding using an embedded reporting component in an application? Thanks.

    Enjoy life, this is not a rehearsal !!!

    IT & Infrastructure com performance design hardware question

  • Limit to GDI Handles and User Handles
    P Patje

    Hi, My software is a highly interactive application that uses lots of windows with sub windows (a few hundred windows is not an exception). Not all windows are visible at the same time, but at certain moments the user must be able to quickly switch to another window so I keep the relevant windows invisible and make them visible when needed. Due to the structure of the software, it is not possible to decrease the number of windows. Nevertheless I have succeeded to decrease the used pens, brushes, .... Cleaning up the used menu handles and icon handles is planned for the medium- to long-term. To prevent my application from starving the available GDI and/or User Handles, I want to check the amount of free GDI/User handles (both for the process as for the global system). I found out that there is a function (GetGUIResources) where you can get the number of used resources, but there does not seem to be a function to get the number of free resources? Does such a function exist or is there another way of obtaining that value? Or is there a simple trick to minimize the number of used resources (or to increase the number of available resources)? Thanks in advance. Enjoy life, this is not a rehearsal !!!

    C / C++ / MFC graphics question

  • Transparent Unicode/Ascii using STL
    P Patje

    In my application I want to access files, where the underlying character type (ASCII or Unicode) is transparent for the application. Suppose that in a reporting module a report is written to file, like this:

    myfile << reportHeader << std::endl;
    for (all columns) myfile << columnname;
    myfile << std::endl;
    for (all records)
       {
       for (all columns) myfile << data;
       myfile << std::endl;
       }
    

    Now, I want my application to transparently write the report to ASCII or Unicode files, depending on the user specification. Currently, you have to do it like this:

    std::ofstream asciiFile;
    std::wofstream unicodeFile;
    if (user wants Unicode)
       {
       unicodeFile.open ("output.txt");
       unicodeFile << reportHeader << std::endl;
       }
    else
       {
       asciiFile.open ("output.txt");
       asciiFile << reportHeader << std::endl;
       }
    for (all columns) 
       {
       if (user wants Unicode) unicodeFile << columnname;
       else                    asciiFile << columnName;
       }
    ... and so on
    

    The disadvantages seem obvious: - clumsy, unreadable code (especially if the write-to-file logic is spread over several methods) - writing Unicode strings (std::wstring) to an Ascii stream doesn't even work; it produced garbage Therefore, I need a kind of transparent stream, so that I can write the following:

    transparentstream myfile;
    myfile.setMode (ascii or unicode);
    myfile.open ("output.txt");
    myfile << reportHeader << std::endl;
    for (all columns) myfile << columnname;
    myfile << std::endl;
    for (all records)
       {
       for (all columns) myfile << data;
       myfile << std::endl;
       }
    

    Problems are: - from which stream do I inherit the transparentstream? - how do I define the transparentstream so all defined output operators keep on working? - where do I put the conversion logic? (basic_buf? basic_filebuf?) Of course I want something similar for input, where the stream can find out itself whether the file is Unicode (starts with 0xfffe or 0xfeff) or plain Ascii. And as an additional challenge: is it possible to have such a transparent stream that can do something like this?

    transparentstream mystream;
    mystream.open("http://www.mywebsite.com/mypage.html");
    mystream >> ...;
    

    And if this is possible, how do I implement such a stream of buf class? Did some of you already encounter problems trying to mix the STL and Unicode files? How did you solve it? Probably Java and .Net solve this problem in a el

    C / C++ / MFC question csharp c++ java html

  • Unicode streams and ASCII files
    P Patje

    Not exactly. I want to write to (or read from) a stream without having to worry about whether the file is Ascii or Unicode. Afaik, STL forces me to know beforehand what the file is and use either an ofstream (for Ascii) or a wofstream (for Unicode), which means that all output statements should be doubled in my application. In my original post I gave a simple example for a reporting module. The first code examples shows how to do it in Ascii only.
    The second example shows how STL currently forces me to write this module if I want to support both Ascii and Unicode in my application.
    The third example shows how I would hope to write it, at least if somebody has a brilliant idea. Enjoy life, this is not a rehearsal !!!

    ATL / WTL / STL question c++ html com learning

  • Unicode streams and ASCII files
    P Patje

    In my application I want to access files, where the underlying character type (ASCII or Unicode) is transparent for the application. Suppose that in a reporting module a report is written to file, like this: myfile << reportHeader << std::endl; for (all columns) myfile << columnname; myfile << std::endl; for (all records) { for (all columns) myfile << data; myfile << std::endl; } Now, I want my application to transparently write the report to ASCII or Unicode files, depending on the user specification. Currently, you have to do it like this: std::ofstream asciiFile; std::wofstream unicodeFile; if (user wants Unicode) { unicodeFile.open ("output.txt"); unicodeFile << reportHeader << std::endl; } else { asciiFile.open ("output.txt"); asciiFile << reportHeader << std::endl; } for (all columns) { if (user wants Unicode) unicodeFile << columnname; else asciiFile << columnName; } ... and so on The disadvantages seem obvious: - clumsy, unreadable code (especially if the write-to-file logic is spread over several methods) - writing Unicode strings (std::wstring) to an Ascii stream doesn't even work; it produced garbage Therefore, I need a kind of transparent stream, so that I can write the following: transparentstream myfile; myfile.setMode (ascii or unicode); myfile.open ("output.txt"); myfile << reportHeader << std::endl; for (all columns) myfile << columnname; myfile << std::endl; for (all records) { for (all columns) myfile << data; myfile << std::endl; } Problems are: - from which stream do I inherit the transparentstream? - how do I define the transparentstream so all defined output operators keep on working? - where do I put the conversion logic? (basic_buf? basic_filebuf?) Of course I want something similar for input, where the stream can find out itself whether the file is Unicode (starts with 0xfffe or 0xfeff) or plain Ascii. And as an additional challenge: is it possible to have such a transparent stream that can do something like this? transparentstream mystream; mystream.open("http://www.mywebsite.com/mypage.html"); mystream >> ...; And if this is possible, how do I implement such a stream of buf class? Did some of you already encounter problems trying to mix the STL and Unicode files? How did you solve it? Thanks for you suggestions. Enjoy life, this is not a rehearsa

    ATL / WTL / STL question c++ html com learning

  • SOAP Server
    P Patje

    Thanks Ryan, I looked at gSoap but because of its GPL license we cannot use it in commercial software. Although a commercial license for gSoap exists, I further looked into the .NET classes and since they are free (but tied to the Windows platform which isn't a problem for us) .NET looks the way to go. So far I made a successful small .NET .exe SOAP server, and I'm looking further into embedding SOAP logic in our server applications that way. Thanks anyway for your information. Enjoy life, this is not a rehearsal !!!

    .NET (Core and Framework) csharp c++ wcf sysadmin windows-admin

  • SOAP Server
    P Patje

    Thanks, So far I succeeded in writing: - a C# stand-alone SOAP server - a C++ stand-alone SOAP server Next steps are to write: - a .NET C++ class (or example class) that can be embedded in our applications to make it a simple SOAP server. - a .NET C++ class to do the same for SOAP message queue requests. Why C++? Well, the applications are all written in C++ and for the time being we like to keep our applications as 'compact' as possible. I mean, not a bunch of DLL's or components lying around, but a rock-solid executable file that simply needs to be copied on the system. From what I understand from C#, the C# compiler cannot simply create an object file that can be linked with the rest of the application. With C++.NET this is still possible. Enjoy life, this is not a rehearsal !!!

    .NET (Core and Framework) csharp c++ wcf sysadmin windows-admin

  • SOAP Server
    P Patje

    Thank you both for your input. I think I'll have lot to read the next days. Enjoy life, this is not a rehearsal !!!

    ASP.NET csharp c++ wcf sysadmin windows-admin

  • SOAP Server
    P Patje

    We are currently investigating the use of SOAP as 'intermediate layer' between some complex modules. .NET makes it very easy to create a 'Soap DLL' that is activated by IIS. Great. However, we are considering to use this technology to access bigger server-style applications. These applications typically take several minutes to start up, handle a large amount of memory, and therefore cannot simply be recompiled into a kind of 'Soap DLL'. Browsing through the Microsoft documentation I found an excellent AtlServer example that seems to do what I need. However, it would be much nicer if we could use the more modern .NET technology for this. So here are the 'million-dollar'-questions: - Is it possible, using .NET technology, to make a standalone .exe server-application behave like a SOAP-server via the HTTP protocol? - Is it possible, using .NET technology, to make it accept SOAP requests via a message queue as well? - If NO on the questions above, is using the AtlServer a step in the good direction or is ATL a dead-end? - If YES on the questions above, where can I find good .NET examples on writing such a SOAP server? Because I'm not sure in which forum to post it, I'll post it in 2 or 3 forums. Sorry if you get this multiple times. Enjoy life, this is not a rehearsal !!!

    Web Development csharp c++ wcf sysadmin windows-admin

  • SOAP Server
    P Patje

    We are currently investigating the use of SOAP as 'intermediate layer' between some complex modules. .NET makes it very easy to create a 'Soap DLL' that is activated by IIS. Great. However, we are considering to use this technology to access bigger server-style applications. These applications typically take several minutes to start up, handle a large amount of memory, and therefore cannot simply be recompiled into a kind of 'Soap DLL'. Browsing through the Microsoft documentation I found an excellent AtlServer example that seems to do what I need. However, it would be much nicer if we could use the more modern .NET technology for this. So here are the 'million-dollar'-questions: - Is it possible, using .NET technology, to make a standalone .exe server-application behave like a SOAP-server via the HTTP protocol? - Is it possible, using .NET technology, to make it accept SOAP requests via a message queue as well? - If NO on the questions above, is using the AtlServer a step in the good direction or is ATL a dead-end? - If YES on the questions above, where can I find good .NET examples on writing such a SOAP server? Because I'm not sure in which forum to post it, I'll post it in 2 or 3 forums. Sorry if you get this multiple times. Enjoy life, this is not a rehearsal !!!

    .NET (Core and Framework) csharp c++ wcf sysadmin windows-admin

  • SOAP Server
    P Patje

    We are currently investigating the use of SOAP as 'intermediate layer' between some complex modules. .NET makes it very easy to create a 'Soap DLL' that is activated by IIS. Great. However, we are considering to use this technology to access bigger server-style applications. These applications typically take several minutes to start up, handle a large amount of memory, and therefore cannot simply be recompiled into a kind of 'Soap DLL'. Browsing through the Microsoft documentation I found an excellent AtlServer example that seems to do what I need. However, it would be much nicer if we could use the more modern .NET technology for this. So here are the 'million-dollar'-questions: - Is it possible, using .NET technology, to make a standalone .exe server-application behave like a SOAP-server via the HTTP protocol? - Is it possible, using .NET technology, to make it accept SOAP requests via a message queue as well? - If NO on the questions above, is using the AtlServer a step in the good direction or is ATL a dead-end? - If YES on the questions above, where can I find good .NET examples on writing such a SOAP server? Because I'm not sure in which forum to post it, I'll post it in 2 or 3 forums. Sorry if you get this multiple times. Enjoy life, this is not a rehearsal !!!

    ASP.NET csharp c++ wcf sysadmin windows-admin

  • Precompiled headers
    P Patje

    I'm currently in the middle of redesigned a larger application. Previously the application was divided in [too] large chunks (I will use the term chunk to distinguish it from files/modules). Each chunk had a lot of source (mainly .c) files, but only one header (.h) file that had to be included by the routines of that chunk and by other routines that wanted to use that chunk. Up to now we used precompiled header files to speed up compilation (all files of a chunk had to include their own header file as first file). Now I want to divide all these chunks in smaller C++ classes. Each class will have its own header (.h) file and source (.cpp) file. My hope is to end up with less includes, less dependencies and thus a faster compilation. However, what I notice is just the opposite. We try to make a lot of use of STL and Boost templates, but these seem to slow down compilation seriously. On the other hand, we cannot use precompiled headers anymore because each class has its own header file. In the fantastic book 'Debugging Applications for .Net and Windows', the author, John Robbins, suggests to use one main header file (e.g. ALL.H) that is included (first) by all of our source files. All includes that aren't changed in the last 3 months should be put in that header file (including STL and Windows includes). In our case we would typically include STL and Boost header files in that ALL.H file, but the template constructions even seem to slow down compilations if precompiled header files are used. How do you organize your header files? How do you use precompiled headers? And what should be the correct way to use them? (maybe this could be a question for a poll, but it is probably too C++ oriented for that). Thanks for your help, fellow CPians. Enjoy life, this is not a rehearsal !!!

    C / C++ / MFC c++ question csharp css wpf

  • overruling new/delete, malloc/free
    P Patje

    Because I want to plug-in my own specific memory/heap manager, I need to overrule the global new and delete operators, and the global malloc and free functions. What is the best way to do this? Simply overrule these 2 operators and 2 functions or do I need to overrule other functions as well? Is there a good explanation or documentation in the MSDN somewhere on how to do this? Apparently, the standard C run time library only allows some additional checking hooks, but I want to plug in my own complete memory/heap manager, not only perform some additiona checks. Also these additional checks only work in a debug version, not in a production version. If I need to overrule more functions, how can I be guaranteed that this isn't depending on the version of the compiler (Visual Studio .Net, 7.1 in my case)? Thanks. Enjoy life, this is not a rehearsal !!!

    C / C++ / MFC question csharp visual-studio debugging performance

  • How to avoid Application failure or ASSERT Dialog when application crash.
    P Patje

    Last summer we had similar problems. Finally I bought the book "Debugging Applications for Microsoft .Net and Microsoft Windows", written by John Robbins. You should find this at Amazon. Also take a look at the www.wintellect.com[^] website, the employer of John Robbins, a company specialized in debugging. Also take a look at the CodeProject articles in the Debug Tips section (http://www.codeproject.com/debug/[^]). Some of the articles mention how to catch application crashes. Enjoy life, this is not a rehearsal !!!

    C / C++ / MFC help tutorial announcement
  • Login

  • Don't have an account? Register

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