|
I'm having the same problem...
I finally gave up and separated the attributes into individual arguments.
Ther must be some way to get the structure into a VARIANT. The last thing (I didn't try) was to put it into a SAFEARRAY of object pointers...
If you find out how, please let me know.
Thanks for the help,
Bill
|
|
|
|
|
In COM, as far as i know, custom data types/objects can be passed as structures. This can be passed from server to client.
But, if u really want to use the functionality of class, pass the interfaces from server to client and using that call the class functions and make those funtions also return interface pointers, using which again u can access the class.
But, all these are theoriticall speaking and if needed may be i can create a sample for it. But i dont know ur requirements.
Ganesh.M.Ramaswamy
|
|
|
|
|
The definition of the datatype has to be added to the interface and the pointer should be of that datatype. Then you can pass custom datatypes.
In MSDN index, type in "struct", it will bring up one for IDL/MIDL. You should be able to take it up from there.
- Thomas
modified 29-Aug-18 21:01pm.
|
|
|
|
|
I've written an ATL object making use of MFC. It works fine when tested in VB using the New operator and refrencing the .lib file from the project refrences. It does not work when using CreateObject, in that CreateObject cannot create an instance, more or less saying it does not exist - VB error 424. I want to use it in both perl and ASP scripts.
Anyone know why this is? I must have missed something.
Thanks,
Giles
|
|
|
|
|
Hello,
I have written an exchange extension for outlook. one of its functions is to create tasks. it works fine in ol2000 and it creates the tasks fine in ol97 except that each Subject of a task is set either to
C:\WINDOWS\SYSTEM32\stdole32.tlb
or
another equal ambigous string comprising of a GUID and whole lot of hashes (#) and numbers with C:\IMPU\DEV\B32\stdole.tlb
no matter what i put in the param this are the only two strings it displays. I set the Subject by using just a standard QueryInterface,Invoke syntax. I also set other string fields in the task and they get put in fine (ol2000 and ol97)
has anyone else experienced similar problems?
Rob Grundel
Software Engineer
Pitt & Sherry IT
rgrundel@pittsh.com.au
ph: (03) 63231931
mob ph: 0417762243
|
|
|
|
|
I have a question about drap-drop. It is a question about register a drag-drop target in a server application. Here is my question:
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.
What is the function of the statement "m_dropTarget.Register(this)" here(besides registering a drag-drop target)?
Why nothing different happens when I removing the statement?
|
|
|
|
|
I have a client and a remote server component. I want to access the remote server object without having to set the access rights using dcomcnfg.exe.
How can I do this programmatically? I know it can be done using CoInitalizeSecurity on the server side and CoCreateInstanceEx on the client side. But I don't know what parameters I must enter to give a specific user account (or access key ?) rights to access (and launch ?) the server component.
Anyone got some advice ?
Regards,
Brian
|
|
|
|
|
Is there a function that returns the rclsid of a com object given the progID? Basically, I want to use the CoCreateInstance function to create a com object, but getting the class id is a pain.
Thanks.
|
|
|
|
|
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?
|
|
|
|