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
A

Andy Wieberneit

@Andy Wieberneit
About
Posts
11
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • SourceSafe and References to COM Objects
    A Andy Wieberneit

    When managing our .NET projects with Visual SourceSafe, we encounter this problem: DeveloperA works on a .NET project. This project has a reference to a COM object. DeveloperA checks in his files into SourceSafe. Next day, DeveloperB works on the same .NET project. Although he has the same COM oject installed on his computer, the reference is invalid (indicated by a yellow triangle with an exception mark inside). DeveloperB has to delete the reference, and set a new reference to the same COM object. Is there any way to avoid this deleting and re-creating of references?

    C# csharp com help question

  • DLL integration
    A Andy Wieberneit

    regsvr32.exe is a utility used to register COM objects on your computer. A COM object lives in a DLL that exports a couple of pre-defined functions, such as DllRegisterServer. If you want to install a COM (or ActiveX, which is the same) DLL on your computer, you may use regsvr32.exe to do that. If you have a simple DLL, however, which does not contain any COM objects, you do not need to run regsvr32.exe; in such a case, you can simply call the functions exported from that DLL, maybe by using the DllImport attribute (if you want to do it with C# or VB.NET).

    C# question graphics game-dev help

  • Accessing C++ classes from within C# .NET
    A Andy Wieberneit

    If you want to use C++ classes that are exported from a DLL, you should write a simple wrapper class library in Managed C++. You can then use that wrapper class library from your other .NET projects. For more details and a simple sample project, look at: http://www.codeguru.com/Cpp/Cpp/cpp\_managed/interop/article.php/c6867/

    C# help csharp question c++ debugging

  • datatype check
    A Andy Wieberneit

    - Read one line - Parse that line for '#' - Split the line into its substrings - Analyze any substring, using String.IndexOfAny( "ABCDEFG..." ) - If index found, it is a string; else, it is an integer

    C# question csharp tutorial

  • do get_ and set_ have to be used in conjunction?
    A Andy Wieberneit

    The reason for this error is that your private member variable (dataSectionPtr) has the same name as your property. That's because from your get_ method, the compiler will generate a property dataSectionPtr. Just rename your private member variable, and your code will compile.

    Managed C++/CLI csharp c++ visual-studio help question

  • SerialComm
    A Andy Wieberneit

    Look for the article: "Use P/Invoke to Develop a .NET Base Class Library for Serial Device Communications" in the MSDN.

    Managed C++/CLI help

  • Circular dependency solution?
    A Andy Wieberneit

    Why not have the plugin simply implement a delegate/event? The main application would add a handler for that event. Each time the event is caught, the main app could make a call into the plugin. Hence the plugin would initiate a call from the main app.

    C# csharp visual-studio question

  • Is this a pointer operation ?
    A Andy Wieberneit

    If your C++ code is managed C++: yes, in fact it is. If your C++ code is unmanaged C++: no, it's not the same. Pointers in managed C++ are managed by the garbage collector, as are the reference types in C#. Hence you don't have to (and you will not be able to)delete them manually. Pointers in unmanaged C++, however, are completely at your mercy, so you have to take care of them via the delete operator.

    C# question csharp

  • Returning array references
    A Andy Wieberneit

    If you want to have an array of integers in a managed class, you would normally do something like this:

    __gc class MyClass
    {
    private:
    int myArray[];
    public:
    int* getArray()
    {
    return myArray;
    }
    };

    You don't need to specify everything as __gc. If your class is already managed, its members are managed automatically.

    Managed C++/CLI data-structures question

  • unmanaged class declaring managed member function as friend
    A Andy Wieberneit

    I don't think you really need that friend directive. Most probably, you could simply make your classes public and avoid inline methods. It seems that you want to call a managed method from an unmanaged class. However, this can't be done by a direct call, because managed objects are subject to garbage collection. To get a safe entry point into the managed heap, you have to use a GCHandle, which in turn is wrapped by the gcroot template. Try this:

    #include <vcclr.h>
    class ManagedClass;
    class UnmanagedClass
    {
    public:
    UnmanagedClass( ManagedClass* p );
    private:
    gcroot< ManagedClass* > m_pManaged;
    }

    You can then make your calls into the managed class with the m_pManaged pointer. There might be another problem: Since you have both managed and unmanaged code in one project, this project needs to be linked in mixed mode. This is because for the unmanaged code, you need the C runtime, which requires an entry point as well as statics. For an instruction of how to convert your project to mixed mode, see the article: "Converting Managed Extensions for C++ Projects from Pure Intermediate Language to Mixed Mode" in the MSDN.

    Managed C++/CLI question

  • how to use the dll developed in VC6
    A Andy Wieberneit

    Seems that your dll is delivering strings. If you want to get a string from a dll, you should use a string builder. Try something like this: StringBuilder sb = new StringBuilder( 256 ); [DllImport( "myDll.dll" )] public static extern void GetString( StringBuilder sb ); void myFunc() { GetString( sb ); Debug.WriteLine( "String = " + sb.ToString() ); }

    C# question csharp visual-studio 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