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
_

_NielsB

@_NielsB
About
Posts
22
Topics
12
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • plz help me, how can read and write AVI files?
    _ _NielsB

    Please try to give us more informations on your task. Do you want to save fragments of an source-avi to a new avi? Do you want to transcode the streams? DirectShow is also provided for C# ... have a look at: http://sourceforge.net/projects/directshownet/[^]

    C / C++ / MFC help question

  • plz help me, how can read and write AVI files?
    _ _NielsB

    I think you are searching for DirectShow (DS). You should have a look at the Multimedia Chapter on Code-Project, here are some samples on how to use DS. DS is well documented here: http://msdn2.microsoft.com/en-us/library/ms783323(VS.85).aspx[^] ... have a look at the supported formats here: http://msdn2.microsoft.com/en-us/library/ms787745(VS.85).aspx[^] Regards!

    C / C++ / MFC help question

  • SAPI within Windows SDK?
    _ _NielsB

    Hi! I want to take a closer look to Microsofts Speech API version 5.3 (unmanaged). The first thing: where can I obtain the API? One source says, its part of the Platform SDK, the next it is part of the Windows SDK. So, the Windows SDK is the newer one, but is the Windows SDK for Vista only? Or can i run and develop Apps for Win2k, XP and Vista on a XP-Platform with it? Regards!

    C / C++ / MFC json question announcement

  • Serialize / De-Serialize struct to Buffer
    _ _NielsB

    Ah ... thank you again :)

    C / C++ / MFC help data-structures question announcement learning

  • Serialize / De-Serialize struct to Buffer
    _ _NielsB

    Well, another beginner issue from me. I want to serialize several structs to a char array. In the end, the char* should point to smth like this: Finnaly, i want to de-serialize the B2 from this array to a new B2_dupe; The problem: with my code, B2_dupe is not filled correctly. If you dont mind, please have a look at the following code- #pragma pack(1) struct A { A(){ Sig1 = 'A'; Sig2 = 'B'; Sig3 = 'C'; Version = '1'; Numbers = 2; Reserved = 0; Offset = 0; } char Sig1; char Sig2; char Sig3; char Version; char Numbers:7; char Reserved:1; unsigned long Offset; }; struct B { B(){ Id=0; Reserved=0; Offset=0;} char Id:7; char Reserved:1; long Offset; }; #pragma pack() // calc size int sizeA = sizeof A; int sizeB = sizeof B; // struct A A a; a.Sig1 = 'D'; // struct B #1 B b1; b1.Id = 0; b1.Offset = 0; // struct B #2 B b2; b2.Id = 1; b2.Offset = 0; // serialize int nSizeSer = (2*sizeB)+sizeA; char* pBuff = new char[nSizeSer]; memcpy(pBuff, &a, sizeA); memcpy(pBuff+sizeA, &b1, sizeB); memcpy(pBuff+sizeB, &b2, sizeB); // de-serialize B b2_dupe; int offset = sizeA+sizeB; pBuff+=offset; //move ptr memcpy(&b2_dupe,pBuff,sizeB); I checked b2_dupe.Offset and this should be zero ... but it isnt (-842150451). Why is that? Thanks in advance :)

    C / C++ / MFC help data-structures question announcement learning

  • Newbie Question on C Pointers
    _ _NielsB

    Looks nice :D Thnaks alot.

    C / C++ / MFC question json performance tutorial code-review

  • Newbie Question on C Pointers
    _ _NielsB

    Hello again! Thank you for your adwises :) The real task I want to test is to append buffB to buffA. Asume there is a function-call that gives me 2 pointers to buffers (p_buffA and p_buffB) and the size of each of them (n_A and n_B). The function should retur the new pointer to buffA and the new size (f.e. saved in a struct). Now I am using c++ new / delete to allocate and free memory. // buffA int n_A = 30; char* p_buffA = new char[n_A]; memset(p_buffA, (int)'a', n_A); // buffB int n_B = 50; char* p_buffB = new char[n_B]; memset(p_buffB, (int)'b', n_B); // append buffB to buffA, use temp buffAB int n_AB = n_A + n_B; char* p_buffAB = new char[n_AB]; // cpy memcpy(p_buffAB, p_buffA, n_A); // copy buffA to buffAB memcpy(p_buffAB+n_A, p_buffB, n_B); // copy buffB to buffAB // buffA and buffB are no longer neaded -> delete delete [] p_buffA; delete [] p_buffB; // set buffA to buffAB p_buffA = p_buffAB; n_A = n_AB; Is this snipet ok? Are there better ways to solve this issue?

    C / C++ / MFC question json performance tutorial code-review

  • Newbie Question on C Pointers
    _ _NielsB

    Hello, I try to understand memory management and pointers in C on a simple level right now. Here is the task: concatenate 2 buffers (in this case buffA & buffB to buffAB). The values of the following code-snipets are small for debugging purposes ... imagine the size of each source buffer is much larger: how can I propper clean up the "mess" after creating buffAB? // buffA char buffA[] = {'a'}; char* p_buffA = &buffA[0]; // buffB char buffB[] = {'b','b'}; char* p_buffB = &buffB[0]; // buffAB char buffAB[] = {'x','x','x'}; char* p_buffAB = &buffAB[0]; // cpy memcpy(p_buffAB, p_buffA, 1); // copy buffA to buffAB memcpy(p_buffAB+1, p_buffB, 2); // copy buffB to buffAB // buffAB is the only thing we want ... how to clean up the rest? I am thankfull for all suggesting to improve the code.

    C / C++ / MFC question json performance tutorial code-review

  • 4 bit datatype?
    _ _NielsB

    Hi, I need to define a datatype with a size of 4 bit within a struct. char has a size of 8 bit and thats the smallest type I know ... So what else should I do? I really dont know how to search for this, sorry. btw: I think I saw something like "unsigned short varName:4" in a code-snipet. Does this mean the varName holds 4bit of data? Thanks in advance!

    C / C++ / MFC tutorial question

  • How to get information about installed codecs ...
    _ _NielsB

    ... or supported MIME-Types? I try to code a tiny Multimedia-App (which also uses DirectShow). For error handling, i need to know something about the capabilities of the desired Viewer (supported Audio- / Videocodecs). Any idea, how to get a list of installed codecs on the local machine? I dont know where to look :-| Hints are very welcome :-|

    C / C++ / MFC help tutorial question

  • Post-build event problem
    _ _NielsB

    I'm not familiar to that, but my lastly asked question is kind of related to your problem. I'm using the command copy "$(InputPath)" "$(OutDir)" within a custom build-step of a project-file. Works fine for me, except for the error message when the file allready exist ;) But I hope this will be solved soon.

    Visual Studio help question

  • Custom Build Step: copy if not exist
    _ _NielsB

    Hi! How is it possible to check if a file allready exist in a custom build - step? I have to copy a file to a specific folder while building the Projekt. Using copy "$(InputPath)" "$(OutDir)" will cause an error if the file allready exist. I'm using VS 2005. btw: is there a documentation on using custom-steps within VS? Regards!

    Visual Studio visual-studio help question

  • [GDI] x-offset when using Graphics::DrawString(...) [modified]
    _ _NielsB

    As I wrote, it seems to depends on the Font that is in use within the function call.

    C / C++ / MFC graphics help question

  • [GDI] x-offset when using Graphics::DrawString(...) [modified]
    _ _NielsB

    Hello! I am using the following Function to draw text to a screen:

    Status DrawString( const WCHAR *string,
    INT length,
    const Font *font,
    const PointF &origin,
    const StringFormat *stringFormat,
    const Brush *brush
    );

    Works fine, but there is one major problem : even if I use PointF(0,0) as origin, the text is displayed with an x-offset (the concrete width in pixel seems to depend on the Font-Object I use within the DrawString - Function). Any Solution about that? Is this a known bug or even a feature? ;) Thanks in advance! -- modified at 6:43 Wednesday 24th January, 2007

    C / C++ / MFC graphics help question

  • "MS Paint-style" text input on CWnd
    _ _NielsB

    I have to put some graphical functions to an dialog-based application using MFC/GDI/GDI+. One of them is to give the user the abbility to write text-comments on a image. Like you can do in MSPaint (and Photshop, GIMP ... ). I found thats relatively easy to parse the mouse - and keyboard input and simply write it to screen (using Graphics DrawString - Method), but it seems to be not trivial to enable editing of the written text (blinking cursor when double-clicking on the text ie). Or setting up a correct-sized (and blinking ;) ) cursor to signalize, that the app is ready to parse keyboard input. So, does someone got a idea how to implement MSPaint-like text input on CWnd? Searched for 2 days for demo-projects or smth like that, no success at all. Thanks in advance and sorry for my ******* english.

    C / C++ / MFC graphics c++ winforms tutorial question

  • ToolStrip Docking Events
    _ _NielsB

    Ok, found it out myself: The ToolStrip.BeginDrag and ToolStrip.EndDrag - Events should help :)

    .NET (Core and Framework) com tutorial question

  • ToolStrip Docking Events
    _ _NielsB

    What kind of Event(s) is thrown, when a ToolStrip-Control is docked to a ToolStripContainer - Panel after a Drag and Drop Operation? Need this to re-arange the ToolStrip-Items when the Docking-Status changes. I had a look at this MSDN Walkthrough - especially Point 17. Sadly, this article does not discuss the Events to handle. Thanks in advance, Niels

    .NET (Core and Framework) com tutorial question

  • MFC Toolbars ... View - embedded
    _ _NielsB

    Hi! I found a lot informations about toolbars here (http://www.codeproject.com/docking/). But I'm really looking for an answer to this question: Is it possible to add MFC-Toolbars to embedded Containers other than the Main-Application Window? Example: VS.Net (7.1) - there nearly every Container (like "Properties", or "Class View") has its own Toolbar. Could this be made with MFC - Methods? Hope this was understandable ... I'm still not really into this MFC-Library. Thanks in advance!

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

  • GDI+ drawings on background image
    _ _NielsB

    :) think that will work! thanks

    C / C++ / MFC graphics winforms help tutorial question

  • GDI+ drawings on background image
    _ _NielsB

    Im trying to implement something like that: the user should be able to draw some graphical objects to a CWnd, that allready holds a Bitmap. I tried to realize this by using GDI+ ... storing the Objects as GraphicsPath in a List and draw them by using Graphics::DrawPath(...). Works fine so far. Problem: how to implement undo and clear functionallity? I tried to use Graphics::Clear(...) to 'empty the Window' and repaint all remaining Objects. But this will also reset the background-image ... but the background should _not_ be manipulated. So i thought about using some kind of layer, but really dont know how to start. Any hints / suggestions / keywords? Thanks in advance _NielsB

    C / C++ / MFC graphics winforms help tutorial 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