|
Here is the code that causes problem:
<br />
CComPtr<IUnknown> m_pMyComp;<br />
IUnknown* pUnkOuter = GetControllingUnknown();<br />
HRESULT hRes = CoCreateInstance(CLSID_MyComp, pUnkOuter, CLSCTX_INPROC_SERVER, IID_IUnknown, (void**)&m_pMyComp.p);<br />
if (hRes != S_OK)<br />
return hRes;<br />
This code was ported from VS2003, it works in VS2003 but it crashes only in VS 2005 release mode. Any idea where the problem is??
|
|
|
|
|
What is the HRESULT ? Check additionally with the "dependency walker" whether all dependent dlls are available
|
|
|
|
|
|
|
I have a file MYFile.WSC which is being used by as asp site, which i am converting over to .net (c#). Inorder to use this .WSC file i am going down the route of com interop so as .net can use the existing code, to save me recoding. I am generating a type library file by right clicking on it and selecting the option to generate one, i am then parsing this into TlbImp:
TlbImp C:\MYFile.tlb out:C:\MYFile.dll
Microsoft (R) .NET Framework Type Library to Assembly Converter 2.0.50727.42
Copyright (C) Microsoft Corporation. All rights reserved.
TlbImp : error TI0000 : System.SystemException - The type library importer encountered an error during type verification. Try importing without class members. :
System.TypeLoadException - The signature is incorrect.
There is no information on HOW to import without the class member???
thanks
|
|
|
|
|
Hi,
i write one activex, it have one property that receive string with file name to open. I open my activex through iexplorer. AxtiveX is writen on VC++ 2005
Problem is that wherever i put my .html file in diferent folders it always search for the file in the folders that activex was started for the first time.
My file looks like this
<object <br />
width=450 height=250 <br />
classid="clsid:BB4DE790-ED91-44ED-87BC-2B0811F56DFB" ><br />
< param name="source_file" value=".\aa.txt" ><br />
</object><br />
Help
|
|
|
|
|
It works fine in previous version until we decide to use .NET 2005. The C# project failed to add reference of COM Dll in C++ with the error message:
A reference to "../whatevername.dll" could not be added. Please make sure that the file is accessible, that it is a valid assembly or COM component".
Please help.
Jack Rong
|
|
|
|
|
You should make Interop.whatevername.dll file and add it to your project. Some tools provide by VS2005 will help you. Look for TLBEXP.EXE
|
|
|
|
|
I have written an ATL COM server in a DLL with merged proxy/stub using Visual Studio 2005. It can sometimes be used locally and other times remotely. Deploying locally is straightforward and I've now got a client using it that way. However I've been wading through all sorts of internet articles, discussions etc. about how to deploy, debug, and use the component remotely, but to no avail.
I need to be able to deploy and debug on a remote machine via peer-to-peer and/or ethernet switched networks, including guidance on how to configure the security correctly on Windows XP Prof. with SP 2. I've got to believe there is a 'step by step' guide on how to do this, but I haven't found one yet.
Please can anyone help.
Thanks.
|
|
|
|
|
Hey,
i always register my dll in com+ as application. Than you can export this application in a msi file. You can deploy for clientside and serverside. The security thing is a try and error. Good luck
|
|
|
|
|
Hi,
I want to create an IE plug-in where whenever a download dialog is expected, the file is downloaded automatically to a specified folder - the dialog should should not appear.
Has anyone worked on something similar? Is such a thing work be possible to do w/out extensive COM/IE/ATL/OLE knowledge?
I am somewhat familiar with C++ & COM/ATL/OLE concepts.
From the MSDN docs, I also know that I just need to create a COM object which implements a couple of interfaces and register it.
But, am absolutely clueless where to begin & how to get to that. (Never used the Visual Studio)
Any helpful pointers plz ?
Thanks,
-pk
|
|
|
|
|
|
Hi
i developed a com addin for msword in MFC
i have done the registration issues for it ,and i added a menu item for invoking the addin functionality , so it is registered and working properly when i open NEW word document.
the problem occurs when i OPEN an already saved word document, when i click the menu item the famous error message appears "Microsoft office word has encountered a problem and needs to close, we are sorry for the inconvience"
when i work on a new word document i can attach to the word process and debug but when i work on an opened word document i can attach but the break points are not active
can anyone give me any hint?
thanks alot
|
|
|
|
|
if i have a DLL (could be a COM DLL, could be a generic Windows DLL), is there a way to inspect it to see if it implements a specific IDispatch interface without registering the DLL and using CreateDispatch.
i imagine the process is something like:
LoadLibrary
GetProcAddress for QueryInterface
use QueryInterface to find .... (?)
i need this to test DLLs to see if they meet the requirements for our plugin interface without registering the DLL (to avoid cluttering the users' registry)
|
|
|
|
|
If the DLL has a type library, load it with LoadTypeLib[Ex] and iterate through it. I would suggest using the Ex-version of the function, as you can tell it explicitly not to register the library.
You will also have to dig out docs for the ITypeLibrary interface (and friends).
If you do not have access to a type library (not very likely, since it's a dispatch object), you'd have to create the component and QueryInterface().
--
Presented in doublevision (where drunk)
|
|
|
|
|
no, no type lib.
the problem is - the DLL can be any DLL at all. assume you've got a file named foo.DLL: no typelib, no other information - just a DLL file. you can't assume anything has called DLLRegisterServer on it, and you know have a CLSID for it. there is no CLSID, no registered interface, just a DLL file.
given that, is there a way to tell if it implements a given IDispatch interface ?
it's been so long since i've even looked at any of the low-level COM stuff... i'm not even sure what i need to do with QueryInterface... all the examples i've seen assume you have a CLSID.
ugh
|
|
|
|
|
But DLLs most often contain a type library. Are you sure it's "clean"? Sounds very odd... Load the DLL in OleView (tool which comes with VS.NET 2k3, 2k2 and VS6. Not sure about 2k5). If you can see the classes in it, you will be able to use LoadLibraryEx (that's what it does).
You could always do manual COM-plumbing to create instances of COM-classes contained within the DLL, but that's useless, as you need the CLSID...
--
Raaaaaaaaaaaaaaaaaaaaa!
|
|
|
|
|
Chris,
I believe CLSID would be required because it is possible that a single COM Inproc server can expose multiple components of which few would support IDispatch and few would support VTBL binding only.
Considering that only DLL is available to us you might not take TypeLib processing (COM servers can have the TLB shipped seperately and are not embeded in DLL resource), DllGetClassObject function can be used (after LoadLibrary)to get ClassFactory. You can use Class factory to intantiate an Object of that class passing IDispatch IID.
I believe you must also consider about single server supporting more than one components and hence more than one Class factories.
Sohail
modified 21-Apr-21 21:01pm.
|
|
|
|
|
Hey everybody.
i've just programmed an activex control using c++ and mfc. now i've got the problem that it doesn't show up in my html page. the weird thing is that i can load the page from my harddisk and everything is fine. However when loading from my server the activex area just displays a white box with a little x in the upper left corner.
more weird stuff to follow:
when i open my offline document and THEN browse to my online page the activex control DOES show up correctly. O_o
I've already debugged my ocx and can say the following:
When not showing up, the module is still loaded (CMyApp::InitInstance is called) it's not unloaded prematurely (CMyApp::ExitInstance is called upon closing explorer only) CMyCtrl::OnCreate is not called... what could it be? The control was successfully VeriSign'ed by the way
Any Help is very appreciated.
Thanks in advance,
Stephan Unverwerth
UPDATE:
The problem occurs even with a blank project from the MFC ActiveX Wizard!!!
-- modified at 9:20 Friday 31st August, 2007
|
|
|
|
|
Stephan - did you ever resolve this issue? Sounds like an activation issue.
Charlie Gilley
Will program for food...
|
|
|
|
|
hey guys,
I ma making an xpcom component to listen to event generated by Mozilla browser. It compiles fien ..but gives linker error .
MyComponent.obj : error LNK2001: unresolved external symbol "public: virtual unsigned int __stdcall WebLock::GetWeakReference(class nsIWeakReference * *)" (?GetWeakReference@WebLock@@UAGIPAPAVnsIWeakReference@@@Z)
1>.\Debug\MyComponent.dll : fatal error LNK1120: 1 unresolved externals
I am also pasting peace of code related to this error ..Please help me get out of this error.
I am linking against xpcomglue_s.lib ,xpcom.lib ,plc4.lib nspr4.lib and plds4,lib.
MyComponent.h
class WebLock : public nsIWebProgressListener,
public nsISupportsWeakReference,
public nsIObserver,
public iWeblock
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIOBSERVER
NS_DELC_NSIWEBPROGRESSLISTENER
NS_DECL_NSISUPPORTSWEAKREFERENCE
...............
...............
};
MyComponent.cpp
NS_IMPL_ISUPPORTS4(WebLock, nsIWebProgressListener,
nsISupportsWeakReference,
nsIObserver,
iWeblock)
............
.............
Thanks a lot in Advance..
|
|
|
|
|
veer_in wrote: error LNK2001: unresolved external symbol "public: virtual unsigned int __stdcall WebLock::GetWeakReference(class nsIWeakReference * *)" (?GetWeakReference@WebLock@@UAGIPAPAVnsIWeakReference@@@Z)
Error indicates, Linker is not able to find definition of WebLock::GetWeakReference . If it is you class, then provide one, or link the lib having information in.
Prasad
MS MVP - VC++
|
|
|
|
|
Yeah,
It is using xpcomglue_s.lib ..I m already including this lib file.
So plz let me know if u have anyother idea..
Thanks.
|
|
|
|
|
veer_in wrote: So plz let me know if u have anyother idea..
Probaly, you can try forums, using these libs.
Prasad
MS MVP - VC++
|
|
|
|
|
Thanks u so much for your help
|
|
|
|