Search:

Type: Posts; User: Hulag

Page 1 of 4 1 2 3 4

Search: Search took 0.01 seconds.

  1. Replies
    12
    Views
    9,763

    Well, I managed to fix the problem. The problem...

    Well, I managed to fix the problem. The problem is in the byte order mark in the file at the beginning. I had to increase the pointer to the text by one to get rid of it, and then wcstombs would...
  2. Replies
    12
    Views
    9,763

    I can't, the code is huge and doesn't belong to...

    I can't, the code is huge and doesn't belong to me. Sorry :( Anyway, is it really that important? The value of the wstring is fine, the debugger shows that the text is the exactly the same as the...
  3. Replies
    12
    Views
    9,763

    Well, even if I changed the amount of allocated...

    Well, even if I changed the amount of allocated memory to something like the following but it still fails. Also, there is no wierd character in wideData (there might be, but right now there isn't)
    ...
  4. Replies
    12
    Views
    9,763

    You are right, wcstombs is returning -1. How can...

    You are right, wcstombs is returning -1. How can I fix that?
    I don't have more code to show really, wideData comes from an Unicode BOM text file that has the following text:

    <Config>
    <Sound>...
  5. Replies
    12
    Views
    9,763

    const wchar_t * to UTF-8 const char* p

    I need to convert a const std::wstring * to a UTF-8 encoded const char * and I just can't make it work.

    I wrote the code to do that but it isn't working

    //wideData is defined as const...
  6. Thread: Null object.

    by Hulag
    Replies
    7
    Views
    1,345

    Ok, thanks for showing me the different...

    Ok, thanks for showing me the different alternatives. I will go with a no-op dummy. Thanks again guys.
  7. Thread: Null object.

    by Hulag
    Replies
    7
    Views
    1,345

    Because that would involve checking that the...

    Because that would involve checking that the subsystem actually exists on every call to that subsystem (either check it on the function in the subsystem itself, or checking from the function that...
  8. Thread: Null object.

    by Hulag
    Replies
    7
    Views
    1,345

    Null object.

    I’m working on a little project that has some subsystems like sound and image and such. So each subsystem is a singleton in the application cause there only needs to be a single sound or image...
  9. Thread: Deleting NULL.

    by Hulag
    Replies
    2
    Views
    953

    Deleting NULL.

    While on Windows I had no problems, I was wondering if it's safe to delete a variable that's already NULL by standard. I want to make sure my code is portable without the need to add an if check...
  10. Replies
    2
    Views
    2,457

    For those wondering or people that later search...

    For those wondering or people that later search for a solution to this problem, I used the mbstowcs function which seems to be cross platform.
  11. Replies
    2
    Views
    2,457

    Cross platform char to wstring.

    I need to convert a char[1024] to an STL wstring. I'm aware that I can do that using MultiByteToWideChar in Windows but I'm looking for a cross platform solution (at least Windows and Linux). Is...
  12. Thread: ofstream issue.

    by Hulag
    Replies
    3
    Views
    1,381

    Oh, that was it. Thanks!

    Oh, that was it. Thanks!
  13. Thread: ofstream issue.

    by Hulag
    Replies
    3
    Views
    1,381

    ofstream issue.

    I created an a variable for my info logger

    std::ofstream FileLog;
    and in the constructor of my logger I do

    FileLog.open("log.txt");
    And while I can add everything just fine, it doesn't...
  14. Replies
    3
    Views
    906

    It would be nice to have some reasons to keep...

    It would be nice to have some reasons to keep both or not. It seems to me that it would only make sense to keep the Unicode versions that it would deal with all cases but I'm not sure how everything...
  15. Replies
    3
    Views
    906

    Unicode functions.

    Right now I have Unicode and non-Unicode versions of some functions (to open files and such), should I bother keeping both or should I just use the Unicode version? Are there any benefits for keeping...
  16. Thread: Wrong design?

    by Hulag
    Replies
    5
    Views
    1,081

    "whoo whooo" that made me laugh for some reason...

    "whoo whooo" that made me laugh for some reason heh.
    That's not my problem, PlaneSound(the name comes from a geometricaly planar sound source, not from an actual plane) and PointSound, etc. don't...
  17. Thread: Wrong design?

    by Hulag
    Replies
    5
    Views
    1,081

    I'm trying to avoid both of those solutions due...

    I'm trying to avoid both of those solutions due to performance issues. This is a real-time application.
  18. Thread: Wrong design?

    by Hulag
    Replies
    5
    Views
    1,081

    Wrong design?

    I found myself in a position where it seems I need to use dynamic_cast but I would like to avoid that. What I have is my base class called Sound and a bunch of derived object called PointSound,...
  19. Replies
    5
    Views
    1,312

    I use a vector because I like the flexibility it...

    I use a vector because I like the flexibility it provides, when I create the vector I don't know the size it will take. But then I need to send an array to a function which I don't have the source...
  20. Replies
    5
    Views
    1,312

    I don't want access each one, I need to point to...

    I don't want access each one, I need to point to the whole array. And no, I can't pass a vector to the function, it's a library that requires an array. If possible I would like to avoid looping...
  21. Replies
    5
    Views
    1,312

    Array from vector.

    I have a variable called Numbers of type NumberContainer which is defined as

    typedef std::vector<unsigned int> NumberContainer;
    and I need to get a pointer to the array. I tried

    unsigned int...
  22. Replies
    3
    Views
    2,425

    That solution isn't thread-safe, thanks anyway.

    That solution isn't thread-safe, thanks anyway.
  23. Replies
    3
    Views
    2,425

    Thread-safe singleton.

    Hello, I'm currently trying to do some time multi-threaded cross-platform application with multiple cores. I need to use some high performance singletons but I haven't been able to find a good...
  24. Replies
    2
    Views
    54,671

    std::wstring to wchar_t *

    I have a std::wstring variable and I need to get a wchar_t * from that std::wstring variable. I tried using the c_str() method from std::wstring but that returns a const wchar_t * so I get the...
  25. Replies
    3
    Views
    2,755

    Yes, wxWidgets is the best choice since it's easy...

    Yes, wxWidgets is the best choice since it's easy to use and the look of your application will look native to the OS that's running on.
Results 1 to 25 of 97
Page 1 of 4 1 2 3 4