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
User Profile
Collapse
-
Hi,
Try changing "Use precompiled headers /Yu" to "Create precompiled headers /Yc"
HTH...Leave a comment:
-
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...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....Leave a comment:
-
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.
HthLeave a comment:
-
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. . .Leave a comment:
-
-
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...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
Leave a comment:
-
-
-
Check out System.Threadin g.WaitHandle.Wa itOne. Is this the behaviour you need? Check out MSDN for sample code.
HTHLeave a comment:
-
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+$");
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.Leave a comment:
-
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 ==
Leave a comment:
-
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......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....Leave a comment:
-
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?
RegardsLeave a comment:
-
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?...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...Leave a comment:
No activity results to display
Show More
Leave a comment: