OBJASM sounds great. It supports COM.
I want to use MS Agent in my program.
I know MS agent is a COM object.
Could anyone give me a MS Agent example in OBJASM?
Thank you very much!
Posted on 2006-06-05 03:07:40 by guidry
Hi Guidry
I havenít written any example using the MS Agent, but reading the SDK, it seems basic COM stuff. I can help you if you have interested in developing or translating an example from the MS download page (http://www.microsoft.com/msagent/default.asp).
First of all, you need the interface definitions. I attached the file I get using Japheths ComView (http://www.japheth.de) and modified to the proper ObjAsm32 syntax.

Regards,

Biterider
Posted on 2006-06-05 15:42:42 by Biterider
Thanks for your advice. But I would appreciate it more if there could be more details.
Nan wrote and posted an example for using MS agent four years ago.
That program uses some basic OOP ideas when calling that COM.
How I wish if there is anyone could translate that in OBJASM.Since MS Agent can do text to speech with lips movement simulation when the character is talking. And a lot of animation. It's cool.
So I want to use MS Agent in my program.
The Nan's example is as the attached zip file.
That program would be better if written in OBJASM.
Could any one give me some advice to translate and modify Nan's program into OBJASM?
PS:MS Agent and its components (SAPI4, TTS engine, character files) can be downloaded at:
http://www.microsoft.com/msagent/downloads/user.asp
Attachments:
Posted on 2006-06-05 22:22:38 by guidry
Hi
Here is a fast translation of NaNs work to ObjAsm32. Now itís up to you to enhance it  :).

Regards,

Biterider
Attachments:
Posted on 2006-06-06 02:35:01 by Biterider
Sorry, I forgot to add an important file.  ;)

Biterider
Attachments:
Posted on 2006-06-06 15:23:12 by Biterider
Thank you very much. I'll give it a try as soon as possible.
It's so nice of you to translate that for us.
You are really an expert. Maybe you can provide that piece of  code as another example file in your next version of OBJASM, so that people know how to utilize OBJASM more!
:)
Posted on 2006-06-06 19:13:03 by guidry
I agree, there needs to be more OA32 samples supplied with the package (perhaps it is time to add some kind of auto-update executable tool to the package in order to perform 'smart updates'?), especially we should be pushing the COM support (then we can drag in some more newbie asmcoders from the higher langs since they won't stare at 16 bit examples of asm and make the mistake of thinking that lowlevel asm is the only asm).

Now that you are joining the ranks of the OA32 fan club, perhaps you might like to submit one or more suitable samples? :)
Posted on 2006-06-10 02:45:59 by Homer
guidry,

The msagent application I wrote back then was my very first hack at anything COM related (yes, I like bitting off more than I can chew).  So its no surprise you'd need a translation ;) .  Biterider's translation is excellent (and now in my archive ~ thank you very much).  I apologize I've never come back to clean it up any better.

I was planning on making an OOP Class Object out of MsAgent as well as MsSpeech.  I still may get around to doing them both, but there is little need in for either in my current projects.  If I do I will post it here first.

Regards,
:NaN:
Posted on 2006-08-08 22:12:40 by NaN
Hi Nan:
  Both of you are experts. Making Assembly OOP isn't easy at all. But you made it.
  You said that you are planning on making an OOP Class Object out of MsAgent as well as MsSpeech. That's a good news for us. Very eager to see your masterpiece.

Regards,
Guidry
Posted on 2006-10-11 20:30:44 by guidry
Hi guidry
The next release of ObjAsm32 has some new examples using SAPI and MS_Agent object. This release will be finished in the next few days.

Regards,

Biterider
Posted on 2006-10-12 07:36:19 by Biterider
That's a good news for us!

Besides, I find a website which provides many free MsAgent characters there. So many characters that you can  even use them to play a story for your kids!
http://www.msagentring.org/chars.aspx
Posted on 2006-10-13 22:14:16 by guidry
Thanks for the link.

BTW:  I've had no time as of yet to return to this. 

Also, I want to make it clear that Bitrider is the real torch bearer these days.  I dont know where he finds the time, but his work is excellent.  I'm very happy with the quallity his sources as well as the overall ObjAsm32 system (he still associates me to his product but I dont know why).  I may have had a hand is getting the topic of OOP in MASM32 going, however IMO, Biteriders skill in this area has exceeded my own.  Any credit desrved belongs to him.  I only pointed him in the right direction when things were getting off the ground ~ now i got to catch up....

Regards,
:NaN:
Posted on 2006-10-14 00:09:42 by NaN
    I think MS Agent is very suitable to demonstrate the power and beauty of OBJASM.
    First of all, it's  interesting and attractive. You'll see the cute character's animations after hard working, and that's  really a treat. It's  less boring than programming other programs. Second, MS Agent is a standard COM component, very suitable for OOP programming.
However I encounter a problem when I want to use the notification data sink to deal with the events happened on  MS Agent character. For example, if we want the agent character to say ?You double clicked me? while we double-click on the agent  character, we should use the IagentNotifySink interface to deal with the STDMETHOD dblclick event which is defined in AgentseverObjects.inc generated by COMVIEW and modified by Biterider.
    I can't find a way as:
Event ondbClick, messageID  to deal with that. Because I can't find any information about the the ID numbers in the associated inc files.  So Japheth's Server Event Support macros in DISPHLP.INC seems not work here, either.
     I  look at the example C++ codes in SDK provided by Microsoft, and it says: You must implement either the IAgentNotifySink or the IAgentNotifySinkEx interface, and create and register an object of that type following COM conventions:

// Create a notification sink
pSinkEx = new AgentNotifySinkEx;
pSinkEx->AddRef();
// And register it with Microsoft Agent
hRes = pAgentEx->Register((IUnknown *)pSinkEx, &lNotifySinkID);


Where class AgentNotifySinkEx is defined by ? public IagentNotifySinkEx? somewhere.

And the event sink is like this:

STDMETHODIMP AgentNotifySinkEx::DblClick(long dwCharID, short fwKeys, long x, long y) {
//  Do something when db-clicked.......
return NOERROR;
}
   
      The COM notification event sink can be implemented by using STDMETHODIMP in C++, but how can we implement  IagentNotifySinkEx in OBJASM, and it seems that we can't explicitly use Icall because the sink is called by events, can we?  I am not an experienced programmer to extract the rule on my own anyhow. :sad:
    Could anyone possibly kindly give me any specific example of MSAGENT with at least double-click event sink handling based on  Biterider's MSAGENT or anything else?  I hate to bother anyone, but I can't find support elsewhere. The assembly programming web pages seem to be fewer and fewer...
Posted on 2006-10-23 01:31:56 by guidry
Hi guidry
The Event approach is for window messages only and would not work for COM notifications.
You have to work with ?EventSinks? (a COM interface that you have to create) and register it with the MS_Agent COM object. Starting from this moment, you will receive notifications to this interface.

An example that can help you a bit is Demo16/Test_4.

Regards,

Biterider
Posted on 2006-10-23 07:18:19 by Biterider