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
N

Not Knuth

@Not Knuth
About
Posts
12
Topics
3
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Vista Securities and Protections
    N Not Knuth

    Bram van Kampen wrote:

    This was the Answer I've been looking for for the last 18 Months.

    If that is true, either you haven't been looking very hard or you haven't been looking very wisely. I Googled the first five things that came to mind on this topic. In every case a solution was returned on the first page of results. But to be even more simple, I opened the help screen that comes with Vista. I clicked "Security and Maintenance" then clicked "What is User Account Control?" Finally I clicked "Turn User Account Control on or off." The answer was 3 clicks away. Now here's a question for you. Do you really think it is a good idea to stress the fact that it took you 18 months to find this answer that was right under your nose? You seem to be blaming CodeProject for this somehow. You might want to rethink that.

    The Lounge windows-admin hardware

  • FileSystemEventHandler arg type
    N Not Knuth

    Yes. It works perfectly. And it's very obvious... now that you point it out! :-O led Mike comes through again! Thank you.

    C# tutorial question csharp c++

  • FileSystemEventHandler arg type
    N Not Knuth

    I was trying to keep the code sample simple. Maybe too simple! This is part of a class that wraps FileSystemWatcher to provide some other functionality that is needed. The situation with the arg for this method arises because I need to be able to set the method(s) to be called by the delegates for the instance of FileSystemWatcher that is wrapped in the class. Thanks for trying to make sense of my sample code!

    C# tutorial question csharp c++

  • FileSystemEventHandler arg type
    N Not Knuth

    I need to create an instance of FileSystemEventHandler inside a function, using a parameter passed into that function. FileSystemEventHandler takes an Object type that represents the method called by the FileSystemEventHandler delegate. This would be easy with C++ since I can use a pointer to a method, but I'm lost in how to do it in C#. :confused: How can I pass this into my function so I can create the instance? For example: Where OnChanged is the method for the delegate to call.

    private void CallingFunc()
    {
    MyFunc(OnChanged); // ? How to prepresent this method?
    }

    // ? what type do I use as the input parameter here?
    private void MyFunc(SomeType theMethodToCall)
    {
    FileSystemEventHandler(theMethodToCall);
    }

    TIA :)

    C# tutorial question csharp c++

  • Catch C++ exception in C#
    N Not Knuth

    Thank you.

    C# question csharp c++ testing beta-testing

  • Catch C++ exception in C#
    N Not Knuth

    Liam O`Hagan wrote:

    What does the innerexception property show?

    The inner exception is null.

    C# question csharp c++ testing beta-testing

  • Catch C++ exception in C#
    N Not Knuth

    Following that logic, it is also the most inefficient solution! :rolleyes: It might turn out to be the best option. But perhaps there is another one that neither of us know. That is why I posted my question here.

    C# question csharp c++ testing beta-testing

  • Catch C++ exception in C#
    N Not Knuth

    I prefer to use the best method available. I am not yet convinced that yours is the best method. It will work, but it is very inefficient.

    C# question csharp c++ testing beta-testing

  • Catch C++ exception in C#
    N Not Knuth

    True. And thanks for your suggestion. But I hope there is a more direct way to accomplish the same thing. Surely the designers of the framework made some provision to catch unmanged exceptions AND get the data they may contain. (Unlike the RuntimeWrappedException.):sigh:

    C# question csharp c++ testing beta-testing

  • Catch C++ exception in C#
    N Not Knuth

    I have a legacy DLL written in unmanaged C++ that I need to use in a C# application. I can use it ok, but testing shows we don't get the string information when we catch any exceptions it throws. It throws a simple TCHAR string exception. example: throw(_T("My Exception Message.")) We can catch it in C# with the System.Exception class, but the string message is lost. (The Message member is empty.) We tried using a RuntimeWrappedException but that did not catch it. I can not change the code in the DLL. How can I catch these exceptions and get the string info they contain?

    C# question csharp c++ testing beta-testing

  • TCHAR Conversions from char*
    N Not Knuth

    Thanks, this works fine. But I am wondering how the macros work. I followed the code and see that it ultimately ends up at defs for MultiByteToWideChar and others. But of course the code is not shown. So I wonder if this is implemented as just a big lookup table or if there is some better way to approach this. Obviously this question has become somewhat academic at this point. My initial problem is resolved. But I am just thinking about how I would have implemented this and I don't see a better way than using a big lookup. That seems too clumsy.

    C / C++ / MFC question data-structures help tutorial

  • TCHAR Conversions from char*
    N Not Knuth

    I need some help converting between TCHAR strings and ASCII strings. (I understand that the actual type for TCHAR is decided by the compiler switches.) In this case, TCHAR is UNICODE. But I have a char* string passed into my function that I need to deal with. My questions: What's the best way to convert the char* string (array) to TCHAR? I'm doing it one char at a time in a loop, but I am hoping for something more elegant. How do I handle the ASCII end of string in TCHAR? For example, in one section I need to loop through the characters in the TCHAR string. I want to stop if I hit a new line from the char* string. That's easy in an ASCII string, but in UNICODE... well it's probably just as easy if you know what to look for! :~ Should I be looking for TWO TCHAR characters (0xA and 0x0)? or something else? Thank you!

    C / C++ / MFC question data-structures help tutorial
  • Login

  • Don't have an account? Register

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