[gme-users] Passing user data in for events.
Daniel Waddington
dwadding at atl.lmco.com
Wed Dec 7 08:38:37 CST 2005
Thanks Peter,
Any idea how I can easily pass a string through with the event. I am
currently using the projects version field - mega hack!!!
Daniel.
On Dec 6, 2005, at 5:05 PM, Peter Volgyesi wrote:
> Daniel,
>
> The current implementation of the MGA library does not pass the
> associated
> value to add-ons (it passes a null value). So, this feature can be
> used only
> with "regular" territory based event handlers at this moment
> (interpreters,
> plug-ins). Do you really use/need the add-on interface on the
> receiver side
> ?
>
> If you have the source code of GME you can check out the relevant C+
> + code
> in MgaFCO.cpp (gme/mga folder) in HRESULT FCO::objrwnotify() (line
> 813):
>
> COMTHROW(t->handler->ObjectEvent(tt, mmask, nil));
>
> Sorry for the bad news.
>
> --
> Peter Volgyesi
> Vanderbilt University, ISIS
>
>> -----Original Message-----
>> From: gme-users-bounces at list.isis.vanderbilt.edu
>> [mailto:gme-users-bounces at list.isis.vanderbilt.edu] On Behalf
>> Of Daniel Waddington
>> Sent: Monday, December 05, 2005 8:06 AM
>> To: A list for GME users to share thoughts and discuss bugs and
>> fixes.
>> Subject: Re: [gme-users] Passing user data in for events.
>>
>> Hi Zoli,
>>
>> I check the variant at the client side before SendEvent by
>> checking CurrentAssociation; it seems to set up fine. On the
>> receiver (GME) side, the object raising the event in
>> objectEventPerformed is
>> definitely the "Root Folder" object, but VARIANT v is always empty.
>> I checked the associated value with f->getFolderI()-
>>> get_CurrentAssociation(&var), but this is also empty.
>>
>> Any ideas how I can proceed? I wonder if it is some .NET COM
>> wrapper thing that is screwing something up??
>>
>> Thanks,
>> Daniel.
>>
>> On Dec 2, 2005, at 6:56 PM, Zoltan Molnar wrote:
>>
>>> I tried in a Raw COM interpreter (not /CLR compiled
>> project), and it
>>> goes on the "Equal branch".
>>>
>>> Br,Zoli
>>>
>>> STDMETHODIMP RawComponent::InvokeEx( IMgaProject *project, IMgaFCO
>>> *currentobj,
>>>
>>> IMgaFCOs *selectedobjs, long param) {
>>> COMTRY {
>>> if(interactive) {
>>> CComBSTR projname;
>>> CComBSTR focusname = "<nothing>";
>>> CComPtr<IMgaTerritory> terr;
>>> COMTHROW(project->CreateTerritory(NULL, &terr));
>>> COMTHROW(project->BeginTransaction(terr));
>>> try {
>>> COMTHROW(project->get_Name(&projname));
>>>
>>> CComPtr<IMgaFolder> fld;
>>> COMTHROW( project->get_RootFolder( &fld));
>>> if( fld)
>>> {
>>> CComBSTR var( L"EXTRADATA");
>>> CComVariant var2( var);
>>> //fld->Associate( var2);
>>> terr->Associate( fld, var2);
>>>
>>> CComVariant extr_var2;
>>> fld->get_CurrentAssociation(
>>> &extr_var2);
>>> CComBSTR extr_var;
>>> extr_var2.CopyTo( &extr_var);
>>>
>>> if( extr_var && extr_var.Length() ==
>>> var.Length() && extr_var.operator ==( var))
>>> {
>>> int i = 0;
>>> ++i;
>>> AfxMessageBox( "Equal, so it is
>>> working");
>>> }
>>> else
>>> AfxMessageBox( "Not equal. It is
>>> NOT working !!!");
>>> }
>>> COMTHROW(project->CommitTransaction());
>>> } catch(...) { project->AbortTransaction(); throw;
>>> }
>>>
>>> }
>>> } COMCATCH(;);
>>> }
>>>
>>>> -----Original Message-----
>>>> From: gme-users-bounces at list.isis.vanderbilt.edu
>>>> [mailto:gme-users-bounces at list.isis.vanderbilt.edu] On Behalf Of
>>>> Daniel Waddington
>>>> Sent: Friday, December 02, 2005 2:39 PM
>>>> To: gme-users
>>>> Subject: Re: [gme-users] Passing user data in for events.
>>>>
>>>>
>>>> Zoli,
>>>>
>>>> I did try this and VARIANT v is still empty - do I need to do
>>>> something else to get hold of it?
>>>>
>>>> Thanks,
>>>> Daniel.
>>>>
>>>> Zoltan Molnar wrote:
>>>>> Please try to use
>>>>>
>>>>> gme.RootFolder.Associate( filename);
>>>>>
>>>>> Instead of
>>>>>
>>>>>
>>>>>> terr.Associate((MGALib.MgaObject)gme.RootFolder,filename);
>>>>>
>>>>>
>>>>> Br, Zoli
>>>>>
>>>>>
>>>>>> -----Original Message-----
>>>>>> From: gme-users-bounces at list.isis.vanderbilt.edu
>>>>>> [mailto:gme-users-bounces at list.isis.vanderbilt.edu] On Behalf Of
>>>>>> Daniel Waddington
>>>>>> Sent: Friday, December 02, 2005 2:10 PM
>>>>>> To: gme-users
>>>>>> Subject: [gme-users] Passing user data in for events.
>>>>>>
>>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> I am using a .NET object to trigger an event on a Root Folder
>>>>>> object through the IMgaProject interface. But I can't
>> seem to get
>>>>>> the VARIANT param filled in on the AddOn side (which is handling
>>>>>> the event).
>>>>>>
>>>>>> this is what I do...
>>>>>>
>>>>>> gme.BeginTransaction
>>>>>> (terr,MGALib.transactiontype_enum,.TRANSACTION_GENERAL);
>>>>>> gme.CreateTerritory(null, out terr, null);
>>>>>>
>>>>>> string userdata = "hello";
>>>>>> terr.Associate((MGALib.MgaObject)gme.RootFolder,filename);
>>>>>>
>>>>>> gme.RootFolder.SendEvent(0x00010000);
>>>>>> gme.CommitTransaction();
>>>>>>
>>>>>> But on the other side the variant is empty. What am I do wrong?
>>>>>>
>>>>>> Thanks,
>>>>>> Daniel.
>>>>>>
>>>> _______________________________________________
>>>> gme-users mailing list
>>>> gme-users at list.isis.vanderbilt.edu
>>>> http://list.isis.vanderbilt.edu/mailman/listinfo/gme-users
>>>>
>>> _______________________________________________
>>> gme-users mailing list
>>> gme-users at list.isis.vanderbilt.edu
>>> http://list.isis.vanderbilt.edu/mailman/listinfo/gme-users
>>
>> ===============================
>> Dr. Daniel G. Waddington
>> Lockheed Martin ATL
>> 3 Executive Campus, 6th Floor
>> Cherry Hill, NJ 08002
>> Tel:856 792 9740
>> ===============================
>>
>>
>>
>>
>> _______________________________________________
>> gme-users mailing list
>> gme-users at list.isis.vanderbilt.edu
>> http://list.isis.vanderbilt.edu/mailman/listinfo/gme-users
>
> _______________________________________________
> gme-users mailing list
> gme-users at list.isis.vanderbilt.edu
> http://list.isis.vanderbilt.edu/mailman/listinfo/gme-users
===============================
Dr. Daniel G. Waddington
Lockheed Martin ATL
3 Executive Campus, 6th Floor
Cherry Hill, NJ 08002
Tel:856 792 9740
===============================
More information about the gme-users
mailing list