|
Hello everyone!
First of all, thank you all for helping me with my programs and stuff...
Now, does it? Thanks!
Windows Calculator told me I will die at 28.
|
|
|
|
|
Kixdemp wrote: does it? Thanks!
Absolutly impossible for us to tell that without looking at the function.
Anyways if memory was allocated using new/malloc then you have to delete/free it explicitly.
I don't think, therefore I am not.
|
|
|
|
|
You don't have to bother about any memory consumed on the stack. But if you dynamically allocate any memory on the heap using malloc/new then you need to explicitly delete using free/delete.
Vipin Aravind
http://www.explorewindows.com
|
|
|
|
|
Kixdemp wrote: First of all, thank you all for helping me with my programs and stuff...
Now, does it? Thanks!
depends.. if you create variable in stack it will delete automatically when function exist!
e.g.
int i ;
float j;
if you create variable in heap(i.e. using localheap,new,malloc)..it doesn't get delete it self, you have to delete that yourself...
or rather you can use auto_ptr
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
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 ax,4c00h ; function number
int 21h ; call the MS-DOS interrupt
code ends
end program
-digitalmythology
digitalmythology@yahoo.com
|
|
|
|
|
Wow, that's a blast from the past! Forgot you could write code like that.
Problem might be in the line (although, I might be grasping at straws):
lea bp, string;<br />
You might try:
push cs<br />
pop es<br />
mov bp, string<br />
My memory fails me.
- S
50 cups of coffee and you know it's on!
|
|
|
|
|
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
|
|
|
|
|
I guess asm compilers have gotten smart - used to be they did what you told them to, with no backtalk, even if it wasn't right.
I had to dust off about 2 inches of muck from my "Peter Norton's Guide to the IBM PC", to even find int 10h, function ah=0ah! That's where the code came from, but obviously didn't work for you.
Sorry, I know nothing about operating system boot sequences, or at what point you can start using the built in controls.
- S
50 cups of coffee and you know it's on!
|
|
|
|
|
I am no expert, but as he wants ES:BP to be the address of the string, why not do
mov bp, seg string
mov es, bp
mov bp, offset string
This is how the sample code in my old (circa 1986) DOS book does it.
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
|
Yeah, I think LEA loads the effective address of DS:BP, not ES:BP, so your code is probably the money ball. (Still dusting off the cobwebs...)
- S
50 cups of coffee and you know it's on!
|
|
|
|
|
That's one way to do it TASM.
--
Touch eyeballs to screen for cheap laser surgery
|
|
|
|
|
Jörgen Sigvardsson wrote: TASM
The book I got the code from was targeted at the Microsoft Macro Assembler (MASM) not the Borland Turbo Assembler (TASM).
(Not that it makes any difference in this case)
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
|
Hi all:
I know for MSI installation package you can choose to install in default mode(Without UI)
MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
and also register a callback
MsiSetExternalUI (MSIProgressHandler, /*all the installation msg you interested in*/...
to get MSI installation progress message with some info.
But now I have an exe installation package, and I've tried this package with '/q' command line, It did installed in background without any UI, but how can I get installation progress info like I did in MSI in this scenario?
|
|
|
|
|
Ask a problem,About CEdit control
i write code.....
<<<<<<<<<static dll="">>>>>>>>
****************CmEdit.h**********
class AFX_NOVTABLE CmEdit : public CEdit
{
public:
__declspec(dllexport) CString CmGetDlgItem(int nID);
};
***************CmEdit.Cpp**********
CString CmEdit::CmGetDlgItem(int nID)
{
CString Str;
GetDlgItem(nID)->GetWindowTextW(Str);
return Str;
}
<<<<<<<<<<<<static exe="">>>>>>>>>>>>>
#pragma comment(lib,"Dll.lib")
#include "CmEdit.h"
void SocialSecurityData::OnBnClickedOk()
{
CmEdit d;
CString r=d.CmGetDlgItem(IDC_EDIT1);
MessageBox(r);
}
Start Debugging.....
Error...............
Why????
thank
|
|
|
|
|
What error message do you get, also why are you using GetWindowTextW directly
To all the virgins in the world thanks for Nothing.
|
|
|
|
|
You seem to be doing something simple the tough way by handcoding. Can you tell me what you are wanting to accomplish and I can tell you do that effectively using vc++ IDE.
Vipin - Microsoft MVP
http://www.explorewindows.com
|
|
|
|
|
Vipin Aravind wrote: Vipin - Microsoft MVP
Are you an MVP?
Money is the root of all evil. For more information, send $10 to me.
|
|
|
|
|
Wheres error?which line?We cant guess error in your code.
|
|
|
|
|
i wanted to draw 2 circles that intersects with each other using either microsoft C++ or Matlab.. but i guess using C++ is better. then i expect to sumhow figure out the intersect points. thats all. hoped to get the source code ASAP..
txe
|
|
|
|
|
I don't think it works like that dude.
Not many people are going to write your application for you.
look through the MSDN library at "Device Context" or "CDC". there are lots of drawing functions in the class members including Ellipse()
i have a 3d line intersection calculation in my code but i doubt i would work for circles.
|
|
|
|
|
|
txE wrote: thx anyway..
is your problem is not sorted out!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
|
Hi,
How can I execute command prompt commands using c++?
For example, I want my code to get the dir list of the current directory.
In the command prompt I would use: dir > dir.txt
How can I do that in c++? (without writing the code that enums the files).
Thanks,
David.
|
|
|
|
|
|