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
J

Johan Bertilsdotter

@Johan Bertilsdotter
About
Posts
6
Topics
3
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Indata validation char* input
    J Johan Bertilsdotter

    I have dll that export funtion and on of the parameters is C-style strings a serial number. extern "C" int __stdcall calc(char *SerialNumber) The parameters can be come from VB, C#, C++ , C I want to make som basic indata validation check that C-style is good kondition. That point is not pointing at null and that the array is null-terminated. Somebody can point me in the right direction. I don't want buffer over flow with staring to handel the string. Code sample?

    C / C++ / MFC csharp c++ data-structures question

  • How to register a new List<IChecker> to Actofac ContainerBuilder
    J Johan Bertilsdotter

    var servers = new List {
    //Server1
    new DatabaseSystem { ServerName = "ANTIVIRUS" },
    new DatabaseSizes { ServerName = "ANTIVIRUS"},
    new DiskBackup { ServerName = "ANTIVIRUS"},
    new SqlServerEventLog { ServerName="ANTIVIRUS"},
    new DiskSystem { ServerName="ANTIVIRUS"},
    //Server1
    new DatabaseSystem { ServerName="SEJKG-S-DB01" },
    new DatabaseSizes { ServerName = "SEJKG-S-DB01"},
    new DiskBackup { ServerName = "SEJKG-S-DB01"},
    new SqlServerEventLog { ServerName="SEJKG-S-DB01"},
    new DiskSystem { ServerName="SEJKG-S-DB01"},
    };

    var builder = new ContainerBuilder();
    builder.RegisterInstance(notifiers).As>();
    builder.RegisterInstance(servers).As>();
    builder.Register(c => new ServerChecker(c.Resolve>(), c.Resolve>()));
    return builder.Build();

    I have a problem with how I should register my "where server = new List {..} 'to the Container Builder. My List of iChecker passed as a parameter to a ServerChecker. So much have I been able to solve, but not the list itself but I must have outside. The usual list of servers is much greater.

    C# sysadmin docker help tutorial

  • wsprintf in 32 and 64 bit windows.
    J Johan Bertilsdotter

    Thank you. I missed that on my project. It’s work perfect. Some of my collage at work pointed out that change to “std::string” in the project. But still the interface to dll need to be native C with c-style string. Is std::string more neutral to the character set? Comming from Delphi to C# world then C/C++ for this project lot of reading "new" things. My old Charles Petzold book is back on the self again. ;D

    C / C++ / MFC c++ help announcement

  • wsprintf in 32 and 64 bit windows.
    J Johan Bertilsdotter

    Can i change the code copy to the szVer in a better way that does not use wsprint. Just want the format. xx.xx.xx.xx

    C / C++ / MFC c++ help announcement

  • wsprintf in 32 and 64 bit windows.
    J Johan Bertilsdotter

    When compling in platform win32 works. Whan compile in x64. cannot convert parameter 1 from 'char [512]' to 'LPWSTR' in the wsprintf call first parameter szVer. Understand that de definition "change" för char in the call or I have tride windhows.h and TCHAR.

    C / C++ / MFC c++ help announcement

  • wsprintf in 32 and 64 bit windows.
    J Johan Bertilsdotter

    CFileVersionInfo fvi;
    char szVer[ 512 ] = { 0 };
    if( fvi.Open( _T( "Econovent.dll" )))
    {
    ::wsprintf( szVer,
    _T( "%d.%d.%d.%d" ),
    fvi.GetFileVersionMajor(), // Major version
    fvi.GetFileVersionMinor(), // Minor version
    fvi.GetFileVersionBuild(), // Build number
    fvi.GetFileVersionQFE() // QFE
    );
    fvi.Close();}

    It works perfect in win32, But when complied in x64 the "wsprintf", stops working. Are the a better solution that works in x64 and win32 at the same time. I understand that i have change. I have tried but then its not working in win32 mode. The code need to be old C-style version. I'm not native C/C++ i'm just trying to fixa a "bug".

    C / C++ / MFC c++ help announcement
  • Login

  • Don't have an account? Register

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