|
Hi Ian,
You can create a safe array of variants and then put the array in the variant and pass to the client.
Like :
SAFEARRAY *pSA =NULL;
SAFEARRAYBOUND sabound;
sabound.cElements = nCount; //Array size.
sabound.lLbound = 0;
pSA = SafeArrayCreate(VT_VARIANT, 1, sabound);
long nIterator = 0;
//in a loop put the values.
hr = SafeArrayPutElement(pSA, nIterator, (void *)&vaPutValue);
VARIANT vaResult;
VariantInit(&vaResult);
V_VT(&vaResult) = VT_ARRAY | VT_VARIANT;
V_ARRAY(&vaResult) = pSA;
return vaResult;
At client side, you can write it like:
Dim vaDocList as Variant
vaDocList = m_pClass.GetArray() 'm_pClass is the reference to co-class.
get bounds like
nUBound = UBound(vaDocList)
nLBound = LBound(vaDocList)
in a loop get values in the variables as per ur requirement.
i feel it will help you.
sandy
Last night i realized, i was seeing a dream in my dream.
|
|
|
|
|
Thanks very much for that, just what I was after
|
|
|
|
|
How to prevent binding a Type library to a ATL Attributed DLL ?
need help
ty
tal halfon
|
|
|
|
|
I want to write a Internet Explorer embeded Text editor for a government document transfer system. I want it embed in to IE, just like those online virus scan...ETC. when you first use it, a dialog box popup asking you whether or not the program is allowed to run. I bet it was probably a activeX control (ocx)?, right?(curret me, I am wrong )
but I don't know how. It must ba a lot different from writing win32 application.(i am new to ie plugin )
can anybody tell me where I can find some documents regarding this?
And is it a really a activeX control?
even a link or a book name will help!
thanks in advance!
xushenxin
keep fighting and you will win!
|
|
|
|
|
try to use atl com, create a internet browse object
for more detail ,plz check the msdn.
|
|
|
|
|
OK ,I'll check it out, thanks!: )
xushenxin
keep fighting and you will win!
|
|
|
|
|
try to use atl com, create an internet browse object
for more detail ,plz check the msdn.
|
|
|
|
|
Hello:
My first post so apologies if I've put this in the wrong place or broken some (n)etiquette.
I'm using a grid control .ocx file from inside an MFC app; all C++, built under VC++ 6.0. It has worked fine since
1999 but now is starting to cause problems on Win2000 machines (shows up in all service packs). The identical code works fine under Win98, so I'm guessing it's an upgrade issue.
All the dialogs I try to launch via the ocx fail with the following error message in Visual C++ 6.0 (cut and pasted from the Debug window):
CoCreateInstance of OLE control {A8C3B720-0B5A-101B-B22E-00AA0037B2FC}
failed.
>>> Result code: 0x80040154
>>> Is the control is properly registered?
Warning: CreateDlgControls failed during dialog init.
The control is registered properly via regsvr32 before running the app.
The above error message appears on the call to:
hWnd = ::CreateDialogIndirect(hInst, lpDialogTemplate,
pParentWnd->GetSafeHwnd(), AfxDlgProc);
in CWnd::CreateDlgIndirect(), called from CDialog::DoModal() in the usual way.
The behavior seen in release versions is that no dialog appears in response to user action (menu choice, etc).
I know next to nothing about COM/ActiveX/OLE objects, so if there's either a quick fix, or an explanation why this would happen (so I can stop the wild goose chase), I'd appreciate it.
The original supplier of this commercial ocx can't supply an update.
I hope this is enough info; it's all I can share.
Thanks,
-Chuck.
C J Charbonneau
Ottawa, Canada
|
|
|
|
|
I'm implementing a web navigator application and I'm currently working on the history items. Does anybody know how I can get the URL pointed to starting from the item pidl ?
Thanks in advance,
Yarp
http://www.senosoft.com/
|
|
|
|
|
Does anyone have any idea how long COM/VB6(classic) will be supported. Will .Net dump COM in the next generations of operating systems.
Paul Roullier
Senior Developer
|
|
|
|
|
Whilst there is still a Win32 API there will be COM support. COM is used in too many legacy systems for Microsoft to pull support. Backwards compatability has only been one of MS's greatest strengths.
Michael
'War is at best barbarism...Its glory is all moonshine. It is only those who have neither fired a shot nor heard the shrieks and groans of the wounded who cry aloud for blood, more vengeance, more desolation. War is hell.' - General William Sherman, 1879
|
|
|
|
|
Hi,
Can any one help me how to change the display name of components.
Like in ODL file, the syntax is:
[uuid(.......), version(1.0)]
library MyComponentLibrary
{
.......
In this case the display name of my component is "MyComponentLibrary" but i want to change it to
"iZ imaging Toolkit 2004 R1.0".
Please reply me soon if you have any suggestions.
rgds,
Rana
Dosti ke bhi kuch andaaj hote hai,
jagti ankho main bhi kuch khwab hote hai,
jaroori nahi ki gum may hi aansu nikle,
muskurati ankho main bhi sailaab hote hai...
|
|
|
|
|
Use the [helpstring] keyword.
[uuid(.......), version(1.0),
helpstring("iZ imaging Toolkit 2004 R1.0")
]
library MyComponentLibrary
...
With best wishes,
Vita
|
|
|
|
|
Thanks Victor,
But it does not work.
When i register my component, its display name is still "MyComponentLibrary".
pls put ur comment ..
rgds,
Rana
|
|
|
|
|
So what is your "display name"?
Dim obj As MyComponentLibrary.SomeObjectFromLib ?
Or the title in some Dialogs "[ ] MyComponentLibrary" ?
As far COM, the "library MyComponentLibrary" gives the name of library. It cannot be changed, but only by new name.
With best wishes,
Vita
|
|
|
|
|
Like in Visual basic,
Open the menu Project->References.
In References dialog box the Display names of components are different than their library names.
I just want to know how can i change that name in the References dialog box.
rgds,
rana
|
|
|
|
|
With [helpstring] of the library statement of IDL(ODL). When I make such change, I will see it in VB project.
Hm... I see that the VB saves the name in own project. It needs for the showing of missing references. Though the VB rechanges these names before saving or opening the project.
With best wishes,
Vita
|
|
|
|
|
Hi,
What Victor mentioned is correct. Modifying the helpstring in IDL/ODL, will reflect in the tlb listing dlg. If you are not getting it, might be somthiing else is wrong.
best wishes..mil10
|
|
|
|
|
Does anyone have a small C++ example on how to use the Image Mastering API (IMAPI) in Windows XP?
In what file does the type library appear in? There is an executable called imapi.exe in the System32 directory but it does not contain the type library.
Regards
Martin
|
|
|
|
|
Hi,
When I use the following code to create an instance of Internet Explorer, the top window seems to lose focus.
HWND hForegroundWindow = GetForegroundWindow();
CLSIDFromProgID(OLESTR("InternetExplorer.Application"), &clsid);
CoCreateInstance(clsid, NULL, CLSCTX_SERVER, IID_IUnknown, (LPVOID*)&pUnk);
pUnk->QueryInterface(IID_IWebBrowser2, (LPVOID*)&pWB);
pUnk->Release();
SetForegroundWindow(hForegroundWindow);
When CoCreateInstance function is called, the top window loses it focus, and invisible IE seems to receive the focus.
I get the handle to the foreground window and set it back after CoCreateInstance is called. However, i still do lose focus in that couple seconds. This is particularly annonying when i am tying something. Because when the top window loses its focus, the input will stop. Is there anyway to make it so that when CoCreateInstance is called, the foreground will still keep the focus?
Thanks
|
|
|
|
|
Hey everyone...
I have been trying to find some documentation on how to access contact (name, e-mail, phone, anniversary, etc.) info within Outlook Express. I am currently able to get at data using a typelib for Outlook 2000 and XP, but alas, it doesn't work with Outlook Express.
Does anyone know if there is a typelib avaialble, or if there is some documentation somewhere that would help me get started?
Thanks...
Brigg Thorp
Software Engineer
Timex Corporation
|
|
|
|
|
Hello Brigg,
Well, you are certainly asking in the right forum. I'm assuming you know COM programming. you would need it to use my sdk.
What you are looking to do with Outlook Express is possible through 'undocumented' means. Please checkout my messageboard here. I'm working on a future CP article on this, but as of now, it's not meant for public distrib.
Cheers,
Hush,hush...
thought I heard you call my name now.
Kula Shaker.
Amit Dey
Latest articles at CP - Writing Word addins
Office addin
|
|
|
|
|
Amit,
Actually, I'm not that familiar with COM. I've been using a TypeLib with Outlook 2000 and XP, so it's pretty much just accessing member functions and variables within the MSO class.
Could you possibly point me to the "undocumented" means of accessing this data? I would like to take a look at how this is done.
Thanks...
Brigg Thorp
Software Engineer
Timex Corporation
|
|
|
|
|
Hi,
Can any help me how can i change the display name of a component.
Like in ODL file i have syntax as
...
[ uuid(), version(1.0) ]
library MyLibrary
{
...
But i want to display this component as "iZ ImageTool 1.0".
Can any one help me to find the MIDL syntax to support names other than the libname.
thanks!
|
|
|
|
|
I have observed a handle leak in a COM object which acts as both a COM client and a server. This object is responsible for starting and stopping other COM objects.
In an attempt to find the handle leak, I've written an extremely simple COM object (exe) that implements a very simple interface. I also have client code that creates the COM object, calls a method on the interface and releases the interface pointer. These steps are repeated a number of times. After releasing the object, the client pauses long enough to ensure that the server dies and goes away.
Using Task Manager, I watch the client's handle count increment by one each pass through the loop.
I'm looking for clues - anyone know where the handle leak occurs?
By the way, I also tried a client using smart pointers and observed identical results in terms of leaking handles.
Here's the client code:
ILeak *pLeak;
CLSID clsid;
CoInitialize(NULL);
CLSIDFromProgID(L"Atlsvr.Leak", &clsid);
for (int i=0; i<10; i++) {
CoCreateInstance(clsid, NULL, CLSCTX_LOCAL_SERVER, IID_ILeak, (void**)&pLeak);
pLeak->Add();
pLeak->Release();
Sleep(5000);
}
CoUninitialize();
Wayne
|
|
|
|
|