|
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
|
|
|
|
|
HI~
"m_string" is just a variable name.
I am sure that the function is being called as I set the function return -1 in the dll file. When it is back to C#, -1 is shown as I display the return value.
So...
Is there any mistake in other places?
Thanks!
|
|
|
|
|
oops .. i had'nt read correctly the first time,
try making m_string a CString instead of LPCTSTR ?
Everything seems to be fine, but unless you changed your return type to something other than void, you can't assume that its being called properly.
Create a file dump function, something simple like:
<br />
void mydump(LPCTSTR dumptext)<br />
{<br />
CFile f;<br />
<br />
f.Open("c:\\dump.txt", CFile::modeCreate | CFile::modeNoTruncate);<br />
f.Write(dumptext);<br />
f.Write("\n");<br />
f.Close();<br />
}<br />
and your function should be:
<br />
void Out(LPCTSTR t)<br />
{<br />
CString dump;<br />
<br />
m_string = t;<br />
dump.Format("%s - %s", m_string, t);<br />
mydump(dump);<br />
}<br />
Hope this helps you find the problem.
|
|
|
|
|
HI~
I am sure the function work properly.
My situation is that
The dll is loaded will windows startup. The dll is used to so a string on the screen when the windows startup. The string is a variable of the dll. When the dll is loaded, a WM_PAINT message is sent and the OnPaint function is called. The OnPaint function draw the window and text on the screen. I would like to use C# program to make changes to the string so that the screen can show different string dynamically.
I use the code above and try to achieve this result. However, the variable within the extern function is changed but after the function is complete, the string on the screen still not been changed.
So, how to achieve the correct result?
Thanks~
|
|
|
|
|
What if you issue a WM_PAINT after assignment ?
|
|
|
|
|
Hi,
I am developing multithreading COM EXE server. In one of the methods I have called CoCreateInstance, which is made threadsafe by using CSingleLock(&(oneMutext)). The first 2 or 3 instances of CoCreateInstance always succeded. But after some time, call to CoCreateInstance raises an exception. Also heap get corrupted at this point.
Can anybody help me in resolving this issue.
Thanks & Regards,
Mandar
|
|
|
|