|
CLSIDFromProgID()?
I'm an alien, I'm an alien
it's a beautiful life....
Bush
|
|
|
|
|
Now, tell me where to find this CLSIDFromProgID function? If it is in VB or VC6 or .NET, then I am out of luck since I am still using VC5.
In fact, I am trying to do C programming, so ATL or WTL is also out of question.
|
|
|
|
|
CLSIDFromProgID is a stardard function that you can use with VC++ 5/6.0 in MFC and ATL/WTL projects.
checkout standard MFC header includes in an Wizard generated app.(comdef.h?)
I'm an alien, I'm an alien
it's a beautiful life....
Bush
|
|
|
|
|
I'm writing an USB camera-capture program using DirectShow. I've succeeded previewing and writing the captured stream to an AVI file. But the written file is very slow because it isn't compressed. I don't know how to add a compression filter into the capture graph. So I've added some code fragment about compression filter, but it didn't work. How can I work with a compression filter??
Here's my code fragment.
// File-Writing section - capture
// Capture Filter Graph
ICaptureGraphBuilder2 *m_pBuilder = NULL;
// Filter Graph
IGraphBuilder *m_pGraph = NULL;
// Capture Filter
IBaseFilter *m_pSrc = NULL;
// AVI MUX Filter
IBaseFilter *m_ppf = NULL;
// File Writer
IFileSinkFilter *m_pSink = NULL;
// AVI Compression Filter (doesn't work!!)
IBaseFilter *m_pComp = NULL;
// omitted......
m_pBuilder->SetOutputFileName(&MEDIASUBTYPE_Avi, L"C:\\Example.avi", &m_ppf, &m_pSink);
// Creating a compression filter
CoCreateInstance (CLSID_AVICo, NULL, CLSCTX_INPROC,
IID_IBaseFilter, (void **)&m_pComp);
m_pGraph->AddFilter (m_pComp, L"Compressor");
m_pBuilder->RenderStream (&PIN_CATEGORY_CAPTURE, &MEDIATYPE_Video, m_pSrc,
m_pComp, // compression filter.
m_ppf // Default renderer.
);
// Rendering the streams - preview
m_pBuilder->RenderStream (&PIN_CATEGORY_PREVIEW, &MEDIATYPE_Video, m_pSrc,
NULL, // No compression filter.
NULL // Default renderer.
);
|
|
|
|
|
When we embed an ActiveX Control in a Html Web, we often use the term "CLASSID" and "CODEBASE". But what is the relationship between the two terms? Under what circumstance should we use "CLASSID" and do not use "CODEBASE" at the same time? Under what circumstance should we use "CODEBASE" and do not use "CLASSID" at the same time? Under what circumstance should we use both "CODEBASE" and "CLASSID"?
When should we assign a local address to the "CODEBASE"? When should we assign a WWW address to the "CODEBASE"?
Thanks.
|
|
|
|
|
I have read some articles about the benifits of the Compound File and structured storage. In my opinions, I think one of the benifits of the Compound File is that we can load only a part of the whole document that we need and not have to load all part of the document. It saves a lot of time and simplified the programming.
In the Container Application, the functionality is very clear. For example, suppose a CxxxDocument that contain several bitmaps, we can only load the right one that we want to edit by activating the item from the representation chart. The memory only load the exact part of the document.
I have used the VC++ Debug Tools to trace the MFC source codes of it. I find out the MFC Framework use a linklist data structure to store and load the OLE Items from the document.
But in the with Server Application, the functionality is not very clear. I also trace the MFC source codes. I find out the server document also use a linklist data struture to store and load Server Items. If we use "embed" tactic, there will be only one node in the linklist. If we use "link" tactic, there can be more nodes in the linklist.
It is well known that the Compound File can contain items and use them individually like the document of container application containing OLE items in the linklist.
So my question is: Since the document of the server application is Compound-File enabled, the document also can contain items to manipulate. Are the objects of class COleServerItem the items that we can use structured stroage tactic to manipulate(like the OLE items in the container's document)? Are they built on the basis of COM? Or are they only pure ordinary data streams in the document and these kind of objects can not be manipulaite individually.
|
|
|
|
|
In the ActiveX programming, when a property of a control is using the Set/Get mode, there is a statement in the "Set" function like this "SetModifiedFlag".
My Question is:
What operations the statement will result? Should the property that already changed reloads immediately? Or should the property that already changed reloads later? When will the changed property reload? What is the relation between the statement "SetModifiedFlag" and the reloading of the changed property?
Thanks
|
|
|
|
|
In the "OnCreate" funtion of the class "CInPlaceFrame" of a Server Application, there is a statement like this "m_dropTarget.Register(this)". Here are the comments from Microsoft:
// By default, it is a good idea to register a drop-target that does
// nothing with your frame window. This prevents drops from
// "falling through" to a container that supports drag-drop.
The statement really puzzles me. When we are programming in a Container Application, this statement is to register a drag-drop target. But in a Server Application, I can not see the funtion of the statement. If I remove the statement, my server application runs like before.
So my question is:
What is the function of the statement "m_dropTarget.Register(this)"? Can you give me an example?
Thanks.
|
|
|
|
|
hello all,
I'm writing an IEplugin to display the current document structure in an treeview. Getting the DOM document structure and connecting to IE's events is relatively easy. The tricky part that I have to implement is that when a user makes a selection in the document, I must select the relevant element in the DOM treeview. How do I do this?
Now I undertand the way to do this is, on OnDocumentComplete, when I'm enumerating the elements, I have a tagElement structure that holds some info for each added elements . sIn this structure,should I store the pointer to element's IUnknown or IDispatch? Then when I get the selected elements IHTMLElement pointer, for the same element, will the IUnknown or IDispatch pointers be equal? Then I can compare the selected element's pointer to stored element's pointer and determine which element of the DOMtree is being selected..
Am I on the right track? Any help/comments will be much appreciated.
Thanks in advance.
I'm an alien, I'm an alien
it's a beautiful life....
Bush
|
|
|
|
|
when i debug one component from vb client,the vc debuger popup one box "user breakpoint called from code at 0x*******",and only can see the asm code,what is the meaning ,and how can this be?
thank you
sandos
|
|
|
|
|
Meeting With A Problem ,please Help.
We Will Make a com+ In a project And The Com+ Should be Put in serveral computers in a LAN,and for some reasons ,the com+ will be restrict to only one instance .Can I Do It?
|
|
|
|
|
Hi all,
I'm trying to open a video stream but problems arise. Have a look at the code below:
::CoInitialize(NULL);
::AVIFileInit();
PAVISTREAM pAvi;
HRESULT hr = ::AVIStreamOpenFromFile(&pAvi, "any.avi", streamtypeVIDEO, 0, OF_READ, NULL);
if (SUCCEEDED(hr))
{
AVISTREAMINFO si;
::AVIStreamInfo(pAvi, &si, sizeof(AVISTREAMINFO)); // <- Works ok
IGetFrame *pGetFrame;
pGetFrame = ::AVIStreamGetFrameOpen(pAvi, NULL); // <- Always returns NULL
if (pGetFrame != NULL)
{
pGetFrame->Release();
}
pAvi->Release();
}
::AVIFileExit();
Now, according to msdn, AVIStreamGetFrameOpen() returns NULL if it could not find a decompressor for this specific file. I can however view the file in windows media player w/o any problems. Doesn't that imply I do have a decompressor installed for this file???
I'm confused. Any help on this would be appreciated.
/Niklas
|
|
|
|
|
Hi,
Can u'll give me a sample code for putting named arguments in a DISPPARAMS structure.
Thanx,
Madhavi.
|
|
|
|
|
i tried putting a vector into structure and then putting that structure in to variant , but while retrieving the values from a variant it gives a linking error .
is there any other way to do this ?
parag
|
|
|
|
|
Look at IEnumXxx interfaces, there is an IEnumVariant from memory. It allows you to return a list and iterate through it. Look for IEnumVARIANT in MSDN.
Christian
Secrets of a happy marriage #27:
Never go to bed if you are mad at each other. It's more fun to stay up and fight.
|
|
|
|
|
Well, as I found out, OleCreateFontIndirect can not be used in the WinCE ATL Full Controls, 'cause it simply is not there Thing is, I created the control, that exists both under WinCE and Win32. One of the stock properties the control uses is "Font" one. And the only way to create the font from the FONTDESC structure is by using OleCreateFontIndirect method. Another trouble is that WinCE IFontDisp does not support all the IFont's interfaces and properties that are persisted by the its Win32 version. What's your advise?
Alex Stepovenko
|
|
|
|
|
Hi,
Anybody know how to programmatically move a windowless control to a fixed location (e.g. top-left corner) on a VB form, after it is being created on the VB form?
I can do this with windowed control, by calling IOleInPlaceSite::OnPosRectChange() in OnCreate() function for the windowed control.
Since windowless control does not handle WM_CREATE message, at which function can I request the control to reposition itself using IOleInPlaceSite::OnPosRectChange()?
Any idea/hint to share?
|
|
|
|
|
IOleInPlaceObject::SetObjectRects?
CodeGuy
http://groups.yahoo.com/group/wtl
|
|
|
|
|
Hi,
Anybody know how to programmatically move a windowless control to a fixed location (e.g. top-left corner) on a VB form, after it is being created on the VB form?
I can do this with windowed control, by calling IOleInPlaceSite::OnPosRectChange() in OnCreate() function for the windowed control.
Since windowless control does not handle WM_CREATE message, at which function can I request the control to reposition itself using IOleInPlaceSite::OnPosRectChange()?
Any idea/hint to share?
|
|
|
|
|
I’m creating a Browser Helper Object in VC++ 6.0 which is attempting to open a blank window, “about:blank”, by passing an empty string for the URL parameter in
ITHTMLWindow2::open . On a Windows 95 machine, using Internet Explorer 5.00 (or 5.01 SP2) a new window is opened; but, instead of being blank it has a title “No page to display” and window contents of “Action canceled. Internet Explorer was unable to link to the Web page you requested. The page might be temporarily unavailable.”
As expected, a simple HTML file with the equivalent javascript works correctly with IE 5.0.
When I upgrade to Internet Explorer 5.5, the problem vanishes.
Any ideas how I can get ‘open’ to work on Internet Explorer 5.0 or does some workaround exist? I’m opening a blank URL because I would like the IHTMLWindow2 reference to the named window if it exits. If it doesn’t exist, I’ll then go ahead an open the required window.
Thanks, in advance, for any help you can provide.
|
|
|
|
|
Have you tried using about:blank as the URL instead of the empty string?
|
|
|
|
|
I guess I should have made it more clear that the reason I was passing a blank string to open was to check to see if the named window already exists. If it exists, I need to get the IHTMLWindow2 reference to it.
By passing "about:blank" to the existing browser window, I'll cause the current page in the target window to be unloaded.
Interesting enough, if I do use "about:blank", I get "access denied" when querying the returned window.location.href. This code works perfectly in Internet Explorer 5.5 and I can do the same thing in javascript with no problem.
Can anyone else reproduce this problem or is it something with my system?
A search of msdn didn't turn up any previous reports of this problem.
|
|
|
|
|
Does anyone have a good reference or link to how to make a call from an ATL object into a plain old compiled dll? I have a dll, the .lib file and some documentation.
It seems to work when I launch the test container app from within VC++ but not when I run the test container app straight from windows.
What kind of issues would I be facing here? Is this some kind of threading issue?
|
|
|
|
|
I have created an ATL project, inserted a Simple Object and an ATL Dialog via the ATL Object Wizard. Everything works great except for one thing. I don't have an interface to the Dialog. So, my client app can't interface with my dialog. The only thing I can do is get the interface, run the function ShowWindow() which displays my dialog as a modal dialog. I wanted my dialog to invoke a function in the client app when the user clicked a button, but since I don't have an interface or any COM object whatsoever for my dialog I can't. I tried to do it by creating an interface to my Simple Object in my code for clicking the button on the dialog. But, that doesn't work because I don't have the same interface that the client Advise()d. So, the event never gets to the client.
I'm trying desperatly to find a way to be able to interface with my ATL dialog using COM. Any help would be greatly appreciated.
|
|
|
|
|
Yes, this can be done. The dialogs you get from the ATL Wizard are just normal dialogs, but are not COM objects. Create a simple object called CMyDialogObject or whatever. Create the dialog, called CMyDialog. Embed an instance of the dialog into the simple object as a member variable, and create wrapper functions on the simple object's interface to expose whichever CDialogImpl methods you need, maybe just a DoModal for a modal dialog, or Create and Destroy for a modeless dialog. In the body of the wrapper methods, just delegate to the contained dialog instance.
You will need to use the BEGIN_MSG_MAP macro to handle windows messages, commands, etc. in your dialog class. If your dialog class contained a pointer to your simple object, it could delegate to the Fire_XXX method in the message handlers, which would cause the ATL event to fire.
Hope that helps
|
|
|
|
|