|
Outlook supports automation (as most applications in the Office suite), if I'm not mistaken. Google for Office and OLE automation, and I bet you'll find a bunch of articles and howtos. You'll probably find stuff from CP
--
Ich bin Joachim von Hassel, und ich bin Pilot der Bundeswehr.
Welle: Erdball - F104-G Starfighter
|
|
|
|
|
Hi all,
Currently I'm writing two plugins for Windows Media Player.
One plugin is DSP processor and the other - Visualisation.
I need my plugins can communicate with each other though COM interfaces.
So I create my own moniker class to register one of the objects in ROT.
When my DSP pluging object is constructed I create moniker in the FinalConstruct (constructor) and register my object in ROT with ROTFLAGS_REGISTRATIONKEEPSALIVE flag.
Later when my vis plugin needs to communicate with DSP plugin it also create moniker and binds it to DSP plugin - all works ok.
But I cannot understand WHY when Win MediaPlayer releases my DSP plugin the plugin is destructed ? I mean that ROT also releases the pointer to my DSP plugin.
Actually that is what I really need, but from docs I would expect different behavior - I suppose that ROT holds "strong" (I wonder where the explanation this term) reference to my DSP plugin so it will remain in memory until Revoke ?
Also when I remove ROTFLAGS_REGISTRATIONKEEPSALIVE flag in IRunningObjectTable::Register method call my moniker cannot bind to object.
Short description on the object which being registered in ROT:
HRESULT DSPPlug::FinalContruct()
{
CComPtr<IMoniker> p = CreateMoniker();
...
CComPtr<IRunningObjectTable> pIROT;
::GetRunningObjectTable(NULL,&pIROT);
...
pIROT->Register(ROTFLAGS_REGISTRATIONKEEPSALIVE,this,p,&this->ROTRegValue);
}
void DSPPlug::FinalRelease()
{
CComPtr<IRunningObjectTable> pIROT;
::GetRunningObjectTable(NULL,&pIROT);
...
pIROT->Revoke(this->ROTRegValue);
}
Can someone help with explanation of those ?
Best regards,
Valery
|
|
|
|
|
I am as clueless as you about your problem. Would RegisterActiveObject() work for you?
I don't think revoking the ROT entry to yourself i FinalRelease() is a good idea. There's a cyclic reference there. The ROT has a reference to you, and you have a reference to it. Surely, there must be a better time to release yourself...?
--
Ich bin Joachim von Hassel, und ich bin Pilot der Bundeswehr.
Welle: Erdball - F104-G Starfighter
|
|
|
|
|
Hi
How i can solve this problem:
I compile my ATL dll simple object with MFC support in
VC 7.0 under win2000.And this object registered fine.
After this i try registered same dll under win98
and get error 0x0000045a.
When i compiled my other project under same conditions but with out MFC supporting, object registered fine in both system.
Both project use multi bytes characters set.
THANK.
|
|
|
|
|
Does the win98 system that you register the DLL on have the right DLL's installed ?
Try and see with Depends.exe if you are missing any dependant files !
DarkByte
|
|
|
|
|
I check it and all fine.There is all files necessary installed in 98 systems.
|
|
|
|
|
Hello there,
I'm student and I'm doing my training course. I'm developing a software within Matlab environment.
the aim of my software is to synchronise 2 applications (video and graphs). I use an activeX to read my movies.
i've read the Riazi's article about "using activeX in matlab".
my problem:
I want just to know how we can recuperate the callback of the play button of the activeX :
AMOVIE.ActiveMovieControl.2 ???
this activeX allow to read an avifile with the command "play, pause,
and stop".
any help will be appreciate,
thanks in advance
fredf
|
|
|
|
|
What does the Interface to the control expose ?
Does it expose any Events ?
You can view this using OleView or probably also in VB/VBA properties window.
DarkByte
|
|
|
|
|
I use an external interface: a control events.I have an event's list: statechange, positionchange, timer, opencomplete, click , mousedown...
It exist a function in matalb to view events: events(h)or eventlisteners(h).
fredf
|
|
|
|
|
I suggest you do a few tries, like maybe statechange could help you .. like when someone press play, state change goes from "idle" to "playing" .. and you check that type of state change.
Otherwise, see which other events are there and see if there's any you could dig your way thru.
|
|
|
|
|
I thank you for your suggestion. I did tries with statechange: I can see arguments of the events (source, eventID, Button, Shift). the argument 3 and 4 correspond to the Oldstate and the Newstate respectively. I succeeded to recuperate field values of them with command getfield: it return "0" for stop, "1" for pause and "2" for play. I tried then to change the value but matlab doesn't take that into account. I think that we can change this value to pass a remote order.
I hope that you can give me some suggestions again...
fredf
|
|
|
|
|
Depends on what you're trying to do.
Can you explain what you would like to do once you have identified Play was pressed ?
|
|
|
|
|
Well, I would like to recuperate the command (or callback) of the button play to pass a remote order.
I succeeded to include the activeX media player(interface Medai Player) in my code(that contains my graphs). Imagine the window MP on the left of the screen and the graphs on the right.
I would like to synchronise 2 applications (video and graphs).
For that, I must create a push button which allow to fire the boths applications (vidéo and cursor on my graphs). Maybe, I'm in a wrong way and it exist another way??I don't know. In any case, I'm chearching but it doesn't work. I hope that i've been clearly. You can put a question to me for more informations
best regards
fredf
|
|
|
|
|
Ok, i understand better,
Think of the following:
how would you start your Graph if you didnt have any Video on the side, if there was only the graph.
There's probably a Play method for the graph, or Start, or Run .. etc .. Maybe you need to have a global somewhere that points to the graph that you can access from within the Callback to tell the graph to start. Or maybe a member in the class that will intercept the status change. So, when you intercept that transition that the Play button was hit, just issue a Graph->Play() (or whatever would bring the same result).
Hope this helped.
DarkByte
|
|
|
|
|
Yes, I've thought to this solution, but the problem has no changed: how to recuperate the command (or callback)of the button 'play'. I must know it to add the callback of my graphs. doesn't it?
For my cursors on my graph, i don't use a play Method like Start or Run.
I plot my new cursor and delete the old at each second and I use the command "Pause(1)" between each plot. I don't know if it's the better solution but it work.
At any case, I thank very much you for your help and I will keep you informed on the evolution. if you have another suggestions, you can give them to me. I am taking!!
fredf
|
|
|
|
|
Didnt statechange event allow you to see the transition to Play ?
If you can catch the transition from Stopped to Play .. or from Pause to Play .. even from Play to Pause .. etc .. then you can know when Play was pressed. You could even know when Pause was pressed and put your graph on hold.
At least, that's what seems to be coming out of what you told me so far
DarkByte
|
|
|
|
|
yes i can see the transition to play (2), to pause(1), to stop(0).It's maybe more easier for you if I give you the code: in the commant history, please tape:
m= figure;
h = actxcontrol('AMOVIE.ActiveMovieControl.2', [0 50 300 300], m, {'StateChange', 'myStatechange'});
set(h, 'filename', 'C:\...\mymovie.avi'); %indicate the pathname
in my srypt 'myStatechange':
function myStatechange(varargin)
disp(varargin)
name= fieldnames(varargin{5})
varargin{4}= 0 %I'm trying to change the value of play to test
old= getfield(varargin{5}, 'oldState')
new= getfield(varargin{5}, 'newState')
if varargin{3}==0 & varargin{4}==2 | varargin{3}==1 & varargin{4}==2
disp('play')
elseif varargin{3}==2 & varargin{4}==1
disp('pause')
elseif varargin{3}==2 & varargin{4}==0 | varargin{3}==1 & varargin{4}==0
disp('stop')
end
I hope that will help you to target my problem
best regards
fredf
|
|
|
|
|
I'm sorry, i don't know MatLab, or the language you're using there which looks a bit like JavaScipt but has different comment delimiters.
In the conditional code that shows disp('play'), you should have code that starts your Graphs. Its as simple as that. Now how you get access to the graph object is another story but as i said previously, you could have a global object that you can access from anywhere that will allow you to start your Graph sequence.
I'm ok with giving tricks, tips, advices etc .. but you're the one that should code, not me. I have my own project out of which i require some help too sometimes, so i'll let someone else join in and help you if they can.
|
|
|
|
|
Is it possible to find out which CLSID was used to create a COM object? The only piece of information available to me is the pointer to the object itself. The object is created by some other process; I need to check its CLSID to figure out what I can do with it.
Thanks,
M.C.
|
|
|
|
|
AFAIK, the only way to figure out the CLSID of an object is to use an interface which has a GetCLSID()-like method. An interface such as those based on IPersist.
> I need to check its CLSID to figure out what I can do with it.
Why? A COM object can do only what its interfaces expose. Why not just query it for interfaces you can handle...?
--
Ich bin Joachim von Hassel, und ich bin Pilot der Bundeswehr.
Welle: Erdball - F104-G Starfighter
|
|
|
|
|
Hello everyone,
I'm currently working on a COM Server that i want to be a Service and i'm pretty close to get it to work but ...
When i start the COM Server manually all seems to work fine, i can create multiple objects and they will all use my currently running process.
When i start the COM Server as a service, the scripting app does not want to use the Service for a source, instead it starts another instance of my application.
I do call CoInitializeSecurity and set permissions so that anyone can access the library.
Not sure what is preventing my Service to be accessed.
Anyone has a clue ?
DarkByte
|
|
|
|
|
Ok, i found part of my answer in MSDN .. yaya !!
The Library article located in Component Development -> Component Object Model (General) -> Technical Articles -> Creating and Registering COM Components with LocalService gave me a big help to get further in my development process but i still fail and one part of the article seems to be my answer, except i'm not too sure how to handle it. Here is the part i'm talking about:
Coding a COM component in a service is much like coding a traditional service. In the primary thread, start the service dispatcher thread. Next, expose a COM component through the service and not through the primary thread of the service application. Place the COM-specific code in the service. Finally, create proxies to expose the component's interfaces to any clients.
The bold text is what seems to be my answer, but i'm confused as to how to make it.
i figured out how to get dlldata.c, <file>_h.h, <file>_i.h, <file>_p.?.
So, do i just need to create a dll out of these files ?
What kind of registration is required for the Proxy to use my service ?
What about UUID's ? Do the proxy component need new UUID's ?
I guess being redirected to a good article that talk about proxy/server could help me be less confused.
BTW, i'm not using ATL/MFC or whatever .. i edit my IDL file manually. Well, i use MFC but not the COM part of it.
Thanx in advance for any hints
DarkByte
[edit]: Issue was solved by just defining the LocalService key as described in the documentation. My last problem was thinking i was recompiling the Debug version when i actually was recompiling the Release version
|
|
|
|
|
How can I rename an NT user using the ADSI(Active Directory Service Interfaces)? The IADs::SetInfo method can only change user's fullname not rename a user.
|
|
|
|
|
HI~
I would like to ask
How do I change the data in C++ dll by a C# program?
I have ever tried this.
I wrote a dll with VC++. There is a variable in the dll (e.g "m_string"). "m_string" is a LPCTSTR type and it's inital value set by constructor is _T("Hello World"). I also wrote a function for setting the variable. The function is declared like this:
extern "C" _declspec(dllexport) void set(LPCTSTR s)
{
m_string = s;
}
Afterward, I wrote a C# dll assembly. The C# dll import the dll written by C++. The import the dll like this:
#region DLLImports
[DllImport("Test.dll")] //test is the C++ dll filename
private static extern void Set(string s);
#endregion
Finally, I wrote a form to call the method "Set". After the method have finished executing, the value "m_string" does not change. The "m_string" is still "Hello World".
My question is, how to change a variable in dll permanently by a C# library or exe?
Thanks
|
|
|
|
|
What is m_string type ?
are you sure your function is being called?
Create a file output function and call it from your C++ function and have it dump anything or the parameter and your m_string to a file. Then, after you called the function, see if the output file exists.
DarkByte
|
|
|
|