|
I'm trying to add a button on the standard toolbar of IE. This button can access the HTML Object Model of web page in current IE window. To create a button on IE toolbar, I created a com object which implements IOleCommandTarget. To get access to the IHTMLDocument2, I created a com object which implements IObjectWithSite.
When there are multiple IE instances, I keep all the IObjectWithSite instances in a static ArrayList. So the IOleCommandTarget.Exec function can get access to the IHTMLDocument2 instances for each web page through this static ArrayList.
Each IE window has a added button. When the user clicks the added button in IE, I only want to access the HTML object model in the current IE window (The IE window whose button is clicked) rather than all the HTML object models in every opened IE windows. Now here comes the problem. In IOleCommandTarget.Exec function, I have no way to distinguish which IObjectWithSite instances is associated with the current IE window.
To better explain my problem, I pasted the link of the original code and article that my code tries to simulate. The original code doesn't encounter my problem because it actually process every IObjectWithSite instances through the static ArrayList.
http://www.codeguru.com/Csharp/.NET/net_general/article.php/c4671/#more[^]
I really appreciate it if anyone can point out a solution for my problem. By the way, I'm using C#.
|
|
|
|
|
Hi there,
I have a strange problem with a COM+ component that acts as an event sink for Exchange 2000 SP3.
It registers for receiving OnSyncSave notifications - but does it too well(!) It receives all messages twice - even though there only exists one registration in the SystemMailBox.
Does anybody - anybody(!) - have a clue for why this happens?
Best regards
/Michael
|
|
|
|
|
i don't quite understand the useness of it.
when should i implement this interface and when should not.
|
|
|
|
|
How do i register a component manually which is developed as simple c++ console based application in VC++.
|
|
|
|
|
I believe you are talking about a server imlemented as an EXE.\
Use following command line switches -
To Register:
/RegServer or -RegServer
To Unregister:
/UnregServer or -UnregServer
Have a great day ahead!
Regards,
Sohail Kadiwala
(My Blog - http://blogs.wdevs.com/sohail/[^])
modified 21-Apr-21 21:01pm.
|
|
|
|
|
HELP!!! Please excuse if seeing my distress call again...
While i was building/testing an ActiveX control to be used in my MS Access form, i ACCIDENTALLY UN-Registered an existing ActiveX control.
In Access, I chose Tools | ActiveX Controls and then by accident, I Unregistered the first entry listed for me:
<br />
:-) VideoSoft FlexArray Control
After re- Registering this (C:\WINNT\System32\vsFlex3.ocx), i now get the error message:
<br />
The OLE server isn't registered.<br />
To register the OLE server, reinstall it.
and subsequent tries gives the error:
A problem occurred while Microsoft Access was communicating with the OLE server or ActiveX Control. Close the OLE server and restart it outside of Microsoft Access. Then try the original operation again in Microsoft Access.
How do I reinstall the OLE server?
Reinstalling Office didn't help. This error is now associated with other ActiveX controls that used to work and not just the one I've created.
I'm using Office 2000, Premium, creating my ActiveX control in VB6 (was going ok prior to accident.)
Please help,
thanks much!
Johnny
|
|
|
|
|
hi!
ive got a problem developing an avi source filter!
the problem is that i need to read the file from disk while the file is playing in directshow! the other way is the example that shows directshow in its sample file source that comes with the sdk, but it is too slow, because it reads the full avi file in ram in the load function (from the ifilesourcefilter interface) before getting connected to the avi splitter and so on it wastes too much time! ive read that it is possible not to read the whole file and get connected succesfully to the avi splitter faking the contents of the memory buffer and reading from the file only the riff header, the avimainheader structure and the idx1 structure, but i dont know if its really true!if you please wonna confirm me the parts of the file and the structures to do it that are needed to make the avi splitter get connected i will apreciate it a lot, cause im getting frustrated with this and it doesnt go on!
thanks a lot!
villalvilla
|
|
|
|
|
Hi,
I have the following code in my DLL.
InnerClass* pInnerClass;
CComObject<cinnerclass>* pInnerC;
HRESULT hr = CComObject<cinnerclass>::CreateInstance(&pInnerC);
hr = pMyC->QueryInterface(IID_IInnerClass, reinterpret_cast
<<void**>>(&pInnerClass));
STDMETHODIMP CMyClass::get_InnerClass(IInnerClass **pVal)
{
if (pVal == NULL)
return E_POINTER;
*pVal = pInnerClass;
(*pVal)->AddRef();
return S_OK;
}
I have no problem with the code when I compile my code without Unicode, i.e. I have not problem running my DLL. But when I compile in Unicode mode, I always get the error:
Unhandled exception in Demo.exe(MyClass.DLL): 0xC0000005: Access Violation
After my debug, it seems that the line (*pVal)->AddRef(); is giving me the problem. But if the line is removed, I will have the same problem in all mode of compiling.
Please help me..
|
|
|
|
|
w_logan wrote:
(*pVal)->AddRef();
Please confirm that before the above selected code
pVal != NULL
Have a great day ahead!
Regards,
Sohail Kadiwala
(My Blog - http://blogs.wdevs.com/sohail/[^])
modified 21-Apr-21 21:01pm.
|
|
|
|
|
I need to copy data using com from one application to another.For example if card inserted in the card reader it takes the data from card and place it at the position of the cursor of the currently running application. My code to control card will be in c++ or java or vb but i want to use com to do data transfer like barcode reader driver does.
|
|
|
|
|
You can do it with SetWindowText API function. You should pass the handle of the edit you want to insert data.
It works fine!
You can also use SendMessage API.
If you have questions about using them, please ask.
|
|
|
|
|
Thanks but I don't know how to use both SetWindowText API and SendMessage API, I expect another help from you
|
|
|
|
|
Also I want to pass the handle of any edit which currently has focus.
|
|
|
|
|
Hi
Get the handle of the window that currently has focus, using GetForegroundWindow() API.
Then Find the Edit inside the window using FindWindowEx function. Which returns the window handle for the edit box.
After that, you set the text as follows:
SetWindowText(EditHandle, "ANYTHING YOU WHICH")
For help under any of these APIs please refere to MSDN.
|
|
|
|
|
Hi all,
I look for common class name for all editable control running on windows OS
|
|
|
|
|
Hi all
I am using WMI(Windows Management Instrumentation) to extract varios system information, here when it returns VT_NULL, and I try to assign this variant type variable to a structure then memory access violation error appears.
The code snippet is as follows:
IEnumWbemClassObject * pEnumObjectStorageDevice = NULL;
HRESULT hResStorageDevice;
BSTR strQueryStorageDevice = (L"Select * from Win32_LogicalDisk");
BSTR strQLStorageDevice = (L"WQL");
hResStorageDevice = pWbemServices->ExecQuery(strQLStorageDevice, strQueryStorageDevice,WBEM_FLAG_RETURN_IMMEDIATELY,NULL,&pEnumObjectStorageDevice);
if(hResStorageDevice != S_OK)
{
MessageBox("Could not execute Query");
return;
}
ULONG uCountStorageDevice = 20, uReturnedStorageDevice;
IWbemClassObject* pClassObjectStorageDevice;//[20]; // = NULL;
i=0;
while (pEnumObjectStorageDevice)
{
HRESULT hr = pEnumObjectStorageDevice->Next(WBEM_INFINITE, 1,&pClassObjectStorageDevice, &uReturnedStorageDevice);
int a = GetLastError( );
if(uReturnedStorageDevice == 0)
{
break;
}
VARIANT vStorageDeviceDriveLetter,vStorageDeviceDriveType,vFileSystem;
VARIANT vDriveSize,vFreeSpace;
BSTR strClassPropStorageDevice = SysAllocString(L"Caption");
hr = pClassObjectStorageDevice->Get(strClassPropStorageDevice, 0, &vStorageDeviceDriveLetter, 0, 0);
strClassPropStorageDevice = SysAllocString(L"Description");
hr = pClassObjectStorageDevice->Get(strClassPropStorageDevice, 0, &vStorageDeviceDriveType, 0, 0);
strClassPropStorageDevice = SysAllocString(L"FileSystem");
HRESULT hrFileSystem = pClassObjectStorageDevice->Get(strClassPropStorageDevice, 0, (&vFileSystem), 0, 0);
strClassPropStorageDevice = SysAllocString(L"Size");
hr = pClassObjectStorageDevice->Get(strClassPropStorageDevice, 0, (&vDriveSize), 0, 0);
strClassPropStorageDevice = SysAllocString(L"FreeSpace");
hr = pClassObjectStorageDevice->Get(strClassPropStorageDevice, 0, (&vFreeSpace), 0, 0);
StructStorageDeviceInfo[i].strDriveLetter = vStorageDeviceDriveLetter;
StructStorageDeviceInfo[i].strDriveType = vStorageDeviceDriveType;
StructStorageDeviceInfo[i].strDriveFileSystem = vFileSystem;
StructStorageDeviceInfo[i].strDriveSize = vDriveSize;
i++;
VariantClear(&vStorageDeviceDriveLetter);
VariantClear(&vStorageDeviceDriveType);
VariantClear(&vFileSystem);
VariantClear(&vDriveSize);
VariantClear(&vFreeSpace);
}
Here when this program enumerate A: and there is no disk in FDD, then in case of "File System, Drive Size & Free Space" it returns VT_NULL and in line
StructStorageDeviceInfo[i].strDriveFileSystem = vFileSystem;
Memory access violation error appears .
Please suggest me to overcomr this problem.
Thanks & Regards.
Edit/Delete Message
|
|
|
|
|
Rajiv,
In your structure member what is the type of strDriveFileSystem. And also it is not a good practise to assign a VARIANT structure data to the structure member..
1. First Clear the variant variable
2. if strDriveFileSystem is just a pointer to a char array, there should not be any access violation. I think strDriveFileSystem should a class variable which is trying to convert the variant value to a string thus a exception..
if the strDriveFileSystem is valid,
" Action without vision is only passing time,
Vision without action is merely day dreaming,
But vision with action can change the world "
- Words from Nelson Mandela
Thanks & Regards,
Gopalakrishnan
|
|
|
|
|
Rajiv,
In your structure member what is the type of strDriveFileSystem. And also it is not a good practise to assign a VARIANT structure data to the structure member..
1. First Clear the variant variable
2. if strDriveFileSystem is just a pointer to a char array, there should not be any access violation. I think strDriveFileSystem should a class variable which is trying to convert the variant value to a string thus a exception..
" Action without vision is only passing time,
Vision without action is merely day dreaming,
But vision with action can change the world "
- Words from Nelson Mandela
Thanks & Regards,
Gopalakrishnan
|
|
|
|
|
Hi there!
I have a component that registers an Event Sink i Exchange 2000. All was fine and dandy until I - for other reasons - had to reinstall my component.
Now when I try to register my Event Sink in the SystemMailBox through ADODB I get an "Access denied" error. I have already searched high and low on Google - but can only find other people with the same problem, but no solution.
The problem occurs when I set the field "DAV:contentclass" to "storeeventreg".
Does anybody have a solution to this problem ?
Best regards,
Michael B. Hansen
|
|
|
|
|
Hi!
i am facing problem with COM+ service to print doc when COM+ Service owner is not logged on the system.As this service uses user profile to load list of printers to select one that is specified in configuraion or any other.Problem is that if user profile is only available when user logs on to system.currently i am using a utility to restart com+ service after user logs on to get printer list.
Any solution to this issue.
Regards,
=-=-=-=-=-=-=-=-=-=
Anayet
=-=-=-=-=-=-=-=-=-=
|
|
|
|
|
Hi,
Can someone tell me what is the difference between compiling in the following mode??
Win32 Release MinSize
Win32 Release MinDependency
Win32 Unicode Release MinSize
Win32 Unicode Release MinDependency
Thanks in advance
|
|
|
|
|
They are all different;
Win32 vs Win32 Unicode
The code is built with either _UNICODE and UNICODE defined (the latter), or not (the former), which generally means using wide versions of system APIs, etc, except where explicit calls are made. Unicode apps won't run on W9x/ME systems, unless you're also using the MSLU.
MinSize and Mindependency will also alter the way it's compiled. Mindependency means it relies on almost nothing else at install/runtime, so will often cause non-dll versions of libraries to be linked in, which may result in a larger app and a bigger footprint. Minsize does the reverse, and will use DLL versions of things like the CRT, which will give you a smaller app, and for apps that use DLL components which also use DLL versions of libraries, a smaller footprint. This is somewhat simplified.
Steve S
Developer for hire!
|
|
|
|
|
Thanks for the reply. One of the few good reply I had read.
There are too many replies in this forum that never asks the questions.
|
|
|
|
|
I am trying to get an array created in a COM Server and passed back to the client by the mechanism: [out, size_is(,*pNum_ROI_nodes)] float **pROI_coords
from the .idl file.
Where the pNum_ROI_nodes is the size of the array and pROI_coords is the name of the array.
Problem: I am receiving only one value back in this array on the client side. I have verified that only one value is being allocated in the array by the marshaller in the client side. All data is being loaded into the server side of this array (where it is being created by (float*) CoTaskMemAlloc((resultNodes * 2) * sizeof(float))) The data on the client side is the very first value loaded into it by the server and nothing else except 0x0d f0 ad ba in the second location. (bad food)
Is there some setting for the COM that is confusing the marshaller? The above [out, size_is(,*pNum_ROI_nodes)] float **pROI_coords is only in the *.idl file. Should it be somewhere else as well??
The marshaller just doesn't seem to be getting the idea that there is an array, rather a single value.
Thanks in advance,
David
|
|
|
|
|
The standard TypeLib marshaller knows nothing about [size_is] keyword for parameter and cannot be used here. Instead you should build the Proxy/Stub DLL and use it to marshal this interface.
With best wishes,
Vita
|
|
|
|
|