|
C:\>net helpmsg 995
The I/O operation has been aborted because of either a thread exit
or an application request.
Most likely it simply timed out. See SetCommTimeouts for information.
DoEvents: Generating unexpected recursion since 1991
|
|
|
|
|
|
I create a ImageOle project to encapsulate Image to OLE object so as to display JPG,GIF,TGA... image in CRichEditCtrl. When dispaying animated GIFs,I coded in OnTimer:
IAdviseSink* pAdviseSink=NULL;
if(S_OK==GetAdvise(NULL,NULL,&pAdviseSink))
{
pAdviseSink->OnViewChange(DVASPECT_CONTENT,-1);
}
TCHAR buffer[100];
_stprintf(buffer,_T("OnTimer:Frame :%d,Total:%d\n"),
m_pImageObj->GetFrame(),
m_pImageObj->GetNumFrames());
OutputDebugString(buffer);
I traced the debug string(by above ::OutputDebugString),the frame of Gif switch as expectedOnTimer,and meanwhile by calling OnViewChange ,I get the control container call
HRESULT CImageAnimator::OnDraw(ATL_DRAWINFO& di),the draw operation is also okay,However,for some unknown reason, after OnDraw,My Ole Control is not visually updated in CRichEditCtrl,it is always stayed in Frame 0 although I have updated the frame index and called the container to update the view of my control.
I think the pAdviseSink->OnViewChange and OnDraw mechanism doesn't work as I expected, it seems that the OnDraw operation doesn't work.
|
|
|
|
|
Dear sir,
1.we are developing one video-email project. in that we are using "CODEC" com object for video recording & displaying.
2.Coder records the viddeo. Decoder Disply the video.
3.We used Windows Media Encoder 9 series SDK.
4.we used WME-Interfaces(we used WMEncoder & IWMensouce Interfaces,... ) for recordig video,displying video etc....
5.NOW I WANT TO CHANGE VIDEO SETTINGS LIKE: "Brightness" & "color" & "sharpness" of the video
6.to change the video settings i want one API. i dont knoew how to use the the API call for changing the video settings
7.i have UI (User Interface) with 3 SLIDER BARS(track bars) to increase or decrease the brightness,color,sharpness.
8.i have 3 buttons(APPLY,CANCEL,OK) in that UI to change the settings.
9.And i have a DEFAULT button to set the brightness,color,sharpness to default.
9. while drag the SLIDER BAR forward/backward the brightness,color will increase/decrease respectively.
10.when i click on apply the settings will apply to the video.
this is my requirement please help me to complete my project.its urgent.
Regards,
Balaji.
|
|
|
|
|
Hi,
I'm writing a C# class that will be used by a VB6 application. The class has a method that needs to return an array of custom objects.
Initially I just couldn't get this to work. I got a "type mismatch" error every time the call was made in VB.
then I found this[^] page which suggested tagging the interface with [return: MarshalAs(UnmanagedType.AsAny)]. This got it working.
My question is why does this work?
As I understand it, MarshalAs(UnmanagedType.AsAny) dynamically detects the type and marshals as the correct type, but I know what type it is, why wouldn't VB accept it as an array of MyClass. MyClass is fully com visible and VB is happy to use it fine in several other areas, it just doesn't like the MyClass[] when returned from a c# method.
I've programmed C# & VB6 separately loads before, but this is my first attempt at any interop.
Can anyone explain or point me at a good resource?
Cheers
[Sorry if this is the wrong place to ask. I know it's VB6 - C#, but I thought the problem is more related to the COM interop factor. If anyone thinks otherwise, shout and I'll move it]
Simon
|
|
|
|
|
|
Wow, Thanks for all that . I've got some serious bedtime reading there. I'll be an expert by Monday morning.
Simon
|
|
|
|
|
I am new to DirectShow and am developing an application to capture video using a video capture device. I am using DirectShow to control the device to capture avi files. I can successfully capture avi, but when i play back the avi file i find that the play back time is longer than the time i captured for. For example, if i capture video from a monitor which is playing a clock and i record for 20 seconds, the avi file is of duration 24 seconds. During playback, the clock correctly ticks 20 times but the playback takes 24 seconds. In effect, time has slowed down!!!
I have tried this both in GraphEdit and programattically with the same results.
I am using an Epiphan DVI2USB Solo device for the capture and an ffdshow vide encoder.
The graphEdit graph is:
DVI2USB Solo --->> ffdshow video encoder --->> AVI MUX --->> *.avi
On the AVI MUX I have to clear the Compatibility Index, otherwise only one image is captured the device and displayed during playback.
From a code point of view I am enumerating the capture devices and the codec and selecting the one i want. I construct an ICaptureGraphBuilder2 to construct the graph and attach it to a FilterGraph. After calling SetOuputFilename and RenderStream on the ICaptureGraphBuilder object i use IMediaControl from the FilterGraph to run and stop the graph.
Has anybody encountered this problem before? Are there any settings i need to configure? Any help/suggestions would be much appreciated. I have searched Google, MDSN and other forums without finding anyhthing that would help.
Many thanks.
AK
|
|
|
|
|
Maybe your PC can not playback at the same framerate that you recorded your avi file at?
|
|
|
|
|
Hi,
For a particular requirement, currently my testing team has isolated multiple copes of IE5.5 (in seperate folders with *all* the required DLLs within that folder). They launch multiple copies (sometimes upto 100) of the IE5.5 for their testing to allow individual sessions.
I'm trying to automate this, and for the same (with my very limited knowledge of COM) am trying to do the following. Please help me here to tell me if I am on the right track?:
1. I have a dialog based MFC app can launch each of the 100 different copies of IE 5.5 from their individual 100 folders using CreateProcess()
2. In the app I'm also doing (only once - I suppose this is primarily required for generating the TLH/TLI files):
#import "C:\IE Copies\IE551-1\SHDOCVW.DLL"
Doubt: As each of the 100 folders containing the IE5.5 have their own SHDOCVW.DLL, do I need to import them individually, or should this suffice?
3. After the IEs are running, next I need to "reach" their individual IWebBrowser2 interfaces (exposed by their SHDOCVW.DLL) so that I can invoke the navigation methods to automate visiting sites, logging in, etc.
Please note - The IEs are *not* registered with the system (obviously) - and so the usual methods may not work.
Doubt: Is there some way I can use CoCreateInstance() such that I can launch each of the IE5 copies, even though they're not registered on the system.
Sorry - if this sounds crude/crazy... I'd really appreciate if you can suggest a solution to this -- or even a more appropriate/elegant method to get this going.
Thanks a lot in advance, for your time & efforts.
Rgds,
nd
modified on Thursday, June 5, 2008 2:31 PM
|
|
|
|
|
I think I can use the concept from: How to get IHTMLDocument2 from a HWND[^]
Since the method needs a HWND , I need to write a PIDtoHWND() after I do the CreateProcess() which will get me only the PID.
Phew... I hope this works! Yet to test it.
Thanks,
nd
|
|
|
|
|
Stuck up once again!
I've used the code & concept as given at: How to get IHTMLDocument2 from a HWND[^]
With that, though I have a valid CComPtr<IHTMLDocument2> spHTMLDoc2 , (valid because the spHTMLDoc2->put_bgColor(CComVariant("blue")) works fine) the get_parentWindow() doesn't work and gets a 0x00000000 in the spHTMLWindow2 .
Is there something wrong with the way I'm doing this?
spHTMLDoc2->put_bgColor(CComVariant("blue"));
CComPtr<IHTMLWindow2> spHTMLWindow2;
hr = spHTMLDoc2->get_parentWindow(&spHTMLWindow2);
Thanks!
* Blood donation is the most superior form of donation, it can save lives. Celebrate special occasions, like your birthdays, by donating blood. *
modified on Saturday, June 14, 2008 2:16 AM
|
|
|
|
|
Finally, a good friend (Nanda) was able to help with this, and got the code below WORKING! This is how to get IWebBrowser2 from IHTMLDocument2 .
Pasting code below for anyone who may need this. I had a very tough week wrestling with this, don't want anyone else to go through the same.
CComQIPtr<IOleObject> spOleObject;
CComQIPtr<IOleClientSite> spOleClientSite;
CComQIPtr<IServiceProvider> spServiceProvider;
...
...
...
HRESULT hRes = spHTMLDoc2->QueryInterface(IID_IOleObject, reinterpret_cast<void **>(&spOleObject));
if (SUCCEEDED(hRes))
{
hRes = spOleObject->GetClientSite(&spOleClientSite);
if(SUCCEEDED(hRes))
{
hRes = spOleClientSite->QueryInterface(IID_IServiceProvider, reinterpret_cast<void **>(&spServiceProvider));
if(SUCCEEDED(hRes))
{
hRes = spServiceProvider->QueryService(SID_SWebBrowserApp,IID_IWebBrowser2, reinterpret_cast<void **>(&spWebBrowser));
}
if(SUCCEEDED(hRes))
{
BSTR oURL;
oURL = SysAllocString(L"http://www.google.com");
VARIANT var;
var.vt = VT_EMPTY;
spWebBrowser->Navigate((BSTR)oURL, &var, &var, &var, &var);
SysFreeString(oURL);
}
}
}
Thanks a ton Nanda!
* Blood donation is the superior'est form of donation, it can save lives. Celebrate special occasions, like your birthdays, by donating blood. *
|
|
|
|
|
#import just creates the TLH/TLI wrappers as you said. Since all the IEs are the same version, they will support the same COM interfaces, so just one #import will be enough.
|
|
|
|
|
Mike, thanks for the confirmation!
I'm still stuck up in a problem, posted above. Any ideas there?
* Blood donation is the superior'est form of donation, it can save lives. Celebrate special occasions, like your birthdays, by donating blood. *
|
|
|
|
|
Why do you need several processes? Can't you just instantiate one IE, and then automate it to open 100 new windows?
--
Kein Mitleid Für Die Mehrheit
|
|
|
|
|
The reason for several copies of IE is purely for the visiting site's session management.
New Windows don't allow a new session as well as multiple copies of the same IEXPLORE binary (different process). Hence the need to make multiple self-sustained copies of IE.
Thanks!
* Blood donation is the superior'est form of donation, it can save lives. Celebrate special occasions, like your birthdays, by donating blood. *
|
|
|
|
|
Oh, I see.. tricky. Perhaps it would be easier to create 100 user accounts, and run each instance for each user? Might be trickier in some other respects. (Just throwing out some random ideas here that might be of some use )
--
Kein Mitleid Für Die Mehrheit
|
|
|
|
|
Thanks! Yes, that's what is to be done. 100 browsers, running 100 user accounts simultaneously, automated.
* Blood donation is the superior'est form of donation, it can save lives. Celebrate special occasions, like your birthdays, by donating blood. *
|
|
|
|
|
Hi all,
Does anyone know how I can initialize a VMI interface for Network adapters in Borland C++ 2006.
The class Win32_NetworkAdapter is not recognized by C++ Builder.
Generally is there any other means to detect and control (enable/disable) WiFi and Ethernet network adapters?
Thanks,
Nektarios
|
|
|
|
|
Hi All,
I need a documentation proof for the following observation i have made(presuming my observations are correct )
I have written a addin for Microsoft Excel.
This addin handles the CLOSE event from the Excel.
But now , I have a Macro in an Excel sheet which is also listening for the close event.(the macro is as below)
Private Sub Workbook_BeforeClose(Cancel As Boolean)
If MsgBox("Confirm exit", vbYesNo) = vbNo Then
Cancel = True
End If
End Sub
And in the Addin , i am using the Cancel parameter as below.
OnWorkbookBeforeClose(IDispatch* pWorkbook, VARIANT_BOOL* pbCancel)
{
//So here pbCancel value is depending on what is clicked in that message box --
// As it is seen Message box has two buttons "Yes" and "No"
// If "No" button is clicked , the Cancel parameter value we get is "True"
// If "Yes" button is clicked, the addin does what is intend it to do.(i:e it closes the Excel)
}
As it is understood
This macro pops up a message box and can alter the "cancel" depending on what is clicked.
And in the Addin,
what i get now is the edited value of the "Cancel" parameter if "NO" button is clicked.
So, what i am assuming is, THE EVENT FIRST GOES TO THE MACRO AND ONLY THEN COMES TO MY ADDIN.
So, is my assumption Correct, if so , can i have some Documentation proof for the same(i:e - The control goes to the macro first and then will be sent to the Addin's (if any))
So, has any one come across the same situation.
It would be of great help if you reply me on this.
Thanks in Advance.
Harish
|
|
|
|
|
Hi ,
i have a vb com component dll , can i pass a parameter to this dll from the windows component services ?
i need that coz the dll connect to a database so i want to send the database from outside and not be
hard coded.
thanks
|
|
|
|
|
Hi all.
This is my 1st post to the Code Project so please excuse me if I step on some toes.
My question relates to polymorphism (I'm using VS 8.0 with ATL/COM). Assume the following (off the top of my head). What I want to do is to have a ITestOne interface with CTestOne implemented and a ITestTwo interface with CTestTwo implemented. I want to use ITestTwo to access ITestTwo interface implementations and to access ITestOne Interface implementations. I will have other classes derived from ITestTwo (e.g., ITestThree, ITestFour) and CTestThree derived from CTestTwo, etc.
Any suggestions???
TIA,
Kim
[
object,
uuid(F799607A-47E7-4582-B056-9FD4F5381BA5),
helpstring("ITestOne Interface"),
pointer_default(unique)
]
interface ITestOne : IUnknown{
};
[
object,
uuid(9AE009F8-99D9-4C4A-B0BC-9A34EEFCF78B),
helpstring("ITestTwo Interface"),
pointer_default(unique)
]
interface ITestTwo : IUnknown{
};
[
uuid(B7AB057E-F270-4019-966F-52E9994F82C2),
version(1.0),
helpstring("COMTest 1.0 Type Library")
]
library COMTestLib
{
importlib("stdole2.tlb");
[
uuid(F019A63E-D8ED-463B-AB5F-996A9231E448),
helpstring("TestOne Class")
]
coclass TestOne
{
[default] interface ITestOne;
};
[
uuid(31E6DA9C-DE0D-4B69-A259-1D39E136D31F),
helpstring("TestTwo Class")
]
coclass TestTwo
{
[default] interface ITestTwo;
};
};
Now I want to _really_ derive ITestTwo from ITestOne so both interfaces will be available in ITestTwo. To do this I change the following:
From: interface ITestTwo : IUnknown {};
To: interface ITestTwo : ITestOne
So far so good???... If so I then should be able to do the following (I only added the TestOneInterface() function to existing code generated by VS):
/**** CTestTwo Declarations ****/
class ATL_NO_VTABLE CTestOne : public CTestTwo
public CComObjectRootEx<ccomsinglethreadmodel>,
public CComCoClass<ctestone, clsid_testone="">,
public ISupportErrorInfo,
public ITestOne
{
public:
CTestOne()
{
}
DECLARE_REGISTRY_RESOURCEID(IDR_TESTONE)
BEGIN_COM_MAP(CTestOne)
COM_INTERFACE_ENTRY(ITestOne)
COM_INTERFACE_ENTRY(ISupportErrorInfo)
END_COM_MAP()
// ISupportsErrorInfo
STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
DECLARE_PROTECT_FINAL_CONSTRUCT()
HRESULT FinalConstruct()
{
return S_OK;
}
void FinalRelease()
{
}
public:
/**** CTestOne Implementations ****/
STDMETHOD(TestOneInterface)( void ) { }
};
OBJECT_ENTRY_AUTO(__uuidof(TestOne), CTestOne)
/**** CTestTwo Declarations ****/
class ATL_NO_VTABLE CTestTwo :
public CComObjectRootEx<CComSingleThreadModel>,
public CComCoClass<CTestTwo, &CLSID_TestTwo>,
public ITestTwo
{
public:
CTestTwo()
{
}
DECLARE_REGISTRY_RESOURCEID(IDR_TESTTWO)
BEGIN_COM_MAP(CTestTwo)
COM_INTERFACE_ENTRY(ITestTwo)
END_COM_MAP()
DECLARE_PROTECT_FINAL_CONSTRUCT()
HRESULT FinalConstruct()
{
return S_OK;
}
void FinalRelease()
{
}
public:
/**** CTestTwo Implementations ****/
STDMETHOD(TestTwoInterface)( void ) { }
};
OBJECT_ENTRY_AUTO(__uuidof(TestTwo), CTestTwo)
|
|
|
|
|
Hello
I am using multicast delegate as follows, but the effect in the server is undesirable:
Thing.OnEvent1 += new IThingEvents_OnEvent1EventHandler(OnEvent1);
Thing.OnEvent2 += new IThingEvents_OnEvent2EventHandler(OnEvent2);
Thing.OnEvent3 += new IThingEvents_OnEvent3EventHandler(OnEvent3);
The problem is that the (C++ COM) server it thinks it has all the connections for each event.
So in the below example it trys to send the event 3 times. Apart from the unecessary processing, I am worried it is making the inter-process call each time (the incorrect calls are being thrown away on the client side somewhere).
HRESULT Fire_OnOrderCancel(lots of params)
{
HRESULT hr = S_OK;
T * pThis = static_cast(this);
int cConnections = m_vec.GetSize();
for (int iConnection = 0; iConnection < cConnections; iConnection++)
{
pThis->Lock();
CComPtr punkConnection = m_vec.GetAt(iConnection);
pThis->Unlock();
IDispatch * pConnection = static_cast(punkConnection.p);
if (pConnection)
{
CComVariant avarParams[20];
//set avarParams
CComVariant varResult;
DISPPARAMS params = { avarParams, NULL, 9, 0 };
hr = pConnection->Invoke(1, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, ¶ms, &varResult, NULL, NULL);
}
}
return hr;
}
What c# thing do I need to use to get the desired behaviour, namely events to be fired once and the c# client to do the correct delegation?
Many Thanks
deds
|
|
|
|
|
Hi,
I need to get the physical name of the currently selected spreadsheet, like MySpreadsheet.xls. How do I do this?
Brendan
|
|
|
|
|