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
G

georgeraafat

@georgeraafat
About
Posts
29
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • wcscpy_s issues [modified]
    G georgeraafat

    According to: http://msdn2.microsoft.com/en-us/library/td1esda9.aspx[^] the sizeof(array) should correspond to the number of 'characters' - not 'bytes'. So - in case of ANSI, it's bytes. In case of unicode, it's words (2-bytes). When the code you listed compiles for unicode, sizeof(array) is 200 - which is double the actual number of characters. Note that _tcscpy_s() zeros out the buffer after copying... and that's when you get the buffer overrun. You can find that out by stepping into _tcscppy(). You can use (sizeof(array)/sizeof(array[0])) or the _countof() macro. gmileka

    C / C++ / MFC data-structures help

  • Build Script
    G georgeraafat

    You can wrap this in a script and set it to be run as a post-build event. To do that, check out Project->Properties->configuration Properties->Build Events->Pre-Post-Build Event gmileka

    Managed C++/CLI c++ com tools

  • CWinFormsControl Problem
    G georgeraafat

    Wouldn't that change the class layout depending on who's including it? For example, if I include the header in a .cpp that is compiled native, the class layout does not contain the managed memeber. If I include the header in a .cpp that is compiled /clr, the class layout contains the managed memeber... This means they are essentially two different classes with the same name... The linker should emit an error in that scenario and not allow it... I haven't tried it though, so I might be wrong. gmileka

    Managed C++/CLI csharp c++ dotnet help

  • want to learn CLI, where to start?
    G georgeraafat

    Depending on your goal of learning C++/CLI. You can think of C++/CLI as a language/technology just like C# - which means you don't have to learn COM to be able to write meaningful applications. However, in many cases, the reason people learn C++/CLI is to cross between the native and managed worlds... So, this means that the user need to understand their native code base and what technologies it is relying on to make the decision on what to learn... So, I think you won't 'have to' to learn COM unless you have some native C++ code that relies on COM... And for most native applications this is the case... The "Pro Visual C++/CLI and the .NET 2.0 Platform" book by Fraser and published by Apress is a good start... gmileka

    Managed C++/CLI learning csharp c++ com tutorial

  • COMCTRL32 Manifest
    G georgeraafat

    The wizard generated code for MFC apps adds code to stdafx.h to tell the linker to add the 6.0 manifest specific information. You can make sure you don't have this code for the dlls where you want to load the pre-6.0 dll. I would think that you need to load the pre-6.0 before loading the 6.0 one. gmileka

    C / C++ / MFC performance tutorial question announcement

  • Visual Studio 2005 conversion problem/question.
    G georgeraafat

    How about this: _AFX_THREAD_STATE* pState = AfxGetThreadState(); MSG msg = pState->m_msgCur; ? gmileka

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

  • Serialization Issue with Int32
    G georgeraafat

    I think you need to change the defintion of TestStruct i from Int32^ i; to Int32 i; for this to work. gmileka

    Managed C++/CLI data-structures json help question announcement

  • Mixing native and managed code
    G georgeraafat

    What is the runtime exception? Who is throwing it? You should not need to rebuild all your static libraries with /clr. You only need the /clr switch for the interop files - those the bridge the native and the managed world. gmileka

    Managed C++/CLI c++ question csharp dotnet winforms

  • New Document in MDI application
    G georgeraafat

    How do you choose which window to write to? or which document/view to write to? Looks to me that you create the new document/view successfully, but you are still targetting the older (current) document/view... If that's the case, look for how to enumerate documents in the MDI app and then you can direct your output to the write document... gmileka

    C / C++ / MFC question

  • How can I Export DllUnregisterServer in VC++?
    G georgeraafat

    I'm curious how the MFC dll was created through the Wizard... and which VS is being used. Since this is a C++/CLI forum, I would expect some interaction between the 'managed' MFC stuff and your declaration. gmileka

    Managed C++/CLI c++ question help

  • How can I Export DllUnregisterServer in VC++?
    G georgeraafat

    Based on: http://msdn2.microsoft.com/en-US/library/5k6kw95a.aspx[^] You will get this error if the prototype is defined twice with different linkage... In otherword, some already defines DllRegissterServer(void) before you header definition... To find it, you could add the compiler switch /P to the CPP including the header file. Then, right-click on the file and select 'compile'. This will output a file to disk that has all the included file and the line numbers... You can then search it for DllRegisterServer and figure out where it's coming from. Remember to remove the /P switch before building your project. I'm not sure what type of MFC dll you're using - but the other definition is coming from MFC most likely... gmileka

    Managed C++/CLI c++ question help

  • How can I Export DllUnregisterServer in VC++?
    G georgeraafat

    STDAPI resolves to EXTERN_C HRESULT STDAPICALLTYPE So, both STDAPI __declspec(dllexport) and __declspec(dllexport) ATDAPI won't work because of the order of individual pieces when mixed with __declspec. The following seems to work and achieves the same result: Header: extern "C" __declspec(dllexport) HRESULT __stdcall MyFunc(void); CPP: HRESULT __stdcall MyFunc(void); { } If I do a "dumpbin /exports dllname.dll", I get _MyFunc. gmileka

    Managed C++/CLI c++ question help

  • [MFC] TextBox
    G georgeraafat

    Yes - ES_NUMBER is defined in winuser.h. The .rc files can include headers. gmileka

    C / C++ / MFC c++ help tutorial question

  • [MFC] TextBox
    G georgeraafat

    You can use the ES_NUMBER style when creating the control. If the IDE does not expose this style, edit the .rc manually and add it. gmileka

    C / C++ / MFC c++ help tutorial question

  • How can I Export DllUnregisterServer in VC++?
    G georgeraafat

    What is the error you get? gmileka

    Managed C++/CLI c++ question help

  • Newbie: About passing parameter into a form
    G georgeraafat

    You need to convert the 'int i' to a C string. You could use itoa() or printf(). Make sure the buffer is large enough to hold the resulting string. Once you have a C string, convert it to a 'System::String'. You don't need to convert it to __gc textbox because you're assigning it to the 'Text' property of the text box... The property expects a string. gmileka

    Managed C++/CLI help c++ tutorial

  • Microsoft is looking for potential C++ MVPs
    G georgeraafat

    They have MVPs all over the world. They are not only looking for North America MVPs. gmileka

    Managed C++/CLI c++ com architecture help

  • Newbie: Using a com object in VC 7.1
    G georgeraafat

    The following line: InDesign.Application app = (InDesign.Application) COMCreateObject("InDesign.Application"); should be: InDesign::Application app = (InDesign::Application) COMCreateObject("InDesign.Application"); (not sure what COMCreateObject returns). In general, whenever you are qualifying something with a namespace, use the scope operator ::. Unlike C#, C++ differentiates between types and instance of types. For type qualification, it's type::identifier or namespace::identifier For instance qualification, it's instance.identifier or instance->identifier (those are only examples of course). C# always uses the dot operator no matter what... gmileka

    Managed C++/CLI help c++ com csharp java

  • Newbie: Using a com object in VC 7.1
    G georgeraafat

    The 'using' statement should do the trick. Why do you have it commented out? gmileka

    Managed C++/CLI help c++ com csharp java

  • Constructor problem
    G georgeraafat

    I would add a constructor to tDot. class tDot { public: float fX, fY; tDot(float newfX, float newfY){ fX=newfX; fY=newFY; }; }; class tCircle { public: tCircle( void ); tCircle( float, float, float ); tCircle( tDot, float ); public: float fRadix; tDot cCenter; }; tCircle::tCircle(double newX, double newY) : cCenter( newX, newY) { } gmileka

    C / C++ / MFC help question
  • Login

  • Don't have an account? Register

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