|
Need to ask you a question:
Do you want Object2 to be a copy of Object1?
or Do you want Object2 to be the same instance as Object1 ?
Difference between the 2 is that, if you have a copy, you can then set both with different property values. Otherwise, if you change a property on Object1 then Object2 will have its property changed at the same time.
|
|
|
|
|
Hi DB,
I want Object2 to be a copy - an independent copy... I am no VB specialist but I think the way to do your no 2 is:
<br />
Set Object2 = Object1<br />
Thanks,
Jerry
|
|
|
|
|
Humm .. i dont know if this can be done, but while you wait for an answer, i would suggess you create a Method in your COM object that copies the content like:
Object1.CopyTo(Object2)
Seems like the best alternate solution to me
|
|
|
|
|
Yep this is indeed what I have done - a Clone method but I was hoping of something more elegant!
Well that was for some VB users so never mind
|
|
|
|
|
yes jerry, u and darkbyte are on the right track. There is no other way other than creating a method which returns another copy of that object.
One decoration that can be done to ur Clone method is, make it as the default method of the interface. For this goto the IDL defenition and change the DISPID to 0. then the vb cleint can call the clone nethod as:
dim a as new UrObject<br />
dim b as UrObject<br />
a(b)
Here a(b) will call ur default method clone
rgds... mil10
|
|
|
|
|
Exactly what I was looking for! Sir, you are a star!
|
|
|
|
|
Hi All,
How we can test performance of a COM dll? Do we have any tools shipped with Visual Studio? Any free tools on net?
Thanks & Regards
Neo
|
|
|
|
|
I have a project that was originally built in Visual Studio C++ 6.0. I have since upgraded to Visual Studio .NET and am encountering a link problem. The project is a (non-ATL generated)COM server that also employs templates that is built across 2 projects. The base class("PluginServ") implements the DllCanUnloadNow, DllGetClassObject, DllRegisterServer, and DllUnregisterServer. The .def file is in the aggregated class ("DerivedPlugin") project and declares the above exports.
The link error is the following:
------ Build started: Project: DerivedPlugInServ, Configuration: Debug Win32 ------
Linking...
LINK : warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/INCREMENTAL:NO' specification
DerivedPlugInServ.def : error LNK2001: unresolved external symbol DllRegisterServer
DerivedPlugInServ.def : error LNK2001: unresolved external symbol DllUnregisterServer
.\Debug/VPF.lib : fatal error LNK1120: 2 unresolved externals
LINK : fatal error LNK1141: failure during build of exports file
Build log was saved at "file://c:\projects\src\DerivedPlugInServ\Debug\BuildLog.htm"
DerivedPlugInServ- 4 error(s), 1 warning(s)
---------------------- Done ----------------------
Build: 0 succeeded, 1 failed, 0 skipped"
Anyone have any ideas as to how I may resolve this link error? I have looked online and have not come across a solution.
Thank you!
|
|
|
|
|
|
Hi! I'm trying to write a program that can grab the text from MS Word. This program will have to be seamless for the client, meaning the client can run a specialized program that creates it's own OLE instance of Word, so the only thing this program will have to go on is MS Word's HWND. According to the MSDN, if I can get the HWND for a class of _WwG, the inner-most window in Microsoft word, I can use AccessibleObjectFromWindow with OBJID_NATIVEOM as my object ID to get an IDispatch pointer to Word's COM model. The only trouble is, I have no idea what kind of object this points to. Is the Word.Application object, or Word.Document? Also, using GetIDsOfNames on this IDispatch interface never works, even for the must-have functions like QueryInterface and AddRef! Maybe someone could help me with this, I would really appreciate it, thanks!
-java
|
|
|
|
|
shameless bump
|
|
|
|
|
shameless bump
|
|
|
|
|
Hmmm .. here's something that might not work but might be worth trying.
Create a simple COM Object that you can use from script which exports a method that will return the pointer you get into a VBScript variant or object.
Dim myCom as new mylib.mycomobject
Dim myObj as Object
Set myObj = myCom.GetWindowObject()
Once coded, step thru code and look at myObj type in watch window or local vars. This might give you a hint althought its not guaranteed it will work.
|
|
|
|
|
I just read an article on programming the IWebBrowser2 using plain C and it raised a burning question for me so I had to double post
Please see the following
http://www.codeproject.com/com/cwebpage.asp?df=100&forumid=13828#xx897965xx[^]
How did the author know what interfaces were required???
It's killing me...i can't find info on this anywhere
I used the Ole Com object viewer tool and it doesn't tell me what i'm looking for...for IWebBrowser2 anyways
TIA
How do I print my voice mail?
|
|
|
|
|
|
GUYS ,
Have you tried using a console (NOT MFC) to access the functions you created in ActiveX(exe)?
Simple problem, make a simple functions in ActiveX (EXE), like adding of two integer and returning the sum of it to the client, save the sum to server variable + the new sum. On the other side, the client can call the ADD function by giving two parameters (A,B) and receive the sum of it, AND can ask for the value of all the sum been store in the Server variable.
grrrrrrr8888888....
|
|
|
|
|
hello,
i am new here on this site and have one quetion and hope to find good helpers here.
I want to fetch the outlook contacts. My problem is the outlook warning dialogbox. the user can give
permission for some minutes.
what i have to do ?? I have to write an Outlook-Addin?
thx a lot
|
|
|
|
|
I'm writing a client for a COM object for a company and come across this line in the disassembled tlb:
void Initialize([in] GetRefTypeInfo failed * pIConfig);
I realize that the reference type is probably defined in a separate tlb - which I don't have. Is there any way to retrieve the pointer type or otherwise work with this without having the type definition or any other documenation on this component.
|
|
|
|
|
I'm confused
When you derive an C++ class from an interface like IWebBrowser2 do you ALWAYS have to supply your own implementation of AddRef() , etc...???
Could you not do something like:
class CMy_IClass : ISomeChild, CDefaultImp
Where CDefaultImp is a generic base class which simply implements your AddRef() etc...?
Isn't AddRef() usually the same boring code anyways???
Thanks
How do I print my voice mail?
|
|
|
|
|
Hello Hockey,
The problem is that ISomeChild, being derived from IUnknown, dictates that your implementation class (e.g. CMy_IClass) implement the 3 basic IUnknown methods (i.e. AddRef(), Release() and QueryInterface()).
The implication is, of course, that you will need to provide the implementations for these methods. However, you can always use your base class's implementation of these methods, e.g. :
ULONG CMy_IClass::AddRef()
{
return CDefaultImp::AddRef();
}
Hope the above helps.
- Bio.
|
|
|
|
|
Hockey wrote:
When you derive an C++ class from an interface like IWebBrowser2 do you ALWAYS have to supply your own implementation of AddRef(), etc...???
Yes. Without AddRef() , Release() and QueryInterface() there would be no COM.
Hockey wrote:
Isn't AddRef() usually the same boring code anyways???
Have you looked at ATL at all? Sounds like you need it. It does all this, and more.
--
Denn du bist, was du isst!
Und ihr wisst, was es ist!
Es ist mein Teil...?
|
|
|
|
|
hi there,
while working on an CFileDialog that automaticly selects all files in the browse-dialog
like this one from here
http://www.codeproject.com/dialog/select_all_button.asp
But I get a zero handler for the IShellBrowser
by calling this line , causing an abort
IShellBrowser* pShBrowser =
(IShellBrowser*)::SendMessage( p->m_hWnd, WM_GETISHELLBROWSER, 0, 0 );
---
the hook is assigned to the dialog that reacts properly. :
static UINT_PTR CALLBACK DialogHook(HWND hwnd, UINT uMsg, LPARAM lParam, LPARAM lpData)
{
if (uMsg==296) // init finish
{
//jumps in here
IShellBrowser* pShBrowser =
(IShellBrowser*)::SendMessage( p->m_hWnd,
WM_GETISHELLBROWSER, 0, 0 );
}
}
btw,hwnd returns the right handler to my CFileDialog
any ideas how to get the IShellBrowser from the CFileDialog ?
thanks in advance,
zerwuff
|
|
|
|
|
i'm trying to add a button to the internet explorer toolbar. The button is supposed to hide and show an explorer bar that I customized. I have succeeded in adding the required keys in the registry (as instructed in MSDN library) and I can add the button by going to tools -> customize and adding the button from the list of availabe buttons. I am trying to do this process automatically so that once the user runs the program and opens internet explorer, the button automatically appears on the explorer bar. Does anyone have an idea how to do that?
I'm using visual C++ 6 on Windows XP Home edition.
Rola
|
|
|
|
|
Could someone tell me what on Earth are 'non-exposed interfaces' ?
All I know is that a COM object can have interfaces, which can be accessed by using QueryInterface , for example. I would assume that an interface needs to be exposed by the object in order for QueryInterface to be able to retrieve it.
This problem relates to the Microsoft Knowledge Base Article Q281417 (Found here[^]) and the ability to accomplish the same on Visual C++. Even if I queried for any interface on the object, then queried for IUnknown and queried for the target interface, it always fails with E_NOINTERFACE .
Any ideas, suggestions or other ?
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
I had gone thru Q281417. The term non-exposed they used in the sense non-creatable . That means u can not say
Private Obj As <big>new </big>IMsTscNonScriptable
Only thing u can do is to get a reference to an existing IMsTscNonScriptable object in the terminal server client connection activex. ie,
Private Obj As IMsTscNonScriptable<br />
set obj = MsTscAx1.Object
If u chk the IDL of the activex u can see the "noncreatable " keyword in the attribute section of IMsTscNonScriptable declaration. This noncreatable attribute will prevent a client from queryinterfacing that interface.
rgds..mil10
|
|
|
|