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

amatecki

@amatecki
About
Posts
10
Topics
2
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Updating of article imported from GitHub
    A amatecki

    Latest revision (8) of article Feb 13 contains my latest changes I made manually using Code Project editor. It should be marked as "publicly available" (currently the previous revision 7 has this mark) because actually it is publicly visible. Feb 12 I pushed my last commit to GitHub. However, it didn't change the article content on Code Project, I noticed that GitHub webhook returned HTTP response code 500. The same day, couple minutes later I only changed headers of the article by Code Project editor. The next day Feb 13 I tried to manually redeliver GitHub webhook but without success (HTTP error 500 again). So I decided to make the changes manually on Code Project directly. Kind regards, Adam.

    Site Bugs / Suggestions help question

  • Updating of article imported from GitHub
    A amatecki

    hi, I imported an article from GitHub and couple of days later I pushed my recent commits to GitHub. However, I can't see any changes of article content on Code Project. Shouldn't it be automatically updated after commit to GitHub? Please help. Best regards, Adam.

    Site Bugs / Suggestions help question

  • how to: minutes to hours conversion
    A amatecki

    I found this piece of PL/SQL code in application exporting data into financial system. field_number is value of field type number (precision = 2)

    trunc(field_number / 60, 0) || ',' || round(100 * (field_number / 60 - trunc(field_number / 60, 0)), 2)

    ok, the code is pretty subtle but.. for example: what will be the result for field_number = 10 [min]. Let me guess, 0,16,67 ?

    The Weird and The Wonderful tutorial database question

  • C++ templates
    A amatecki

    what is the "myBA" ?

    C / C++ / MFC c++ wpf question

  • debugger position does not correspond source code
    A amatecki

    Sorry for my mistake, proper hex values of CRLF are: '\x0D' for CR and '\x0A' for LF. Values which I wrote earlier are related decimal values 13 and 10 respectively. I was thinking about hex values but wrote decimal :) it happens. In Your switch condition there is actually decimal value of 16 but not 10 as You expected. So, it not may be the cause of problem.

    C / C++ / MFC visual-studio debugging csharp c++ question

  • debugger position does not correspond source code
    A amatecki

    hi, it may be cause of fault in encoding of lines endings in Your source file, ie. from any reason at end of line instead of standard windows CRLF code ('\x0D','\x0A') appear the CR code ('\x0D'). Debugger counts line endings and if any encoding of line end differs from the other it may results in wrong line highlighting. To eliminate this problem You can use any text tool that can re-encode the line endings in Your source file to standard windows encoding or You can use Visual Studio editor feature "Save With Encoding" into "Save File As..." dialog. I would try first in VS do "Save File As..." -> Unix/Macintosh and next "Save File As..." -> Windows.

    modified on Tuesday, August 25, 2009 9:28 AM

    C / C++ / MFC visual-studio debugging csharp c++ question

  • Sending keystrokes to other *non-focus* application
    A amatecki

    SendInput and keybd_event functions insert keyboard events into the keyboard input stream and these events are received by active/focused window. If You would like to send keystroke to non-focused window You probably should send message directly to that window.

    C / C++ / MFC help question

  • Default constructors...
    A amatecki

    «_Superman_» wrote:

    The auto generated default constructor will initialize all class data members to 0.

    Are You sure? I think it may be behavior of specific compiler You use.

    «_Superman_» wrote:

    The auto generated copy constructor will do a bit by bit copy of all data members from one instance to the other.

    It's true rather for members of built-in types. For members of user defined types, straightway, is used method of constructing member objects with the help of their constructors.

    C / C++ / MFC c++

  • difficulty coming up with the right format.
    A amatecki

    function declaration should look rather like the following: int AddY(System::Object __gc * yValue __gc []); or int AddY(System::Object* yValue[]); params keyword isn't supported in C++, so this function should be called with argument of type array of Object*.

    int AddY(Object* yValue[])
    {
    return yValue->Length;
    }

    Object* arr[] = new Object*[2];
    ar[0] = __box(1.1);
    ar[1] = __box(2.1);
    AddY(arr);

    Managed C++/CLI c++ dotnet data-structures help question

  • How to pass a pointer of data to the managed side on a C++ wrapper
    A amatecki

    Hi, You could try something like this:

    // CnvBuffLib.h

    #pragma once

    #include <memory.h>;
    #include <string.h>;

    using namespace System;

    namespace CnvBuffLib
    {
    public __gc class ConvertBuffer
    {
    const char __nogc * const _buffer;
    static const int bsize = 256;

        public:
        ConvertBuffer()
        : \_buffer(new char \_\_nogc \[bsize\])
        {
        }
        
        ~ConvertBuffer()
        {
            delete \[\] \_buffer;
        }
        
        int GetPacket()
        {
            // sample of source data
            char tmp\[\] = {'t', 'e', 's', 't'};
            int tmplen = sizeof(tmp);
            
            // clear buffer
            char \_\_nogc \* \_bp = const\_cast<char\*>(\_buffer);
            \_bp = static\_cast<char\*>(memset(\_bp, 0, bsize));
    
            // copy data to buffer
            memcpy(\_bp, tmp, tmplen);
            
            return tmplen;
        }
    
        // this function copies native buffer to managed buffer (C# side)
        SByte GetData() \_\_gc \[\]
        {
            int rlen = strlen(\_buffer);
            if(rlen == 0)
            return 0;
            
            SByte result\[\] = new SByte\[rlen\];
            char \_\_pin \* presult = &result\[0\];
            
            memcpy(presult, \_buffer, rlen);
            
            return result;
        }
    };
    

    }

    Managed C++/CLI csharp c++ 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