|
|
Hai all,
Do anyone know , how to pass a C++ class from a VC++ Client to a COM EXE Server, through VARIANT.
Thanks,
George.
|
|
|
|
|
see here [^]
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.
|
|
|
|
|
Hi all!
I want to know how to write a method of interface like SORT that is able to sort
any kind of data(float,long,string) passes to it from VB,VC++ client.
Thanks in Advance.
Viral Joshi.
|
|
|
|
|
A COM server accepts typed data. So, in principle you have to do some workaround to obtain generality.
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.
|
|
|
|
|
Hi!
Thanks for the reply.
But i am not clear with the solution any related material or example will
help me better.
Thanks,
Viral Joshi.
|
|
|
|
|
I am using following code
COSERVERINFO serverinfo;<br />
COSERVERINFO* pServerInfo = new COSERVERINFO;;<br />
COAUTHINFO* pCOMAuthInfo = new COAUTHINFO;<br />
<br />
serverinfo.dwReserved1 = 0;<br />
serverinfo.dwReserved2 = 0;<br />
serverinfo.pwszName = m_strServerAddress.AllocSysString();<br />
pCOMAuthInfo->dwAuthnLevel = RPC_C_AUTHN_LEVEL_NONE;<br />
serverinfo.pAuthInfo= pCOMAuthInfo;<br />
<br />
if (m_strServerAddress.IsEmpty())<br />
pServerInfo = NULL;<br />
else<br />
pServerInfo = &serverinfo;<br />
<br />
MULTI_QI qi = {&IID_ICRSObj, NULL, 0};<br />
<br />
hr = CoCreateInstanceEx(CLSID_CCRSObj,NULL, CLSCTX_ALL, <br />
pServerInfo, 1, &qi);
but when i call CoCreateInstanceEx i get the error : hr 0x800703e6 Invalid access to memory location.
Regards,
Mushq
|
|
|
|
|
Hi all!
I want to pass the object(say studentobj having members:id,name,sub1mark,sub2mark)from VB client to the method of interface.
requirements:
1) I want that the passed object's should be stored in COM servers student class (a class added in the com server) other than the interface class.
2) COM Server is having a method in interface that returns the student object that has got the 1st rank among the other student.
All I want to know is only how to pass and return objects to and from COM Servers.
Thanks in Advance.
Viral Joshi.
|
|
|
|
|
Have a look at this[^] article. It states how to use such struct in COM objects.
Prasad
MS MVP - VC++
|
|
|
|
|
Hi!
Prasad_som thanks very much for the support.
I'll see the details of this article and will definately revert back to you.
And it is sure that i am going to take your help whenever there are problems in the road
of COM & ActiveX In ATL.
Once again very much thanks for the cooperation.
Viral Joshi
|
|
|
|
|
Hi I created an ASP.NET application in VS 2005, IIS 5.1 (which would login to a site like gmail.com after taking the user & password details), using vb.I am using interop.shdocvw.dll to invoke the internet explorer through which i am navigating the elements of the html document and passing the values(User Name And Password). When I run this URL in the windows 2003 server machine (local host where application is installed) it works fine ,but when i am trying to access the same url from other client machines ,it is promting me to enter username & password for the windows 2003 server.
How do I bypass the user / password validation for windows 2003.
arumugam_mr
|
|
|
|
|
Hi,
I m new to COM/DCOM world. May any one plz tell me that is it possible to share data/information of a DLL Surrogate between multiple clients. Any
Thanks,
Touseef Afzal
"I only fail when i give up "
|
|
|
|
|
hi I created an application about (login to rediffmail), in VS.NET 2005 using vb.net.
I am using interop.shdocvw.dll to invoke the internet explorer through that i am navigating the elements of the html document and passing the values .when I installing the software in the windows 2003 server machine it works fine ,but when i am trying to access the same webpage from some other machines ,it is promting me to enter username & password.
arumugam_mr
|
|
|
|
|
I have one Coclass named CXNode which is implementing methods of interface IXNode. I want IXElement to be derived from IXNode as I want methods of IXNode. In IXElement I have two extra methods GetAttribute and SetAttribute. I don't want to rewrite methods which are already written in CXNode.
Thanks in advance!!!
|
|
|
|
|
sandeepkavade wrote: I don't want to rewrite methods which are already written in CXNode
Hence derive from CXNode.
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.
|
|
|
|
|
But in COM you can't derive a coclass from another coclass.
|
|
|
|
|
You don't need that. You have just to derive the implementation from the C++ class (or make the CoClasses both inherit from the same C++ class, Oh yes, multiple inheritance, ATL docet).
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.
|
|
|
|
|
Hi All, I registered qtobjectmodel.dll whicj I am using in my project
# import <c:\qtobjectmodel.dll>
but when i am executing the code
it is giving fatal error
fatal error C1083:Cannot open source file:'.\BSTester_p.c':No such file or directory
fatal error C1083:Cannot open source file:'.\BSTester_i.c':No such file or directory
Can this be due to admin rights
As I don't have them on my pc
for registering the dll "regsvr32 C:\QTObjectModel.dll"-my network admin person do that.
So please guide me ,can this be due to admin rights or due to some other problem
I am using visual studio 2003
Thanks in advance
Ankit Aneja
"Nothing is impossible. The word itself says - I M possible"
|
|
|
|
|
Hai all,
Do anyone know , how to pass a user define structure from a VC++ Client to a COM Server, through VARIANT.
Thanks,
George.
|
|
|
|
|
You don't need a VARIANT . Anyway, you can pass a pointer of the struct in the byref member of the VARIANT union (of course the COM server must be aware of the struct declaration).
Hope that helps.
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.
|
|
|
|
|
Hi Pallini,
My code is given below
/************Client Side****************************************/
typedef struct
{
int i;
char ch[10];
}StrctMine;
VARIANT vrt;
StrctMine gOb;
gOb.i = 10;
strcpy(gOb.ch,"geo");
vrt.vt = VT_BYREF;
vrt.byref = (void*)&gOb;
myPtr.CreateInstance(__uuidof(MyVar));
myPtr->VarFun(&vrt);
/*************************************************/
In Server side , I have written my structure in idl file, And I called a method , that is given below.
STDMETHODIMP CMyVar::VarFun(VARIANT *vPtr_i)
{
// TODO: Add your implementation code here
MessageBox(NULL,"Hai","",MB_OK);
return S_OK;
}
But this code is not working.
Thanks
George
|
|
|
|
|
VT_BYREF by itself isn't a legal type. If you must pass the struct in a VARIANT , you'll need to serialize it into a packet of bytes (for example, XML) and pass that as a SAFEARRAY of VT_UI1 . There is also IRecordInfo , which MSDN says is for passing UDTs, but I've never used it myself.
|
|
|
|
|
I have to admint (and I don't like it a bit) that I underestimated you problem (and the fact that memory have to cross process boundaries). Anyway, there are, of course, solutions. You can:
(1) Take a drastic approach, coverting you struct into a COM object , which can be created and passed to other COM objects without problems.
(2) Copy the content (memory) of your struct to a SAFEARRAY (even to a BSTR , a bit ugly, but AFAIK, working) and pass it to the out-of process COM server that can claim the struct back from the memeory content of the SAFEARRY (or BSTR !).
I think there are, as well, other solutions, but unfortunately, I can't remember, I cant't recall them...
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.
|
|
|
|
|
Hello georgekjolly,
I've written some sample codes for you which demonstrates the use of SafeArrays and the IRecordInfo for passing a struct as a VARIANT parameter.
Contact me via :
bio_lim_2004@yahoo.com
I'll email it to you.
Best Regards,
Bio.
|
|
|
|
|
Hello George,
Thanks, I've received your email this morning. I've tried twice to send you the sample codes as a zip file attachment but your email server kept messaging me of send failure.
Do you have another email address that I can send to ?
Best Regards,
Bio.
|
|
|
|