|
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.
|
|
|
|
|
As the subject states, I have a COM object (dll) and I need to convert this to an ActiveX control. Is this a simple task, that is, do I just need to make a few changes to "adapt" it, or will this require a lot of menial work creating all of the methods and classes using the Class Wizard.
Thanks in advance for any advice
|
|
|
|
|
Usually it depends to how many functionalities (i.e. interfaces) your control will expose (loosely speaking, during last years, Microsoft relaxed a lot the minimal requirements of an ActiveX ). IMHO the simplest way is the following:
(1) use the wizard (either the MFC or the ATL one) to build up the ActiveX control skeleton.
(2) add your object code to such skeleton.
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.
|
|
|
|
|
Thanks, I'll play around with this and see what happens.
To date - all attempts at "moving" things into my new ActiveX control, seem to confuse the Class wizard. As far as I can tell, the Class Wizard prefers doing things on its own and doesn't like anyone else mucking around with the project. Maybe I'm wrong.
|
|
|
|
|
Maybe you have to 'interfere' as little as possible with the Wizard (i.e. define the interface using the Wizard and then add your object code to the methods skeleton).
BTW are you using MFC or ATL (The latter gives you more flexibility...)?
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.
|
|
|
|
|
I started out creating an ActiveX control with MFC. After a few hours and several broken pieces of office furniture that happened to be nearby, I tried with ATL. ATL seems to give me results that are closer to what I want, but I still can't seem to convince the Wizards to recognize the classes that I copied and added to my new project.
So far I must have created/deleted projects at least 20 time (I'm sure it's more). Although I seem to be learning in the process - why do I feel even stupider than when I started?
Thanks for your help.
|
|
|
|
|
Hello everyone:
i write a win32 c++ program,then i add ATL OLE DB consumer in my project.now i need the function that when the SQL database's data change,my main program's window can refresh view.so i refer to msnd:
==========================================================================
Visual C++
Receiving Notifications
OLE DB provides interfaces for receiving notifications when events occur. These are described in OLE DB Object Notifications in the OLE DB Programmer's Reference. Setup of these events uses the standard COM connection-point mechanism. For example, an ATL object that wants to retrieve events through IRowsetNotify implements the IRowsetNotify interface by adding IRowsetNotify to the class-derived list and exposing it through a COM_INTERFACE_ENTRY macro.
IRowsetNotify has three methods, which can be called at various times. If you want to respond to only one of these methods, you can use the IRowsetNotifyImpl class, which returns E_NOTIMPL for the methods you are not interested in.
When you create the rowset, you must tell the provider that you want the returned rowset object to support IConnectionPointContainer, which is needed to set up the notification.
The following code shows how to open the rowset from an ATL object and use the AtlAdvise function to set up the notification sink. AtlAdvise returns a cookie that is used when you call AtlUnadvise.
---------------------------------------------------
CDBPropSet propset(DBPROPSET_ROWSET);
propset.AddProperty(DBPROP_IConnectionPointContainer, true);
product.Open(session, _T("Products"), &propset);
AtlAdvise(product.m_spRowset, GetUnknown(), IID_IRowsetNotify, &m_dwCookie);
============================================================================
the code is so little that i don't know how to implement in my code,did anyone can help me?
thanks a lot!
|
|
|
|
|
Hi,
I want to implement to get DOM object directly from c# to c++. I have wrapped a com object in c#. In the interface, I want to return XMLDocument object and get it in c++. Which way can I use to implement it?
Thanks,
Dave
|
|
|
|
|
Hi all,
I want to learn how to write COM component in VC++ 6.0
Anybody please send the links to the material from where a beginner
can start reading the concept and the related examples.
I also want to know the books available on this subject with Title and author's name.
Thanks in Advance to all.
Viral Joshi
|
|
|
|
|
viral_umang@hotmail.com wrote: please send the links to the material from where a beginner
can start reading the concept and the related examples.
CodeProject[^]
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Hello,
COM+ Programming: A Practical Guide Using Visual C++ and ATL (With CD-ROM) by Pradeep Tapadiya
is much better.
Regrads
|
|
|
|
|
Code project has good articles - basic and advanced.
Also, I have few links on my blog. See if this helps -
http://blogs.wdevs.com/sohail/archive/2004/11/16/1149.aspx
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.
|
|
|
|
|
|
This link will be very helpfull to understand basics of COM , ie COM from scratch.
http://www.codeproject.com/com/com_in_c1.asp
http://www.codeproject.com/com/com_in_c2.asp
Thanks
George
|
|
|
|
|
Hi all,
I need to transfer all data in RTF format from native MS Word format. The best thing that i did is to open DOC in MS Word and save it RTF format. But the problem that it's taking so long. I tried to make call Copy to selection and then paste it somewhere, it's working very fast, but the problem that it's messing up a clipboard. Can someone help me with such problem?
Maybe there is a way to transfer data directly from Word to my app. like DDE or something?
Please post your comments. It's very urgent.
Thanx.
|
|
|
|
|
Can i know what is meant by 'its messing the clipboard' so that if
can clearly loook into your issue.
|
|
|
|
|
hi guys,
this is very important please help me i'm doing win32 application on .net 2003 but i'm getting the following error
Message error LNK2001: unresolved external symbol "public: static unsigned char * Funcs::calc_func::mac" (?mac@calc_func@Funcs@@2PAEA)
for many variables i found threads on this subject on net but nothing solve my problem
please i'll appreciate any suggestions
emma
|
|
|
|
|
Thanks a lot ur right but i didn't know how should i declare it.
But it works now when i declare them in thye cpp file as
unsigned char Funcs::calc_func::X[3];
thanks a lot and i appreciate ur help.
U know what i'm new working with dlls and i would like to know how can i use it by another program coz i don't want to include my code that's why i transfered my application into dll.
Thanks in advance
-- modified at 7:24 Wednesday 25th April, 2007
emma
|
|
|
|