User Profile

Collapse

Profile Sidebar

Collapse
pootle
pootle
Joined: Apr 5 '08
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • In visual c++, you need to be aware of unicode. If you use a plain char pointer, it is not unicode compatible, because it is a byte instead of two bytes. There are some macros that define character typedr based upon whether you have unicode enabled in your project, for example TCHAR. I would suggest you in to msdn and read about unicode for full details and sample code.

    Regards
    See more | Go to post

    Leave a comment:


  • pootle
    replied to To build the program,
    in C
    Hi,

    Try changing "Use precompiled headers /Yu" to "Create precompiled headers /Yc"

    HTH...
    See more | Go to post

    Leave a comment:


  • pootle
    replied to Visual C++ .NET 2009 'Stealing' file handles
    in C
    Why are you re-inventing the wheel?

    This type of logging system is available in several flavours as .NET libraries. You could use NLog or log4net.

    These all provide the ability to send log files over the network, to send to a syslog collector, to store in files - almost anything you can image and are highly extensible if the exact behaviour you want is not available. You will save yourself a lot of time and heartache...
    See more | Go to post

    Leave a comment:


  • Hi,

    You might try the boost signals library, see
    http://www.boost.org/doc/libs/1_36_0/doc/html/signals.html
    It has the advantage of being supported on many platforms *nix/Windows and with many compilers.

    Regards....
    See more | Go to post

    Leave a comment:


  • pootle
    replied to C# Storing Data
    in .NET
    You can also use the registry. .NET provides a nice easy to use interface and best of all, you can encrypt data.

    If you really want something portable - so something you can move between systems, then encrypted files are also an option. Again all of the required classes are part of .NET.

    Hth
    See more | Go to post

    Leave a comment:


  • pootle
    replied to Thread based Error / Event Logging
    in .NET
    Hi,

    Just out of interest, have you not considered using a logging framework, something like log4net, or my personal favourite, NLog. They are both free and make life much easier - they help with the whole PITA thing. . .
    See more | Go to post

    Leave a comment:


  • pootle
    replied to How to start a project
    Of course, not forgetting to test before delivery... :0)...
    See more | Go to post

    Leave a comment:


  • pootle
    replied to vector pointer vs vector object
    in C
    Exactly. You are responsible for all de-allocation when the template is a pointer.

    BTW, there is also another reason to use pointers in a container - to utilise polymorphic types.



    This is somehow true, but you cannot make some assumption about how memory is held, except in the most general way (such as vector being contiguous) - it is implementation dependant - you can only rely on what is specified by...
    See more | Go to post

    Leave a comment:


  • Well, you can do this (taken from Scott Meyers "More Effective C++"):

    Code:
    char* pc = 0;     // Set pointer to null
    char& rc = *pc;   // Make reference to dereferenced null pointer
    But this is just the worst kind evil and the results are undefined...
    See more | Go to post

    Leave a comment:


  • pootle
    replied to Plz help about bluetooth programming
    in .NET
    Go to google and type "C# bluetooth". Simple ain't it?
    See more | Go to post

    Leave a comment:


  • pootle
    replied to Sockets in .NET Windows Service
    in .NET
    Could it be a permission problem? Are you running on Vista?
    See more | Go to post

    Leave a comment:


  • pootle
    replied to Blocking a thread
    in .NET
    Check out System.Threadin g.WaitHandle.Wa itOne. Is this the behaviour you need? Check out MSDN for sample code.

    HTH
    See more | Go to post

    Leave a comment:


  • pootle
    replied to C#: whether string is number or not
    in .NET
    Hi,

    No, you are not missing something. Shameful isn't it? You would expect this kind of simple operation to be included somewhere in such a rich framework...

    You have both of the common ways to solve this problem. Just for completeness, the regular expression approach (my personal preference) can be done using the following:


    Code:
    private static Regex _isNumber = new Regex(@"^\d+$");
    ...
    See more | Go to post

    Leave a comment:


  • If you are interested in C#, you can use visual studio express with the Microsoft's XNA. See:
    http://msdn.microsoft. com/en-us/xna/default.aspx

    Have Fun.
    See more | Go to post

    Leave a comment:


  • pootle
    replied to Segmentation Fault with fopen
    in C
    For fun (I've nothing better to do...)
    I tried taking your code and running it on my Linux box...

    Code:
    #include <stdio.h>
    
    typedef struct
    {
        char* ventanaInspeccion;
        char* ventanaMemoria;
        FILE* archivo; 
    } TAC;
     
    int TAC_Abrir(TAC* tac, char* archMensaje) {
        tac->archivo=fopen(archMensaje,"rt");
        if (tac->archivo ==
    ...
    See more | Go to post

    Leave a comment:


  • pootle
    replied to Segmentation Fault with fopen
    in C
    And also...
    You said that archMensaje is correct - but are you sure it is properly alllocated/null terminated? Passing a rubbish filename pointer would cause a segfault... Just for testing, try replacing it with a literal string......
    See more | Go to post

    Leave a comment:


  • hi,

    First things first. Try not to use a string for complex processing. A string is immutable, which means every change results in a new string and this is very slow. Instead, look at using StringBuilder. The kind of substitution you want to do can be done in several ways. You can parse and replace using the methods of StringBuilder, but if i had this task, i would use a regular expression to make a substitution of a predefined string....
    See more | Go to post

    Leave a comment:


  • pootle
    replied to Segmentation Fault with fopen
    in C
    Did you check the tac pointer? When you dereference it to put the result of fopen into archivo is it valid? How is it allocated?

    Regards
    See more | Go to post

    Leave a comment:


  • pootle
    replied to Re-using dll's
    in .NET
    When you say that you cannot use the functionality, do you mean that you get compilation errors, or that the classes from the DLL's does not appear in intellisense? Have you tried to re-compile your project after adding the reference?...
    See more | Go to post

    Leave a comment:


  • Hi,

    I know your pain...
    You would think that bluetooth communication between different devices would be painless. It isn't. Faced with the problem some time ago, I started looking at creating drivers for the most popular bluetooth stacks - you can get SDK for Widcomm/Broadcomm, Blue Soleil, etc. for free, but all have a different API...

    However, I happened to come accross a framework that made my task much simpler...
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...