|
I have a C# IE add-on and need to obtain the 'value' (shown in bold, ie., 1, 96, 192) from a html dropdown list in the web page being displayed by the browser. The abbreviated html page code is as follows:
1/16"=1'0"
1/8" = 1'-0"
Full Size/N.T.S.
In my browser add-on I have the following C# code:
public string ScaleFactor
{
get
{
HTMLInputElement elmListScale = (HTMLInputElement)_Document.all.item("listScale", null);
if (elmListScale != null)
{
return elmListScale.value.ToString();
}
else
{
return null;
}
}
}
then I have...
string scaleFactor = this.ScaleFactor;
When I run the VS2005 debugger on the above code, the debugger prompt disappears when it hits the line HTMLInputEelment elmListScale = ....
Any ideas on how to read the value from a dropdown list???
Warren
|
|
|
|
|
Hello everyone,
according to the way Explorer.exe works(it calls in-process COM server that enumerate folders and files and pass it back to Explorer), is it possible to modify the list of folders and files returned so that i can decide what folders can be visible and what folders can be hidden ?
please help me....
attilah57@yahoo.com
|
|
|
|
|
I am new, the c++ com dll component is being used "in process of the c++ exe", we work in VS2005/VC8.
I come across code similar to below. It does seem to give the expected result/value.
I am wondering how or why it can use CString instead of BSTR? What conditon will this snippets of code work? And where and when will it fail? Thank you.
inside declareinterface.h
...
static const GUID IID_IArmProperties =
{ 0x1b8eb07c, 0xcb4b, 0x4118, { 0xbd, 0x61, 0x54, 0xb8, 0x77, 0x30, 0xb8, 0x55 } };
DECLARE_INTERFACE_(IArmProperties, IUnknown)
{
...
STDMETHOD(DoSomething)(THIS_ CString csComment, THIS_ double *pdRetDbl, THIS_ MISCPARAM* mmpParam) PURE;
};
inside implement.h
#include "declareinterface.h"
...
class ATL_NO_VTABLE CArmPropertiesImp:
public IArmProperties
{
public:
CArmPropertiesImp(void);
virtual ~CArmPropertiesImp(void);
BEGIN_COM_MAP(CArmPropertiesImp)
COM_INTERFACE_ENTRY(IArmProperties)
END_COM_MAP()
...
STDMETHOD(DoSomething)(CString csComment,double *pdRetDbl,MISCPARAM* mmpParam);
};
where:
typedef struct _MISCPARAM
{
double dObject;
LPCWSTR lpszObject;
long* plRes;
} MISCPARAM;
inside implement.cpp
...
STDMETHODIMP CArmPropertiesImp::DoSomething(CString csComment,double *pdRetDbl,MISCPARAM* mmpParam)
{
m_memberdouble+=mmpParam->dObject;
m_membercstring+=csComment;
if(m_membercstring.IsEmpty())
*pdRetDbl=m_memberdouble+0.5;
else
*pdRetDbl=m_memberdouble+1.5;
return S_OK;
}
inside caller.cpp
...
MISCPARAM locparam={0};
locparam.dObject=1;
CString cslocalComment="Test";
double localdouble=0;
IArmProperties *piArm=NULL;
if(m_pIMaster->QueryInterface(IID_IArmProperties,(LPVOID*)&piArm)==S_OK)
if(piAlarm)
{
piArm->DoSomething(cslocalComments,&localdouble,&locparam);
}
if(localdouble==0)
DoTheFunction();
else if(localdouble<0)
DoOtherFunction();
else
DoSomeOtherFunction();
...
|
|
|
|
|
A COM interface may take any kind of data type as argument provided that:
1. The proxy/stub contains code that properly can marshal and transfer the entire object.
2. Both the server and the client supports the data type and are binary compatible.
In your case, unless there's a lot of code written, only clients written in C++ with support for the MFC framework can use this server.
In my opinion this is either a exceptional poor choice of interface design, or someone deliberately is trying to force client developers to use the MFC framework. I would bet my money on the former.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Hello, Everybody
I am a newbie at COM even though i have been programming for quite some time.
I started writing a Namespace Extension using Visual C++ and I have a question :
-is it possible to intercept windows explorer's calls to IShellFolder's methods ?(e.g: EnumObjects).
-is it possible to intercept specific COM method call ?
I want to replace the list of folders returned to explorer by a custom one.
Please, help .
attilah57@yahoo.com
|
|
|
|
|
Did you get anywhere with this problem? I am attempting something similar myself.
I believe you need to sink the events from DShellFolderViewEvents which I think requires a IFolderViewOC object but I do not know how to obtain one yet..
|
|
|
|
|
Hi,
I create ATL COM component in VS2005 in which I add function FunX(). I successfully create COM dll and able to use it in simple Windows Form application. when i call FunX() function in code of Customize Wizard application, then FunX() not called in Customized Wizard code.Is there any specific way to call COM function for Customize Wizard code.
Thanks
|
|
|
|
|
Look at the following code
<br />
Microsoft.Office.Interop.Excel.Application ExcelApp = new Microsoft.Office.Interop.Excel.Application();<br />
...<br />
ExcelApp.Quit();<br />
The Excel object is not release after 'Quit()' method(Excel is still in the background process list).I think it is because there is still a reference of the object.
I a windows application,this will be solved when I close the application. But I'm using these code in an asp.net application.Every time they execute,the background process list grows.
Is there any way to relase the object or Is there any code to read excel files without using Microsoft Excel?
|
|
|
|
|
|
Here is the code snippet I am working on:
.....
CoInitialize(NULL);
CComPtr<iadsuser> pUser;
HRESULT hr = GetUserObj( L"DOMAIN02", L"user1", &pUser );
CString ErrMsg = _com_error(hr).ErrorMessage();
if( FAILED( hr ))
{
ASSERT( FALSE );
return false;
}
// Last login
DATE LastLogin = 0.0;
hr = pUser->get_LastLogin( &LastLogin );
ASSERT( SUCCEEDED( hr ));
CString LastLoginTime = FormatDate( LastLogin );
// Last logoff
DATE LastLogoff = 0.0;
hr = pUser->get_LastLogoff( &LastLogoff ); // this fails
ErrMsg = _com_error(hr).ErrorMessage();
ASSERT( SUCCEEDED( hr ));
CString LastLogOffTime = FormatDate( LastLogoff );
pUser.Release();
pUser = NULL;
CoUninitialize();
...............
Call to get_LastLogin() succeeds and I get correct time. Call to get_LastLogoff() fails. ErrMsg contains "Unknown error 0x8000500D"
Any ideas why get_LastLogoff() fails?
This is what I am trying to do: we have application that tracks the time user was logged on to Novell network. We are now retiring Novell Server and I need to get login/logoff time from Windows Domain controller. If there is another API I can use please let me know.
|
|
|
|
|
|
Yes, I posted yesterday on your blog. Do you have any clue where to set/enable it in AD services? The only place I can think of is Domain Security settings but I couldn't find this option anywhere.
Does call to get_LastLogoff() actually work in your source code?
|
|
|
|
|
JoeSchmoe007 wrote: Does call to get_LastLogoff() actually work in your source code?
No it doesn't.
Does the link help?
Nibu babu thomas
Microsoft MVP for VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http://nibuthomas.wordpress.com
|
|
|
|
|
The link is irrelevant. It has nothing to do with retrieving this information programmatically.
|
|
|
|
|
Hi ,
I am using vS2005 for creating COM component in which I want to execute an EXE when Client program call my function in COM. So is there any function in ATL class library which will execute EXE and check the status of EXE execution.
Thanks
|
|
|
|
|
Atul23 wrote: So is there any function in ATL class library which will execute EXE and check the status of EXE execution.
There is standard WIN32 API for such purposes (see, for instance [^]).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[Image resize DLL]
|
|
|
|
|
You can use WinExec(....) in COM. Try it out...
regards,
Sivaganesh
|
|
|
|
|
|
Hi!
I'm using a COM DLL from a third party to access some hardware. The main application is written in C# and I can create the object and use it on XP without problems using an interop assembly created with tlbimp.
When I try the same on Vista SP1, I get an AccessViolationException on the first method call into the COM object.
The really weird thing is: The COM DLL only crashes when I call my application outside of VS, i.e. when I'm not trying to debug it. When stepping through the code in VS (2005 SP1), everything works as on Windows XP! Running the same executable from the debug directory crashes...
Can anyone explain this behaviour or tell me where to look next?
Thanks in advance!
Update:
The DLL also crashes in VS when I turn off the VS host process or when I first start the application and attach the debugger. So the big question is: What exactly does this VS host process do to keep the DLL from crashing?
Regards,
mav
--
Black holes are the places where God divided by 0...
modified on Tuesday, August 19, 2008 7:05 AM
|
|
|
|
|
Just a guess - Does the COM DLL depend on any external files? If yes, ensure these file are located in the correct directory.
Sohail
modified 21-Apr-21 21:01pm.
|
|
|
|
|
Hi!
Thanks for your reply, but I think that doesn't explain the behaviour. The DLL in question doesn't have any "unusual" dependencies and it does work on XP and when run inside VS...
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
Well once we had this problem when a colleague was using a 3rd party DLL in a .NET project using Interop. Hence I said I am guessing.
To find the cause of your problem, more details would be required.
Sohail
modified 21-Apr-21 21:01pm.
|
|
|
|
|
Hi Sohail!
Just wanted to inform you (and everybody else interested) that the problem indeed was inside the 3rd-party dll.
They used ATL from VS2003 for their component and this caused a problem with Vista's DEP (an explanation can be found here[^]
Turning off DEP made the problem go away.
Jeez - how do people find out these things?
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
I have marked your reply as helpful answer. Might help someone in future.
These problems are quite tricky. It's nice to hear that you are able to identify the cause.
Cheers,
Sohail
modified 21-Apr-21 21:01pm.
|
|
|
|
|
Hi,
has anyone a hint for me how to get the Folder recursiv to the drop target ? I implemented GetUIObjectOf in my IShellFolder derived class to handle riid == IID_IDataObject. Works fine for the first level (here my selected folder).
Where do i have to start when i want the Childs of that folder also be dragged ?
Happy for every hint
Kai-Uwe
|
|
|
|