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
S

Sendel

@Sendel
About
Posts
15
Topics
6
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • WMI - How do I use it ?
    S Sendel

    Thank you ! Long time ago when I asked this question, I thought I never get an answer, but I failed: Thank you, I will try that Link out. But I already looked into MSDN Help, so I think it would not help to solve my problem. May be I have to buy a good book in WMI-Programming because I need example sources to understand really how it works (its a little habit). Thank you :rose: Sendel The only place for millions of bugs is the Rainforest

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

  • fstream
    S Sendel

    if you don't want to include stdafx.h try this: go to Project->Settings->C/C++->Project Options and search for: ""/Yu"stdafx.h"" and replace it by "" (nothing) :laugh: (that means kick it !) and you don't need to include stdafx.h :wtf: Sendel The only place for millions of bugs is the Rainforest

    C / C++ / MFC help c++ ios question

  • 32-band equalizer
    S Sendel

    I hope that would help you: http://www.audio-software.com/bilder/eq32.png[^] http://www.arx.com.au/jpegs/EQ260-f-big2.jpg[^] I think the frequence is measured in logarithm to the basis 10 Sendel The only place for millions of bugs is the Rainforest

    C / C++ / MFC com tutorial question

  • How would you name this class ?
    S Sendel

    Strange :omg:, I always thought that "C" stands for MFC (Microsoft Foundation Class) so if you call your classes like "CMyClass" you say that your class is only for MFC. So I won't put any "C" before my class name ;P but anyway: My class isn't a real stream class, so I thought that "Stream" is not the right name for it: neither CMyVeryCoolAbsoluteUnbelivableWorkingBuglessSpiritRichMasterlyWorkOf ArtStream will do... I thought about packing names because it is packing data to one big block. Also DataCollector, BufferPacker, DataPatcher, DataConnector, DataWeld, DataSoupPot or DataMashCollectingTank...:wtf::laugh::omg::eek::laugh:;P So I am not sure what it really is... may be I have to expand it a littlebit more so it would be really a stream class: i have to overload the << and >> operators etc. in that way that you can use it as follows:

    network_in<>MyStream>>MyClass;

    but I don't think that it is possible to create such an intelligent class :| but any way: I will use this class to prepare Data to be send over network and also to be reconverted back to its old structure after receiving it on the second pc. datastructure -> Stream -> sending -> receiving -> Stream -> datastructure Thank you :rose: Sendel PS: I will release this code here for free anyway: if you want or if you don't!;P The only place for millions of bugs is the Rainforest

    C / C++ / MFC tutorial question testing beta-testing performance

  • How would you name this class ?
    S Sendel

    Hi, I have written a nice class (well, I think it's nice... may be other don't ;)) I have called it class Stream but I think it's a wrong name for that, but how do I name it ?! What the class do:

    Stream.begin();
    void * Stream.end();
    Stream.clear();
    Stream.add(void * data, int size);

    example on how to use it:

    Stream myStream;
    // Data for testing:
    void * t1 = allocateMem(11); // 11 Bytes
    void * t2 = allocateMem(21); // 21 Bytes
    void * t3 = allocateMem(31); // 31 Bytes
    // void * allocateMem(int size) is my function for allocating Memory... you can use memalloc as well
    // strings as Data -> don't for get the ending Zero pointer ('\0')
    memmove(t1,"1________x\0",11);
    memmove(t2,"2________xa________x\0",21);
    memmove(t3,"3________x_________xb________x\0",31);
    // 1234567890123456789012345678901
    /////////////////////1/////////2/////////3////////////////////////////

    myStream.begin(); // tell the class to clear old stream and prepare for new
    printf(" fill stream:\n"); myStream.add(t1,11); // adding data to stream
    printf(" fill stream:\n"); myStream.add(t2,21);
    printf(" fill stream:\n"); myStream.add(t3,31);
    printf(" --- stream completed ---\n");

    // end stream and return the resolving data with header and block information:
    char * myData = (char *) myStream.end();

    /////////////////////////////////////////////////////////////////////
    // rebuild data from stream:
    //

    // get header information:
    tStreamheader * pStreamheader = (tStreamheader *)myData;

    // how many blocks ?
    printf(" num of blocks: %i\n",pStreamheader->numblocks);

    // first block size?
    unsigned long * pBlocksize;
    char * pBlockdata = NULL;

    // offset to step throu stream
    unsigned long myoffset = sizeof(tStreamheader); // we want the data, so skip the header

    // loop to print out the data of the block
    for (int i = 0; i< (int) pStreamheader->numblocks; i++) // all blocks
    {
    pBlocksize = (unsigned long *) (myData + myoffset); // blocksize
    myoffset+=sizeof(unsigned long); // skip blocksize to get blockinfo
    pBlockdata = (char *)allocateMem(*pBlocksize); // make room for block data
    memmove(pBlockdata, myData + myoffset,*pBlocksize); // copy block data
    myoffset+=*pBlocksize; // skip block data to get next block lenght

    // print out what we got:
    printf(" Stream Block %i size = %u\n", i, *pBlocksize);
    printf(" Stream Block data = %s\n",pBlockdata);

    pBlockdata = freeMem(pBlockdata); // delete blockdata
    }

    t1 = freeMem(t1);
    t2 = freeMem(t2)

    C / C++ / MFC tutorial question testing beta-testing performance

  • i'm new
    S Sendel

    Strange name: "Mario Young i'm from Colombia and i like C++" :laugh: Welcome :)

    C / C++ / MFC c++

  • Macro Question / getting detailed Class / Functioncall Information
    S Sendel

    I have a problem with Macros in Visual C++.:(( I want to write a more Detailed ErrorMessage Class, which gives me a part of sourcecode where the Error occurs. There are some predefined Macros which will help me to that: Current File: __FILE__ and Current Line: __LINE__ but I did not find a Macro for Current Call.:confused: So I want to make it my self.:omg:

    #define __CALL__ "void myFunction(int value);"
    void myFunction(int value)
    {
    printf("current Call is %s", __CALL__);
    }

    but problem is that I have to redo this procedure on every Function with additional undef:

    #ifdef __CALL__
    #undef __CALL__
    #endif
    #define __CALL__ "void myNextFunction(int value);"

    So, I want to reduce manual work by autmating the following code:

    #ifdef __CALL__
    #undef __CALL__
    #endif
    #define __CALL__ "void myFunction(int value);"

    so i want to do something like this (multiple Preprocessorcalls in one Macro:

    #define SETFUNCTION(x) #ifdef __CALL__ #undef __CALL__ #endif #define __CALL__ x

    :wtf: But it all seems not to work or it is a hard handwork to insert this long code before each function. X| So here are my Questions: 1. :confused:Is there any possibility to get easier more detailed Debug Information? (like current Function call) 2. :confused:Is there any way to make a Macro of Macros ? (like #define def(x) #ifndef x #define x #endif) Thank you :rose:, Sendel

    C / C++ / MFC help c++ question debugging

  • WMI - How do I use it ?
    S Sendel

    Has anyone an example of using WMI in Visual C++ ?

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

  • What is DMI ?
    S Sendel

    How can I get Hardware Information via DMI ? Are there any examples in which case I can use DMI with Visual C++ ? thnx, Sendel

    C / C++ / MFC question c++ hardware

  • i am new in COM: what are COMs ?
    S Sendel

    thanks Sendel

    there is no spoon

    COM c++ question com

  • i am new in COM: what are COMs ?
    S Sendel

    What is COM and what do I use it for ? I am programming in Visual C++ 6.0 - do I need to know what COM is ? :confused::wtf::(:eek::~ X| :rolleyes::((:-O can someone explain it to me like if I am a 3 years old child ? thanks alot Sendel

    COM c++ question com

  • easy question about ServerSocket
    S Sendel

    I had the same problem, but dont give up: when i searched for "win32 socket" i found some really great help, now i am programming my own network class (without mfc). The main problem to solve this is to know that you need a threaded win32 network class. so first you have to write a class for win32 threads (you may find some code here). Next step is to look how tcp/ip works. Then you have to choose if you use udp or not. Then the rest is easy. good look ! sendel PS: keep your eyes open because if my class is ready I may add it here for free use:omg:

    C / C++ / MFC question help

  • Getting Systeminformations
    S Sendel

    This is my solution: i don't know where I found this source, but its quite good: and with comments ;-P #include #pragma comment(lib, "winmm.lib") DWORD GetCPUSpeed() { LARGE_INTEGER ulFreq, ulTicks, ulValue, ulStartCounter, ulEAX_EDX; // Query for high-resolution counter frequency (this is not the CPU frequency): if (QueryPerformanceFrequency(&ulFreq)) { // Query current value: QueryPerformanceCounter(&ulTicks); // Calculate end value (one second interval); this is (current + frequency) ulValue.QuadPart = ulTicks.QuadPart + ulFreq.QuadPart; // Read CPU time-stamp counter: __asm RDTSC // And save in ulEAX_EDX: __asm mov ulEAX_EDX.LowPart, EAX __asm mov ulEAX_EDX.HighPart, EDX // Store starting counter value: ulStartCounter.QuadPart = ulEAX_EDX.QuadPart; // Loop for one second (measured with the high-resolution counter): do { QueryPerformanceCounter(&ulTicks); } while (ulTicks.QuadPart <= ulValue.QuadPart); // Now again read CPU time-stamp counter: __asm RDTSC // And save: __asm mov ulEAX_EDX.LowPart, EAX __asm mov ulEAX_EDX.HighPart, EDX DWORD tmp = (DWORD) ((ulEAX_EDX.QuadPart - ulStartCounter.QuadPart) / 1000000); timediff = tmp/10000000.0*0.001; // Calculate number of cycles done in interval; 1000000 Hz = 1 MHz return tmp; } else { // No high-resolution counter present: return 0; } } Thanks for all information, =Sendel=

    C / C++ / MFC performance c++ graphics game-dev linux

  • Getting Systeminformations
    S Sendel

    That's what i have done already, so what i have is: Have: CPU Speed, Graphiccard Vendor, Driver Information, current Videomode, supported extentions Need: CPU Vendor, CPU Supported Chipsets (mmx, sse etc), Total Physical System memory, Free Physical System Memory, Graphiccard Total Video Memory, Graphiccard Free Video Memory, Graphiccard Memory Type (DDR, SGRAM, SDRAM...), Graphiccard supported Buffers (Quadbuffer, Front/Back Buffer, GBuffer, TBuffer,...), Graphiccard supported Videomodes But thanks alot for your help ! Sendel

    C / C++ / MFC performance c++ graphics game-dev linux

  • Getting Systeminformations
    S Sendel

    Hi, do someone know how to get Systeminformations (like Memory Usage, Device Information, CPU, Totalmemory) in Win32 C++ under WindowsXP / Windows 98 / Linux ? My Ideas: CPU With an Highresolutiontimer i can calculate the CPU Speed (MHz) but not the Facturer... I have found some sources for older cpus, but i can't detect newer ones and neither special attributes like do they use mmx or sse2... VGA With OpenGL I can retrieve Informations about the graphic adapter like extentions, current videomode. But I need Informations of video buffers (do they supply quadbuffer for iGlasses?) or video memory (128MB DDR, 93.2 MB free) Thanks alot for reading this, may be there is anyone who can help me... Sendel

    C / C++ / MFC performance c++ graphics game-dev linux
  • Login

  • Don't have an account? Register

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