|
Header files are a group of "declaration"s; That's they won't compile and thers no opCode generated from them! Ofcourse there can be a misunderstanding with me, if so, give us more clarification about your problem.
Thank you masters!
|
|
|
|
|
When I run MainFrame HLASM assembler I look on the left side of the listing and and the Assembler keeps track of How big each data element is by increasing the number of the Location counter on the Left hand Side
I trying to debug a Visual C program I went into assembler mode
and see the generated Code as Follows this is just an example
Lea eax,_imp_struct
mov ecx,[eax+30]
if I were to know this displacement I could figure out what data element within the structure is being moved
as I imagine there are slack bytes
thankx again
|
|
|
|
|
I would use the sizeof operator.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
What about bytes in between maybe the compiler as I know it does
Does alignment
What I am really looking is a loction counter showing the displacement from the begining of the structure for each data element
thankx again
|
|
|
|
|
Not sure if this would work for you. But why not run it under a program like "Memory Validator[^]".... gives you a view of your memory use.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<a href="http://www.soonr.com">SoonR Inc -- PC Power delivered to your phone</a>
|
|
|
|
|
You may use the 'address of' (i.e. & ) operator to calculate the displacement.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
|
Why don't you set a breakpoint and use a watch window.
Bram van Kampen
|
|
|
|
|
for some reasn even when running with the /Zi switch debug
mode The Visual Studio debugger doesn't display the data
it forces me to into the assembler code
|
|
|
|
|
Well, you should get your compiler switches sorted, I'm not an expert at al at those.
You're experiencing a problem I had 12 years ago, only technology has moved on since. I was an experienced ASM level Programmer, but liked the Widows Interface. I Resisted it for long, I even wrote my Own version of a Windows OS, sitting on top of DOS,(It is NOT simple to keep the mouse moving, and to make the program react when you click on somethiing) but in the end, the Evil day came. I had been left with no other option, but to write a simple Windows App. My employer was of the patient kind, and allowed me 13 weeks to learn windows. I used the 'Scribble' Tutorial, and It took me about five weeks to get to grips with the underlying principles.
It Strikes me that you are used to writing procedural code! Windows does not work that way at all, as a consequence, the tools you try to use to debug, are essentially useless!
Looking at ASM code is only very seldomly productive when writing windows code. The debugging technique is different.
How todo is well described in many very fat books. The synopsys is as follows:-
The General process for writing Windows Code is that you write Event Handlers. An Event Handler is a piece of code that gets excecuted when an event occurs. A User clicking on something is an Event, but there are more! The Windows System may decide that it is time to do something, and create an event of it's own.(On each of these occurrances, an Event is created, and a message to that veffect is sent down the line.)
In Windows, this is all implemented and controlled by 'WindowMessages' being sent and acted upon. What you do as a Windows Programmer, is, react to the messages that are destined to you, the essential part being, that you pass on any message you do not handle to the default handler.
So to write Windows Code, you have to know both how to Create an Event, and how to react when an event occurs.
MFC (I take it you Use MFC) is a CPP implementation of CPP classes
(the MFC Classes) which makes it ver handy to act on messages you want to intercept, knows whichones to pass on, and, in general makes life easier.
If you are serious about MFC windows, forget about assembler, and do the 'Scribble' Tutorial.
Bram van Kampen
|
|
|
|
|
Thankx for the advice However Being a Mainframe Assembler programmer
I am just up to Plain old C SDK One Day I'll get there
I am Used to thinking of the Way MVS works so...
e.g. I set break point in a DLL which was in another address space thinking my code would be running in another address space
wrong all DLL are mapped into the user address space
I guess the only code that really runs common storage is the Kernel
Data in Common is only accessable via Memory mapped files
X-pos ECB (MainFrame term) In Windows are Events that are inheritable by Child Process and I guess Copied via Dupicate Handle
once I get the Basics down I'll move
to MFC C++
Thankx Again
|
|
|
|
|
Hi,
Well I know very little about mainframes, and the OS's that make them tick. MSPC Windows Software is Multi User, and with each User Multi Task, and within each Task, Multi threaded. What that means is that when you logon as a User, you find your computer back the same as when you logged off 5 days ago,(even though other people used the terminal in the mean time), You can run MSWord and say MS Excell at the Same Time, and switch between them, and you can keep on editing the letter you are printing on the network printer.
This was no mean achievement by Microsoft. To get an understanding of how this works, and how to insert your own code into this complicated system by writing in ASM, can probably be done, but will take enough time for the OS to change beyond recognition in the time it takes you to learn this, and leave your acquired knowledge redundant.
Doing something like 'Scribble' is definitely the better way to approach your problem, and will give you a better understanding of where to use your asm skills to advantage.
Regards,
Regards,
Bram van Kampen
|
|
|
|
|
If properly used, a Header File contains declarations,etc. It is used to build the compiler's symbol table, and should not generate asm code. (rephrase: If properly Used, a Header file should not generate any code). To See the Code, of say how a structure is laid out in memory, you must declare an object of the type.
e.g.
typedef struct{ int X,char Y[16]}MY_STRUCTURE;
This informs the Compiler that MY_STRUCTURE is the Name of a type, containing an int named X and a Char Array named Y of length 16. All the Compiler does with this is store it in the Symbol table. It also knows that MY_STRUCTURE occupies 20 bytes.
Later when you write say:
MY_STRUCT ms={0};
The Compiler sets aside 20 bytes, Notes the Starting address, and makes a Note in the Symbol Table that ms refers to a 20 byte Datablock at the Starting Address, that the Datablock is laid out as a Structure of type MY_STRUCTURE. Depending on Circumstances, the Compiler may generate code to set the bytes in the block to 0.
Later on again, where you write:
ms.Y[2]='a';
The Compiler looks up ms in the Symbol table, and notes the address where it is stored. It sees that ms is of type MY_STRUCTURE. The compiler parses on, and finds Y. It notes from the symbol table that MY_STRUCTURE has a Member 'Y', which starts at offset 4. It knows from the Symbol Table that Y in this case is a char array, with Element size 1. so, Y[2]is two more bytes into the Structure. All together, it has managed to calculate the address of the Location where you want to store 'a'
As you see, very little asm code is generated for these things. The Less, the better, because that means faster code. Alse, Data objects have very low visibility at asm level. There are no Boundaries, Explanations, Member names etc visible when you look at the memory where data is stored.
When all this looking up fails, you get Compiler errors, such as Undeclared Identifier, Struct XXX has No Member named YYY, etc.
Hope this is helpfull
Bram van Kampen
|
|
|
|
|
In the OnBeginPrinting function of my view class I am displaying a CFontDialog dialog box. I want the default font to be Arial and the default size to be 10. When the dialog box displays, it a shows default size of 62.
Here is the code. These are the first lines in the OnBeginPrinting function.
ASSERT(pDC->GetMapMode() == MM_TEXT);
LOGFONT lf;
::ZeroMemory(&lf, sizeof(LOGFONT));
lf.lfHeight = -MulDiv(10, pDC->GetDeviceCaps(LOGPIXELSY), 72);
lstrcpy(lf.lfFaceName, _T("Arial"));
CFontDialog dlg&lf, CF_PRINTERFONTS, pDC);
if (dlg.DoModal() == IDOK)
{
m_strFont = dlg.GetFaceName();
m_nPointSize = dlg.GetSize() / 10;
}
Why is the dialog displaying the wrong size value?
|
|
|
|
|
Lonnie Johnson wrote: Why is the dialog displaying the wrong size value?
I don't know, but have you tried using values other than 10 to see if a pattern exists?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Here are the results from some other point sizes.
input point size size that appears in the dialog box.
8 50
12 62
14 88
16 100
18 113
20 125
|
|
|
|
|
What is the value returned from GetDeviceCaps()? printers have way more pixels per inch than screens do. What is the value of lfHeight?
|
|
|
|
|
The value returned by pDC->GetDeviceCaps(LOGPIXELSY) is 600.
The computed value for lf.lfHeight when 8 points is used is -67.
The resulting size value in the Select Font dialog is 50.
|
|
|
|
|
|
How to open virtualdub source code with visual c++ 6?
(The source code hasn't dsp or dsw file)
|
|
|
|
|
If there's no project file for your compiler and no .mak file it can convert to a project then you'll just have to make one yourself. Examining the project files it does have, most are xml-ish these days, should give you the basic layout of the code. Make an empty project and start adding source files. It's not an easy job and getting the final few compiler setting right can be maddeningly difficult but it can be done. I did this for a friend with the xvid source a few years ago. It may take a few hours of fiddling around but unless it's an absolute monster project, like glibc or something, you'll get it.
"The secret of happiness is freedom, and the secret of freedom, courage."
Thucydides (B.C. 460-400)
|
|
|
|
|
Hello,
i need to split my dialog in two parts, horizontal but with resize option!
I mean like in windows explorer left part are the folders and right is the list control,
and i can resize this area with folders!
I need the same only in horizontal form, is something like this possible for dialog application??
thanks for any information/help!!
termal
|
|
|
|
|
You can do whatever you want with your dialog. Anyway possibly using two windows for the purpose will be simpler.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi,
Why u are trying a CSplitterWnd in CSingleDocTemplate. I think Splitter Window is best in this case.
thanks
Nitheesh.
Nitheesh George
http://www.thesimpletools.blogspot.com
|
|
|
|
|
Hi,
I am looking for some example code that could get me going with a client/server real time video application.
My application needs:
1. input usb video on the client (right now single usb webcam...eventually 2 cameras)
2. stream video to server where it is displayed in real time (occasional lost frames isn't a problem)
3. send about 25-30 bytes of additional data from client at least 10 times a second (occasional lost data isn't a problem) to also be displayed and/or processed by server
4. send a small amount of data from the server to the client as required, with reasonable certainty of it being received
Does anyone have any C++ example code (preferably full project files) that would get me started? I am using Developer Studio 6.0.
Regards,
Neil
|
|
|
|
|