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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
D

digitalmythology

@digitalmythology
About
Posts
8
Topics
4
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Change bg color of editbox.
    D digitalmythology

    As soon as I can, I'll get you a working, practical piece of real-worl code. For now though, try this from MSDN : http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/editcontrols/editcontrolreference/editcontrolmessages/wm_ctlcoloredit.asp[^]

    -digitalmythology -dm

    C / C++ / MFC question

  • Modal and Modeless Dialogs / Non-Working child dialog controls ...
    D digitalmythology

    Not creating another instance, but rather creating a child dialog [of which I am clueless]. I prefer dto do a modeless version, but want to see Modal code as well. And thanks for the tip on "at the point of when you are through with it", but what I meant was where does the code GO? Probably CSomeClassName::OnDestroy(); but could you "dumb it down" for me? does code to destroy a child dialog go in the .cpp file for that dialog, or the .cpp file for the main dialog [parent that calls it]? "Not in a child dialog" means : that any code I write, [which is correct], will execute properly when used in the main dialog and by clicking the appropriate button on the main dialog. The exact same code will not work for a button on any of the child dialogs, except for the default AboutBox that MSVC6 included in the project. My guess is that I am not construction method[s] are wrong for the child dialogs that I made. Thanks for the help .... message me on Y! at digitalmythogy

    -digitalmythology -dm

    C / C++ / MFC c++ csharp performance help question

  • Modal and Modeless Dialogs / Non-Working child dialog controls ...
    D digitalmythology

    Reposting my own code is not much of a help. I need code that shows how to do it correctly. 'A modeless dialog needs to be a member variable. Otherwise, you've thrown a pointer to the wind, and have no way to do anything with it from there on in." I've heard of this solution before, but how do I actually DO it? Just saying it works for most people, but , as I" am a tactical person at times, I need to see actual code. What variable type does the dialog box need to be? CString, int, BOOL, or what? Apologies if I sound crabby, but there are millions pf sites out there on the 'ignorant net', and most issues I can resolve with research, trial, and error. However, there occassionally comes an issue to which everybody has an answer, but nobody wants to show how its actually done. What's the big M$DN secret on these subjects? Thanks, again. I really appreciate it.

    -digitalmythology -dm

    C / C++ / MFC c++ csharp performance help question

  • Modal and Modeless Dialogs / Non-Working child dialog controls ...
    D digitalmythology

    Thanks in advance, fellow coders. I am creating a dialog based app in MSVC++ 6.0. [No I AM NOT switching to .NET, or should I say .NOT working, LoL). Anyway, my dilema is this : I have 1 main dialog, an AboutBox, and 7 child dialogs. My functions / code for my child dialog buttons wil not work. The exact same code will work when tested in the main dialog or the AboutBox. The AboutBox is a default modal dialog generated by MFC using DoModal. I have now idea how DoModal works [code please?], but I am going for modeless, preferably anyway. This is a snippet of code [from my main dialog's .cpp file], used to dispaly one of the modeless dialog boxes :

    void CInvenStoryDlg::OnButtonNewitem()
    {
    // TODO: Add your control notification handler code here
    CInvenStoryDlg *dlg = new CInvenStoryDlg (/*... construction args ... */);
    dlg->Create(IDD_DIALOG_NEWITEM, this);
    dlg->ShowWindow(SW_SHOW);
    }

    As you all can tell, I have one heck of a memory leak going here. I know I should use DetroyWindow() for modeless dialogs, as oppossed to EndDialog() for Modal ones, but where in the world do I actually PUT that code? I assume in the code for the parent dialog, but I want to be sure. This is a snippet of code [from one of my child dialog's .cpp file]. The code is supposed to be activated when a certain button is clicked. It should read some text from an EditBox into a CSTring, and then fwrite it to a .TXT file in binary mode. [There is a reason that it is in binary mode instead of ASCII, but that is not relevant here.] Anyway, here is the function :

    void CDialogNewItem::OnButtonWriteNew()
    {
    #include FILE *stream;
    int b; // will hold the length of the CString m_newitemname
    GetDlgItemText(IDC_EDIT_ITEMNAME, m_newitemname);
    b = m_newitemname.GetLength();
    MessageBox(m_newitemname);
    // Attempt to open file for write in binary mode:
    // File will be NULLified (erased) if it exists,
    // or created if it does not yet exist ...

    if( (stream = fopen("filename.txt","wb")) != NULL )
    {
    // If open was successful, then execute this code
    fwrite(m_newitemname,1,b,stream);
    fclose(stream);
    }

    else
    // if error occurred, then execute this code instead ...
    MessageBox("File could not be opened\n");
    }

    Yes, yes, I know header includes go up top; this was just for experimental purposes. All will be relocated properly upon final completion ... ;) As I stated before, the [guts] of this func

    C / C++ / MFC c++ csharp performance help question

  • ASM section ... [modified]
    D digitalmythology

    This iste is great, but it is missing a few things. I have been a member for over 3 years, and it still has no ASM-16, ASM-32, Java, or J# sections. I'd have a lot to contribute to the ASM sections if they existed, as would many other programmers. I believe also that it would speed up the area of OS Developement, which is another section that should be implimented. Oh, and how about aprogramming / webdesign / game design contest once in a while? Thank you for your time ... [p.s.] - I modifified this today to save what is left of my dignity. Aparently my spelling is somewhat under par in the wee hours of the morning ... However I am glad that so many of responded to my thoughts on starting an Assembly "sectioon" .. LoL ... -- modified at 17:05 Wednesday 25th October, 2006 -- modified at 17:08 Wednesday 25th October, 2006

    -digitalmythology -dm webmaster@digitalmythologywebdesigns.com http://www.digitalmythologywebdesigns.com

    Site Bugs / Suggestions question java com design game-dev

  • Printing CPU register values in ASM/C/C++
    D digitalmythology

    First of all, you fellows really need an ASM forum in this place, so I won't have to ask all of my ASM questions in here. I do tie in most of my ASM code into C++ anyway, but its just disorganized to post it this way. I've been a member for over 3 years now and no ASM board? What's up with that? Other than that, it is a wonderfully great site ... Anyway, on to my question. I need to : 1] print out the value in the AX register 2] I prefer to do it using int 10h, service 13h [write string with attributes] 3] I need to be able to use the basic 16 colors 4] I need to be able to print it onto the screen at any row and column that I wish 5] I can only use BIOS interrupts, so that means 10h for video, not 21h, since DOS will not be loaded yet. In summary, I need to display conventional memory size, and that means using int 12h. However the memory size is returned in AX, and I have no idea how to print that. I have googled things to death, and all I can come up with is 100s of sites telling me that it is returned in AX [duh ...] but how in the #$@% do I get to see AX ??!? If I do not get that, then I get a bunch of hoo-hah about that awful NASM and such. Apologies for all the griping, please help ... Any ASM and / or C/C++ programmers feel free to contact me via Y! messenger @ digitalmythology or via e-mail @ digitalmythology@yahoo.com ... Thanks in advance to all ...

    -digitalmythology -dm webmaster@digitalmythologywebdesigns.com http://www.digitalmythologywebdesigns.com

    C / C++ / MFC question c++ com performance help

  • ASM / C++ -- printing with int 10h, function 0Ah ...
    D digitalmythology

    Thanks for trying; now it tells me that the operand types do not match, in the following line :

    mov bp, string

    I made the mistake of donating my old assembly books, or this would be done already. If you have any info on int 10h, AH=0Ah that you can dig up for me, I'd appreciate it very much. TASM / old MASM info is hard to come by these days. Searches for TASM, MASM, and bootcode bring up either info on Tacticle Air and Missles, MASM32, Hutch, and bits about Izcelion. Also another question? I do hope you know something of Operating System boot sequence. At what point will I be able to use C/C++ code to make controls, such as radio buttons, check boxes, progress bars, and Edit Boxes, etc.? When will I be able to use TRUE 3D controls, instead of those that resemble the 16-bit ones of the old Win 3.1? I am guessing that as soon as I enter Protected Mode, after loading the kernel and activating gate A20, I should be ok. What do you think? I'll explain my ideas later, if you would like to know about them ... Please contact me if you do, and thanks again ... My e-mail is webmaster@digitalmythologywebdesigns.com

    -digitalmythology -dm webmaster@digitalmythologywebdesigns.com http://www.digitalmythologywebdesigns.com

    C / C++ / MFC c++ delphi css database help

  • ASM / C++ -- printing with int 10h, function 0Ah ...
    D digitalmythology

    This is mostly a question for ASM programmers, but there wasn't a catagory for that. Since I use alot of inline ASM in my VC6 projects, and since part of my question relates to C++, I decided to ask it here. I do hope that no one is offended, and if so I do apologize whole-heartedly. Anyway to my question : I am using Borland Turbo Assembler v5.0 in [DOS mode] to comile a bootsector. I need to print several lines of text to the screen [in different colors], so I figured int 10h, function 0Ah is my best bet. However, all I print is garble if anything. Even if I change the message to be printed, the output doesn't change. I think the references to my registers got messed up somehow. Please help. Here are some of my 'rules' for the code, followed by my source-code. 1] The code must compile to 512 BYTES [or less]. 2] I must ORG to 00h or 7C00h, since it is a bootsector. 3] I must be able to print several lines of text, 4] The text must be able to hawe colour attributes 5] I must use only BIOS functions [such as int 10h] since DOS will not be loaded, making int 21h useless. With all that out of the way, here is a source-code : ; BootSector Test v A15.d ; (c)copyright 1996-2006 John T. Hardeman ; All Rights Reserved ... assume cs:code org 100h code segment program: jmp start ; data area here ! string db 'Hello, World !',0 start: ; set up data mov ax,cs mov ds,ax mov es,ax ; clear screen mov ah,00h ; function no. mov al,03h ; video mode int 10h ; BIOS int. ; write string at row 5, col 5 in light-green. mov ah,13h ; function no. mov al,00h ; write mode mov bh,00h ; page no. mov bl,0Ah ; attribute ===> text colour == light green mov dh,05h ; row mov dl,05h ; col mov cx,0Eh ; size of string lea bp,string ; address of string int 10h ; call the video BIOS interrupt ; goto text location mov ah,02h ; function number mov bh,00h ; current page number mov dh,09h ; row (from top) mov dl,09h ; column (from left) int 10h ; call the video BIOS interrupt ; put char @ current text location mov ah,0eh ; function no. mov al,01h ; character mov bh,00h ; page no. int 10h ; call the video BIOS interrupt ; wait for key press mov ax,00h ; function no. int 16h ; call the keyboard BIOS interrupt ; terminate ; ignore this section , as it will ; not be included in the final code mov

    C / C++ / MFC c++ delphi css database help
  • Login

  • Don't have an account? Register

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