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

Joseph Marzbani

@Joseph Marzbani
About
Posts
293
Topics
135
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • How to set keyboard focus to the other windows in the z-order?
    J Joseph Marzbani

    I want to bring the window that has been activated before my application's window in the z-order and set keyboard focus to it. there are 3 API related to this job in Windows APIs: BringWindowToTop (...) SetActivatedWindow (...) SetForegroundWindow (...) I've been trying all possible combination of these functions since yesterday, but I failed. The problem is I can bring the windows I like to the front, but those never get keyboard-focused. I've also tried ShowWindow (...), but It failed to set the focus to the windows too. what to do?

    C / C++ / MFC json help tutorial question career

  • ofstream can't write a "double" value into a file correctly
    J Joseph Marzbani

    thank you for your attention! 1. is that a STANDARD method or Implementation-Specific? (Yes I know I've already asked it. Just for sure) 2. What's that padding stfuff useful for? Why do compilers take such a strategy?

    C / C++ / MFC ios question

  • ofstream can't write a "double" value into a file correctly
    J Joseph Marzbani

    you're right (and I'm left :) but I meant "the sum of all memberss' size" when I said "the size of a structure". by the way do u know how I can make the compiler ignore that PADDING stuff? I mean a STANDARD way not an implementation-specific one. thnx

    modified on Wednesday, August 18, 2010 11:24 PM

    C / C++ / MFC ios question

  • ofstream can't write a "double" value into a file correctly
    J Joseph Marzbani

    congratulations! You're life's so meaningful :) cause I'd behaved so stupid!!! I was wrong and my compiler had emitted a warning too. and one more thing! thnx 4 introducing that modern compilet.

    C / C++ / MFC ios question

  • ofstream can't write a "double" value into a file correctly
    J Joseph Marzbani

    that code was what I got in real! by the way, did you mean I can rely on "sizeof" to write/read a whole structure into a file aborting that "padding" stuff? like when I don't know how it works under the hood

    C / C++ / MFC ios question

  • ofstream can't write a "double" value into a file correctly
    J Joseph Marzbani

    thank you! It was really helpful

    C / C++ / MFC ios question

  • ofstream can't write a "double" value into a file correctly
    J Joseph Marzbani

    Thank you! but one expects to get whatever he's saved on a file as the original value. I'll read that article for sure. but for now could you explain what should I do to save and retrive a "double" value. a short exam will be appreciated.

    C / C++ / MFC ios question

  • ofstream can't write a "double" value into a file correctly
    J Joseph Marzbani

    I've a structure like this: struct STRUCT { bool b; int i; double d; }str; // initializing str.b = true; str.i = 18; str.d = 20 and because I know I can't get the real size of a structure using operator sizeof, I write it into a file in this way:

    wofstream of("FileName.dat", ios:out
    of.write(reinterprete_cast <char*> (&str.b), sizeof(bool));
    of.write(reinterprete_cast <char*> (&str.i), sizeof(int));
    of.write(reinterprete_cast <char*> (&str.d), sizeof(double));

    and finally when I read it again into "str" and display it using cout, I got this values: str.b = true; str.i = 18; str.d = 20.001 why 20.001 instead of 20 is written? I took a look into the file using a HEX-Editor and I saw 20.001!!!

    C / C++ / MFC ios question

  • what is "wofstream" useful for?!!
    J Joseph Marzbani

    thank you so much. :rose: for you :)

    C / C++ / MFC question announcement

  • what is "wofstream" useful for?!!
    J Joseph Marzbani

    no, don't get it wrong. in my case, when I have such a line as of << L"فارسی"; It does not write ANY THING AT ALL into the file. strange, ha?

    C / C++ / MFC question announcement

  • what is "wofstream" useful for?!!
    J Joseph Marzbani

    no I have not, and thank you for your clue. I'll read it as soon as return back my home. and one more thing, could you please show me some more resources on these new things (STL::locals). I've no previous experience on that.

    C / C++ / MFC question announcement

  • what is "wofstream" useful for?!!
    J Joseph Marzbani

    yes I have. to be more clear, this damn class writes ASCII characters quiet well. the problem I have is about non-English characters. wofstream of (L"FileName.txt"); of << L"English"; // this works of << L"فارسی"; // this does NOT work of.close();

    C / C++ / MFC question announcement

  • what is "wofstream" useful for?!!
    J Joseph Marzbani

    no it's not! it just creates an empty file. I've tried it 10's times.

    C / C++ / MFC question announcement

  • what is "wofstream" useful for?!!
    J Joseph Marzbani

    as I've heard, the class wofstream narrows every thing when it writes to a file. that is it converts every wide character to a single byte one and then writes it to the file. in this way you can't have such a thing as: wofstream out(L"foo.txt"); out << L"unicode string"; so there is one question: what's this WIDE class useful for?!! how you name it WIDE version of "ofstream" while it can't be used with wide characters? and one more thing: why it takes a parameter of type char* as the file name? it's a wide class any way :)

    C / C++ / MFC question announcement

  • what are these process with user name SYSTEM
    J Joseph Marzbani

    I know it's a little more than a little funny :) but I don't know how some process have the user name SYSTEM within the window task manager while they are not a system process. E.g some anti viruses and ...

    C / C++ / MFC

  • how to write a function in a file at binary level (after compilation)
    J Joseph Marzbani

    because I need to write it anywhere I want. I don't want to use the simple copy-paste method.

    C / C++ / MFC tutorial

  • how to write a function in a file at binary level (after compilation)
    J Joseph Marzbani

    I know this may look a little more than a little strange! But for a reason I want to write a whole function in a file at run-time. OK, let's do some clarification: see you have a function like:

    void foo ()
    {
    your code ...
    }

    after compilation we have some thing like:

    // foo()

    push 210
    mov eax, ebx
    ...

    and in binary level:

    // foo()

    E8 00 DA 65 00 00 DF

    What I need is to write these binary codes in a file. Note 1- There's no such an instruction like mov eax, eip or pop eip in Intel instruction set. Actually there's no instruction to get or set eip directlt.

    Thank you masters!

    C / C++ / MFC tutorial

  • How to get the parent proccess's path
    J Joseph Marzbani

    I want to run an application (see child) so that it can get the path of the current process (see parent). How?

    Thank you masters!

    C / C++ / MFC tutorial question

  • File browser control in MFC
    J Joseph Marzbani

    Why don't you just use CFileDialog class?

    Thank you masters!

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

  • How to find out if a pe file has been packed?
    J Joseph Marzbani

    Hi masters! I'v written a code by which I can add a new section to pe files. But as I've noticed, some pe files are a little more intelligent than I thought :) Because as soon as I run them after I add the new section, a message says to me that this file has been modified! Even when I change a few first opCode begining at their entry point without add any section to them and without making any other change to them, the same message appears! Do you think they're "packed"? How can I find out? How can I find the original entry point?

    Thank you masters!

    C / C++ / MFC question 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