|
|
this is code of gotoxy, i have made in c++ using assembly, but it is not working and giving an error of "invalid operand".
plz help!!!!
void _gotoxy(int row,int cols)
{ asm MOV AH,0x2
asm MOV DH,row// problem is here,if we use
asm MOV DL,cols//constant here, it works
asm MOV BH,0x0
asm INT 0x10
}
void main()
{ clrscr();
_gotoxy(15,15);
printf("x");
getch();
}
|
|
|
|
|
see below
CPUA 0x5041
Sonork 100.11743 Chicken Little
"So it can now be written in stone as a testament to humanities achievments "PJ did Pi at CP"." Colin Davies
Within you lies the power for good - Use it!
|
|
|
|
|
"when performing a disk format under program code one should write a certain pattern to the sector then read it back and verify what you read is correct before proceeding. if this isnt done bad things may happen"
"when posting to the forums one should write a question and read back what is written (by others) before proceeding. if this isnt done bad things may happen"
do i make a point?
"... and so i said to him ... if it don't dance (or code) and you can't eat it either f**k it or throw it away" sonork: 100.18128 8028finder.com
|
|
|
|
|
this is code of gotoxy, i have made in c++ using assembly, but it is not working and giving an error of "invalid operand".
plz help!!!!
void _gotoxy(int row,int cols)
{ asm MOV AH,0x2
asm MOV DH,row// problem is here,if we use
asm MOV DL,cols//constant here, it works
asm MOV BH,0x0
asm INT 0x10
}
void main()
{ clrscr();
_gotoxy(15,15);
printf("x");
getch();
}
|
|
|
|
|
ummmmmm dh is a 8 bit register so is dl and ints are 16 or 32 bits ... could it be that u are loading the wrong bit of the int value into the register and doing something really squiffy later?
also can u access the params by name? i always used to use the stackframe offset
"... and so i said to him ... if it don't dance (or code) and you can't eat it either f**k it or throw it away" sonork: 100.18128 8028finder.com
|
|
|
|
|
|
Sometimes, for no apparent reason, my project loads and cannot access the classview information. How does one restore things so that CW is accessible?
Thanks,
ns
|
|
|
|
|
Yeah, that can be a pain
I just exit dev studio, and delete the projects .clw file.
CPUA 0x5041
Sonork 100.11743 Chicken Little
"So it can now be written in stone as a testament to humanities achievments "PJ did Pi at CP"." Colin Davies
Within you lies the power for good - Use it!
|
|
|
|
|
The usual problem for me is that the file was copied from a CD-ROM and is read only, unchecking that works for me.
|
|
|
|
|
I've searched and searched and I can't find anything on it.
I'm not referring to a Volume serial number (easy) but the actual hardware serial number on the physical drive, assigned by the manuf. and not the partition's operating-system-assiged number.
Does anyone have a clue on how I can read it under 95/NT?
Many thanks!
|
|
|
|
|
I don't believe there is a way to programatically to do that besides taking the case off of the computer and examining the drive. Maybe, the manufacturer's utility (e.g. Western Digital or MaxStor) can get that info if it is indeed stored on the disk.
|
|
|
|
|
Hi Friends
The other day I tried to create a class which creates a timer and
its associated procedure.The skeleton class code is like this:
// CTIMER.H
class CTIMER
{
public:
void CALLBACK myproc(HWND,UINT,UINT,DWORD);
int Create();
CTIMER();
virtual ~CTIMER();
int Timer_ID;
};
//CTIMER.CPP
//Other code
//This code is creating problem
int CTIMER::Create()
{
//the (TIMERPROC) cast seems the source of bug
Timer_ID=SetTimer(NULL,0,500,(TIMERPROC)myproc);
return 0;
}
The above code is not compiling but gives an error C2440 along with a
message "None of the functions with this name in scope match the target type"
Whe I declared the function outside the class ,everything is OK.How can I solve this problem.Im new to C++ style programming,My experience is with C style Windows SDK coding.OS Win98/NT4,MSVC++6
|
|
|
|
|
a timer callback (or most any CALLBACK) can't be a non-static member function of a class. either make the function a static function (which can't access class data, and therefore might as well be outside the class), or just use a non-class function.
-c
To explain Donald Knuth's relevance to computing is like explaining Paul's relevance to the Catholic Church. He isn't God, he isn't the Son of God, but he was sent by God to explain God to the masses. /. #3848917
|
|
|
|
|
Hi,
I'm dealing with an html page that has 12 tables in it. I'm trying to get to a particular table row which has a class="row1" but it doesn't look like the IHTMLTableRowPtr contains any method for retrieving the class name.
Can anyone give me any input as to if this is possible?
Thanks in advance,
Craig
|
|
|
|
|
Hi !
I am trying to find a way to reuse dialogs I already desined in other projects and import them to my new project, I can't find a way to do that. I tried to mess with the *.rc file but it did not work.
Thank you
|
|
|
|
|
One way is to have the project you want the dialog to be imported into open and then open the .rc file that contains the dialog that you want to copy from. That will open in the code window, just navigate to the dialog and copy it to your open project.
Hope this helps,
Craig
|
|
|
|
|
open the .RC file from the old project in the new project. then you can just copy/paste the dialog resources into the new project.
you'll have to copy the actual .cpp and .h files by-hand
-c
To explain Donald Knuth's relevance to computing is like explaining Paul's relevance to the Catholic Church. He isn't God, he isn't the Son of God, but he was sent by God to explain God to the masses. /. #3848917
|
|
|
|
|
Hi all,
My OCX is having some issues...
When minimizing my app, or clicking on another app and coming back, some list controls aren't being refreshed and "disappear". The info. is still there, but you can't see it unless you click on it.
Do you know of a function that is called when loading AND restoring the dialog after setting focus to another application? That way, maybe I can call Dialog::RedrawWindow() everytime I come back to the app?
Thank you for your help!
Graham
|
|
|
|
|
I have an ActiveX control that I wrote a while ago. It compiled fine then, but when I accidently hit "Rebuild All" today, I got the following output:
<br />
--------------------Configuration: PilotImport - Win32 Debug--------------------<br />
Creating Type Library...<br />
Processing C:\My Projects\Completed Components\PilotImport\PilotImport.odl<br />
PilotImport.odl<br />
Processing C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\oaidl.idl<br />
oaidl.idl<br />
Processing C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\objidl.idl<br />
objidl.idl<br />
Processing C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\unknwn.idl<br />
unknwn.idl<br />
Processing C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\wtypes.idl<br />
wtypes.idl<br />
Compiling resources...<br />
Compiling...<br />
StdAfx.cpp<br />
Compiling...<br />
Pilot_Import.c<br />
PilotImport.cpp<br />
PilotImportCtl.cpp<br />
PilotImportPpg.cpp<br />
Linking...<br />
mfcs42d.lib(dllmodul.obj) : error LNK2005: _DllMain@12 already defined in MSVCRTD.lib(dllmain.obj)<br />
mfcs42d.lib(dllmodul.obj) : warning LNK4006: _DllMain@12 already defined in MSVCRTD.lib(dllmain.obj); second definition ignored<br />
Creating library Debug/PilotImport.lib and object Debug/PilotImport.exp<br />
Debug/PilotImport.ocx : fatal error LNK1169: one or more multiply defined symbols found<br />
Error executing link.exe.<br />
<br />
PilotImport.ocx - 2 error(s), 1 warning(s)<br />
<br />
Nothing in the code has changed -- does anyone know why this linker error suddenly popped up? I got around this with another project by completely remaking the project, but this requires a lot of retyping.
Thanks
Zac
"If I create everything new, why would I want to delete anything?"
|
|
|
|
|
Nevermind, I found out why it is doing this. As it turns out, this is caused by the CRT being linked before MFC (I still don't understand how it gets in a state where this occurs since nothing had changed in the code, but oh well). The solution is in a knowledge base article:
http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q148652&
"If I create everything new, why would I want to delete anything?"
|
|
|
|
|
1- Why doesn't pop() return a reference to the pop() ed object?
It is a pain to always do a top() to get the reference then pop() to remove it. Anyway, I made my own wrapper:
namespace mystd{
template<class T, class Container = std::deque<T> >
class stack : public std::stack<T, Container> {
public:
stack() : std::stack<T, Container>() {}
explicit stack(const container_type& _Cont) : std::stack<T, Container>(_Cont) {}
virtual ~stack() {}
T& pop() {
T& t = top();
std::stack<T, Container>::pop();
return t;
}
};
}
What do you think of it? Any comment?
2- When you call top() on an empty stack, what happens? The reason I ask this question is because in my wrapper class' pop() method I call top() , then pop() . Is that a problem?
Michel
It is a lovely language, but it takes a very long time to say anything in it, because we do not say anything in it, unless it is worth taking a very long time to say, and to listen to.
- TreeBeard
|
|
|
|
|
Michel Prévost wrote:
When you call top() on an empty stack, what happens?
You're entering the land of 'undefined behavior'. Which means you can expect anything. STL implementations with debug checks (STLPort) will probably assert at you.
Tomasz Sowinski -- http://www.shooltz.com
What is "scratch" and why can everything be made from it?
|
|
|
|
|
1 - A old question
Check http://www.sgi.com/tech/stl/stack.html[^] at the end of the page the [3] marks the spot
2- Simple, undefined behaviour , the pre-condition to call top() is the method empty() to be false , so you should always call empty() first, and if it returns false(), the you can safely call top()
Cheers,
Joao Vaz
And if your dream is to care for your family, to put food on the table, to provide them with an education and a good home, then maybe suffering through an endless, pointless, boring job will seem to have purpose. And you will realize how even a rock can change the world, simply by remaining obstinately stationary. - Shog9
|
|
|
|
|
Hello All,
Ive finally entered the world of VS.NET. I love the new IDE, but. I work in the UNIX environment a lot, Im a VI guy, but I like the VS.NET IDE better. I have been editing some C files that I am also loading into VI and Ive noticed that there are speecial characters in the file Specifically TABS and carriage returns marked with ^M.
This didnt happen in VC++ 6.0 is there an editor option I can turn off. I just want plain text editing..
Thank you..
Ryan Baillargeon
Software Specialist
Fuel Cell Technologies Inc.
|
|
|
|