|
hi everyone... i hope im in the right forum
my question is about whether COM can handle disconnection...
say example I created the server remotely... after sometime the machine hosting the COM server was disconnected (eg. network cable was unplugged) then immediately it was reconnected (cable was plugged in)... will COM encounter an error when i try to call a method from that COM server?
when that scenario occurs, do i need to recreate my COM server?
thanks for the help!
newbie
|
|
|
|
|
|
Maybe it is not a COM DLL.Registration of standard DLLs is not needed.
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.
|
|
|
|
|
Yup, check if this dll need to be registered or not ? Use dependency walker, to determine, whether DllregisterServer is one of exported functions.
Prasad
MS MVP - VC++
|
|
|
|
|
Hi,
I am trying to access microsoft project using Microsoft Project Object Modal 11.0 .... I have used this COMponent (MSProject) successfully using desktop application (C#.Net) .Now that i started using this COMponent in ASP.Net application it started behaving very strange ...
1: using add reference ,I added MSProject Component .
2: I Run the application ,tried creating new instance
MSProject msProj = new MSProject.ApplicationClass();
3: The exception is thrown stating ... "Server Execution Failed"
4: I noticed there was no entry for MSProject.dll in the bin folder, so i copied the dll to bin manually and re-add the reference .
5: For the first time the instance was created successfully and no error reported .
6: In my second attempt to create instance , the same exception was thrown .To my surprise , this time the installation was corrupted .I could'nt open the project file now .
7: Event viewer stated : "Server [some GUID] didnt register with DCom within the required timeout"
any solution to this problem ... ????
Madni
|
|
|
|
|
Hi-
Hope someone can help
A gridview on my page alternates between using a dataset and a dataview, and also has some auto-generated "Edit" and "Paging" controls.
These controls fail if the gridview is sourced on the dataview, so i want to make those fields either invisable or disabled whenever i go into dataview mode.
However, i cannot anywhere find a means of turning those auto-generated controls invisable/disabled: so when the gridview is sourced on a dataview, i can crash the page when i hit the edit/page controls.
Hope someone can help- other than telling me to re-query the database for the different view, which i am on the verge of doing, but i really do not want to
thanks -
aitch
--x--
(And it took me all day to trace the error and rebuild my project, but at least i laerned that - hey, i cannot edit a dataview )
|
|
|
|
|
i need an active x control which can be used for my web page. folder browser should disply file stracture in tree view
|
|
|
|
|
And people in Hell need ice water. You've got about as much of a chance of someone handing over their hard work to you for nothing.
|
|
|
|
|
Plus he cross posted it in 5 forums!
__________________
Bob is my homeboy.
|
|
|
|
|
Hi all,
Can anyone tell me how to add a filter by Class ID and relate it with IBaseFilter Interface. I mean I have the filter Class ID from the graphedit application not something like CLSID_FilterName.Can anyone help me with this?
Thank You.
With regards
Raja Bose
|
|
|
|
|
write the following code
IGraphBuilder* g_pGraphBuilder;
IBaseFilter *MyFilter;
HRESULT hr
hr=AddFilterByCLSID(g_pGraphBuilder,CLSID_VideoRenderer,NULL,&VideoRendrer);
where the function is
HRESULT AddFilterByCLSID(
IGraphBuilder *pGraph, // Pointer to the Filter Graph Manager.
const GUID& clsid, // CLSID of the filter to create.
LPCWSTR wszName, // A name for the filter.
IBaseFilter **ppF) // Receives a pointer to the filter.
{
if (!pGraph || ! ppF) return E_POINTER;
*ppF = 0;
IBaseFilter *pF = 0;
HRESULT hr = CoCreateInstance(clsid, 0, CLSCTX_INPROC_SERVER,
IID_IBaseFilter, reinterpret_cast<void**>(&pF));
if (SUCCEEDED(hr))
{
hr = pGraph->AddFilter(pF, wszName);
if (SUCCEEDED(hr))
*ppF = pF;
else
pF->Release();
}
return hr;
}
RajeshGupta
|
|
|
|
|
Hi Rajesh,
Thank you very much for replying, As you said in the following case
IGraphBuilder* g_pGraphBuilder;
IBaseFilter *MyFilter;
HRESULT hr
hr=AddFilterByCLSID(g_pGraphBuilder,CLSID_VideoRenderer,NULL,&VideoRendrer);
CLSID_VideoRenderer this one is not known to me. The classid like 2345-2445-3245-543456 (for example CLSID_VideoRenderer = 2345-2445-3245-543456)which I got from DxFilterSpy.exe is known to me. So can you tell me how do I add this Classid in my application and relate it to my base class filter
Awaiting for your reply
Thank You
With regards
Raja Bose
|
|
|
|
|
CLSID_VideoRenderer defined in uuids.h header file in directx sdk
if you want to include any CLSID that is not in uuids.h
the see DirectShow FAQ in directshow helpfile
RajeshGupta
|
|
|
|
|
Hi guys,
Thanks for taking the time to read this post.
I've got an ActiveX control embedded in a web page:
<html><OBJECT id="myFoo" width="640" height="480"
style="position:absolute; left:100;top:100;"
CLASSID="CLSID:f1387dda-43c0-4406-99a1-c1e0eaf1b5c8"
codebase="http://blahblah/FooClientAxSetup.cab"
type="application/x-oleobject">
</object></html>
That cab file contains 3 files: My setup.MSI file, setup.exe, and my .inf file which should tell Internet Explorer to launch my setup.exe file. Here's the .inf file:
[version]
signature="$CHICAGO$"
AdvancedINF=2.0
Hook=runInstaller
[runInstaller]
run=%EXTRACT_DIR%\setup.exe
I launch the page in IE7. It prompts me to install. I say yes. Nothing happens. What am I doing wrong?
|
|
|
|
|
I'm trying to do something that might actually be a bit silly. I'm accessing what is essentially a windows form from an aspx page, to do some printing from the server side for me.
I have the following code:
public class axForm : System.Windows.Forms.Form
{
public AxDHTMLEDLib.AxDHTMLEdit axd;
public axForm()
{
Thread.CurrentThread.ApartmentState=ApartmentState.STA;
axd=new AxDHTMLEDLib.AxDHTMLEdit();
((System.ComponentModel.ISupportInitialize)(axd)).BeginInit();
this.Controls.Add(axd);
axd.Enabled = true;
axd.Name = "axd";
((System.ComponentModel.ISupportInitialize)(axd)).EndInit();
}
public void printDoc(string sHtml, bool bPrompt)
{
axd.DocumentHTML=sHtml;
object filename=@"c:\fileouttest.txt";
for(;axd.Busy!=false;)
{
System.Windows.Forms.Application.DoEvents();
}
axd.SaveDocument(ref filename);
object opt=null;
if (bPrompt)
opt="1";
axd.PrintDocument(ref opt);
}
}
Basically I create an instance of that class in my aspx code behind, then call printDoc with the HTML I want to print and an indicator as to whether or not I want to see the print dialog (I don't but the code I based this on had the boolean in there and I thought it might be useful for testing).
The problem is I'm getting a HRESULT error message and I don't know what to do about it. I'm guessing, since the error is fired just after the .endInit() line that it's something to do with how I'm setting the thing up in the first place, but I don't know enough about it to be able to debug it properly. The error is:
'System.Runtime.InteropServices.COMException' occurred in system.windows.forms.dll - Additional information: Exception from HRESULT: 0x80040200.
Can anyone help me figure this out? It seems like I'm really close to getting it working. If I tone down the amount of debug information I want, it actually runs without giving any errors at all, and the line that saves the document to disk actually works regardless, so I'm a bit confused. Any help would be greatly appreciated.
|
|
|
|
|
Hi,
Can anyone let me know URL or book where I can find the depth of STA and MTA.
Thanks
Nandu
|
|
|
|
|
|
Hi,
Can any help me in understnding proxy/strub in COM. Is there any website where I can find more info about this?.
Nandu
|
|
|
|
|
Read the following book
Inside COM - Dale Rogerson
It will help you get started with COM.
S o h a i l K a d i w a l a
To Err Is Human; to Debug, Divine
modified 21-Apr-21 21:01pm.
|
|
|
|
|
Hi,
Actually I am using MPEG2DECODER filter and I am having the "ax" extension file as well as the "lib" extension file for that filter. Can anyone tell me how to include this filter programmatically in my application?
Thank You
With regards
Raja Bose
|
|
|
|
|
Hi all!
I'am creating COM Server for structure Student i am having problem in
the following code.
IRecordInfo *pUdtRecordInfo = NULL;<br />
HRESULT hr = ::GetRecordInfoFromGuids( LIBID_STUDENTLib, <br />
1, 0, <br />
0,<br />
Student_IID,<br />
&pUdtRecordInfo );<br />
if( FAILED( hr ) ) {<br />
HRESULT hr2 = Error( _T("Can not create RecordInfo interface for UDTVariable") );<br />
return( hr );<br />
}
the problem is that GetRecordInfoFromGuids return Error what could be the
source of problem for the failure of this API.
thanks in advance.
Viral Joshi.
|
|
|
|
|
done.
It was my fault in the API GetRecordInfoFromGuids parameter Student_IID
should assign the value of uuid of student structure instread of that i was
assigning it the value of uuid of StudentLib.
Viral Joshi.
|
|
|
|
|
Hi all!
I am writing COM Server.I am using User defined data type a Student structure in COM Server.
There is a method in COM Server that returns the 1 st ranked student out of the
student array passed to it from vb client.
The Interface method is like this.
STDMETHODIMP CStudentUtil::GetFirstRankStudent(SAFEARRAY **StudentArray,Student *pStudent)<br />
{<br />
if(!StudentArray)<br />
return(E_POINTER);<br />
if(!pStudent)<br />
return(E_INVALIDARG);<br />
<br />
long lBound=-1;<br />
long UBound=-1;<br />
<br />
Student *ob1=NULL,*ob2=NULL,*max=NULL;<br />
<br />
HRESULT hr;<br />
<br />
hr=::SafeArrayGetUBound(*StudentArray,1,&UBound); <br />
hr=::SafeArrayGetLBound(*StudentArray,1,&lBound); <br />
<br />
hr=::SafeArrayGetElement(*StudentArray,&lBound,(void*)ob1);<br />
max=ob1;<br />
<br />
if(FAILED(hr))<br />
return hr;<br />
<br />
for(long i=lBound+1;i<UBound;i++)
{<br />
hr=::SafeArrayGetElement(*StudentArray,&i,(void*)ob2);<br />
if(FAILED(hr))<br />
return hr;<br />
else<br />
{<br />
if(ob2->Total>ob1->Total)<br />
max=ob2;<br />
}<br />
}<br />
pStudent=max;<br />
return S_OK;<br />
}
The client side is
Dim d As STUDENTLib.Student<br />
Set ob = New STUDENTLib.StudentUtil<br />
d = ob.GetFirstRankStudent(a)<br />
Set ob = Nothing
What is wrong with the code in the client side that result in Invalid Procedure call or argument.
Pls help on this.
Thanks in advance.
Viral Joshi.
|
|
|
|
|
Hello Joshi,
I ran through your example and discovered one -possible- point of the E_INVALIDARG error occurs at the following line of code :
hr=::SafeArrayGetElement(*StudentArray,&i,(void*)ob2);
I declared the GetFirstRankStudent() method as follows :
HRESULT GetFirstRankStudent([in] SAFEARRAY(Student)* pStudentArray, [out, retval] Student* pStudent);
The SafeArrayGetElement() API makes a COPY of the required element of the array and so you must pass a pointer to an actual Student struct object (memory allocated for it already).
Your code above sends a NULL pointer as the 3rd parameter (i.e. ob2). This is the reason for the E_INVALIDARG error.
As a suggestion, I changed your code to as follows :
//Student *ob1=NULL,*ob2=NULL,*max=NULL;
Student ob2,*max=NULL;
Student ob1;
...
hr=::SafeArrayGetElement(*StudentArray,&lBound,(void*)&ob1);
max=&ob1;
if(FAILED(hr)) // this was where the original E_INVALIDARG appeared.
return hr;
for(long i=lBound+1;i < UBound; i++)
{
hr=::SafeArrayGetElement(*StudentArray,&i,(void*)&ob2);
if(FAILED(hr))
return hr;
else
{
if(ob2.Total>ob1.Total)
max=&ob2;
}
}
memcpy (pStudent, max, sizeof(Student));
return S_OK;
Best Regards,
Bio.
|
|
|
|
|
Thanks for the kind co-operation.
I've also found the same error.
Now the code is working fine.
Once again thanks for your efforts.
Viral Joshi
|
|
|
|