News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

CWndShadow

Started by hfheatherfox07, October 06, 2011, 07:29:23 PM

Previous topic - Next topic

hfheatherfox07

Quote from: baltoro on October 08, 2011, 05:37:22 PM


...are known as the class constructor and the class destructor,...and, there are no equivalents in MASM assembly language. However, you should write a routine that sets your data to default values (this is what a class constructor does in C++). When an instance of the class is instantiated in C++ (created, syntactically), the class constructor is automatically invoked. In MASM assembly, you would just write this routine, and use the INVOKE syntax in your code when you wanted to first create your Shadowd Window (doing this in the Initialize routine would be appropriate). The class desstructor in C++ usually just deletes any memory allocations and system resources that were made for the CWndShadow object (if it is a simple class like this one, it does nothing and just returns TRUE).


I found this : http://objasm32.tripod.com/

after reading this : http://www.asmcommunity.net/board/index.php?topic=22760.0

quote:
The ICall macro is part of the ObjAsm32 oopasm support package.. which contains everything you need to code object-oriented masm sources.. whether you just want your asm code modules to be reusable in different projects, or whether you want to interact with existing COM / C++ interfaces, this is for you.

ICall is a macro for making "Interface Calls" - ie, calling Methods of C++ interfaces.
It was (I believe) developed from the earlier and more well-known MCALL macro.

So, you have a choice. You can use MCall and the older style of interface definition, or you can use ICall and have the further option of the extended support of OA32's army of buildtime, runtime and debug support macros.

I'm certainly willing to help you get started using OA32, if you choose that path.

You probably noticed already that ICall uses a syntax very similar to C++, this was not an accident ;)

ICall (ptr to interface object instance) :: (interface name) . (methodname)[,params]

The other calling macros in OA32 use the same syntax..
OCall is used to call Methods of OA32 class objects, and is what I use most of the time.. but if I want to (for example) call a method of a DirectX interface, I have to use ICall, like you.

Here's an example line of code from one of my masm projects:
OCall pFile::DiskStream.BinWrite, pData, dwSize

Here's another:
OCall pPlayer1::PlayerObject.TakeDamage, fAmountOfDamage

hfheatherfox07

Well what I love most about the MASM Forum is that you always find an answer to what you are looking for I hate unfinished or unanswered threads .....
here is A solution ....

LOL I know Qword is going to improve on it (with out a bitmap)


What do you think?