|
Has anyone out there developed anything with the WMSDK and gotten it to link in a MFC app. I get the link error
defaultlib "msvcrt.lib" conflicts with use of other libs; use /NODEFAULTLIB:library
I did what the error message says.. and it still didnt compile.. How do i get MFC to link with the WMSDK(windows media sdk)? Thanks for any help...
-VIk
|
|
|
|
|
I'm going mad with the access violation error at OLE32.dll. I'm working on a project of namespace extension. Sometime when I close the explorer window, There will be an error report that says access violation at OLE32.dll at 0x7FF668FD. Can anyone give me some help on that problem?
Thank you in advance.
|
|
|
|
|
Try looking on Microsoft's site for .DBG files. They usually are updated with every service pack.
|
|
|
|
|
Eric,
Check out:
http://codeproject.com/dll/libdump.asp
GEorge
|
|
|
|
|
Hi - New to COM / ATL, just getting to grips with this stuff. Could anyone tell me if its possible to have a collection which is populated from c++ client code and viewed in say a VB client app. The client code would receive messages from a remote system and add them to a collection - I can get this bit working - however what I now need is to be able to view the same collection via a VB client. This client would be periodically kicked via connection point to inform it that a message had arrived. How I envisage this to work is as follows:
(NT Service)
* One NT service receiving messages via DCOM.
* Creates a collection item.
* Adds it to the collection.
* Kicks the VB app via connection point.
(DLL)
One DLL which holds the collection class.
(VB Client)
* VB app wakes up
* VB app requests collection items via DLL.
* Messages are displayed in the VB app.
(NT Service)
Mean while the NT service continues to manipulate the collection and informs the VB app.
I thought that if I make the collection container a singleton then only one instance would be created and the NT service and vb app would see the same collection. This does not seem to be the case.
Could anyone explain how I create a shared collection between my NT service and the vb app via a DLL.
Many thanks for any advice offered!
|
|
|
|
|
From my recent experiance, you can't properly impliment a singleton in a DLL; you have to use an .EXE. It's not all that hard - make a new ATL project with EXE (not server). Create a new ATL Simple Com object (MyCollection). Make it a singleton with the DECLARE_CLASSFACTORY_SINGLETON(CMyCollection) macro. Modify your STDAFX.H generated file and change _ATL_APARTMENT_THREADED to _ATL_FREE_THREADED. You're good to go. Register it.
Import your generated .TLB to make the smart pointers and whatever. I suggest using something like this:
MyServerApp::IMySingletonPtr iSingle("MyServerApp.MySingleton") for each use, since it's very possible for the user to kill the process.
Word of warning: once the last usage of your singleton (addref/release) is released, if there is no activity for 5 seconds, then it will be destroyed. If this is a problem, then either use connection points or some other refernce mechanisim.
|
|
|
|
|
Hi there, I'm making a typelibrary with ATL for visual basic users. Does anyone know how you can create a static function so that it appears in the section when i look at my library with the objectbrowser in VB ?
|
|
|
|
|
According to MSDN (October 2000), ITypelib2::GetDocumentation2 "will call _DLLGetDocumentation in the specified DLL to retrieve the desired Help string, if there is a Help string context for this item."
Unfortunately, I cannot find a function prototype for DLLGetDocumentation() and my searching has devolved into curses!
Does anyone know the prototype or where I can find it?
Cheers!
|
|
|
|
|
HRESULT WINAPI DLLGetDocumentation(ITypeLib* ptlib, ITypeInfo* ptinfo, LCID lcid, DWORD dwCtx, BSTR* pbstrHelpString);
|
|
|
|
|
I have build a dcom that update data on a db.
the dcom sits on the server and so is the db.
i'm registering the server as :
"\\computer_name\dcom.exe" /regserver
some how, the dcom who suppose to work on the server is working on the client, so he search for the db on the client and not over the server.
what should i do? any code will be great, i can send the code to you.
please .. i'm so .
thanks,
///
(.)_(.)
oOO(.)OOo
|
|
|
|
|
> i'm registering the server as :
> "\\computer_name\dcom.exe" /regserver
This does not tell COM to instantiate the COM server on computer_name, but rather to retrieve the disk file that houses the server from computer_name. COM does so and then instantiates the COM server on the local machine using the bits from the disk file located on computer_name.
The quickest way to achieve what you want is to register the COM server locally, then use dcomcnfg to modify the registration for instantiating on computer_name.
The soundest way to achieve what you want is to use CoCreateInstanceEx() to create the COM server and directly tell COM to instantiate the COM service on computer_name. This way, your configuration can't be botched after installation by misuse of dcomcnfg.
It would be a good idea to study any indroductory DCOM text book for details. Also search MSDN for dcomcnfg and CoCreateInstanceEx.
|
|
|
|
|
Hi Hush,
You may be registering the exe on your machine rather than the remote machine. You need to run "dcom.exe /regserver" from the client and FROM the server. This can not be done remotely (as far as I know?).
I have come across this problem often enough to include the following code in the remote classes to tell me where it is running.
// ***************************************************************************
//DESCRIPTION:
// Return the machine name of the machine running this code.
//PARAMS:
// *pbsrtMachine Name returned here
//RETURN:
// Standard HRESULT
//CREATED:
// 1-2-2001, 16:51:31 by john@mctainsh.com
// ***************************************************************************
STDMETHODIMP CWhereAmI::GetMachine(BSTR *pbstrMachine)
{
ATLTRACE( _T("CWhereAmI::GetMachine(%p)\n"), pbstrMachine );
ATLASSERT( pbstrMachine );
USES_CONVERSION;
//Get my name
DWORD dwComputerNameLength = MAX_COMPUTERNAME_LENGTH + 1;
TCHAR szComputerName[MAX_COMPUTERNAME_LENGTH + 2];
if( GetComputerName( szComputerName, &dwComputerNameLength ) )
szComputerName[dwComputerNameLength] = NULL;
else
_tcscpy( szComputerName, _T("Unknown") );
*pbstrMachine = SysAllocString( T2W( szComputerName ) );
return S_OK;
}
---------------------------------------------------
I have a note on DCOM remoting at
http://www.mctainsh.com/COM/SmartPtr3.aspx
The hardest thing I find is getting security correct. Let me know how you get on...
Have a great day!
http://www.mctainsh.com
|
|
|
|
|
Hi,
In MFC, people can derive a class (say CA) from CCmdTarget, and then use macros such as
BEGIN_DUAL_INTERFACE_PART, BEGIN_INTERFACE_MAP etc. to expose an interface.
Another dll can access this interface by instantiating CA and then call CA's GetInterface().
My question is how to achieve the same thing using ATL?
I tried to create a ATL project with a COM class exposing a dual interface. If I instantiate the COM class,
I would get a compile error saying virtual functions AddRef, Release,QueryInterface are not implemented.
I don't need proxy/stub code involved becuase this interface is accessed not through COM actually. The reason
I have to do this because another DLL requires my DLL's exported class to expose a dual interface for it.
Thanks in advance for your big help and precious time.
Tony
|
|
|
|
|
In ATL, your CA class is an abstract base class - it doesn't have implementations of the IUnknown methods, as you've found out from the compiler errors. See KB article Q181265 for the steps you take to make a new object. Basically, you instantiate a CComObject<CA> instead - CComObject provides the IUnknown implementation.
--Mike--
http://home.inreach.com/mdunn/
"That probably would've sounded more commanding if I wasn't wearing my yummy sushi pajamas."
--Buffy
|
|
|
|
|
Hi everyone,
I want to make a website and to show tumbnails of images. I can't find any free component or source code to solve this problem. Does anybody to help me?
Best regards,
Leslie
|
|
|
|
|
Hi,
I have the following problem.
From within the same thread I wish to call two components with different threading models.
Number one component will instantiate another component and receive events through connection points. This component will have to be Free-threaded or the call to ICOnnectionPoint::Advise() will fail.
The other component should instantiate the IShellLink interface to create a shortcut.
Take a look at this sample:
::CoInitializeEx(NULL, COINIT_MULTITHREADED);
HRESULT hr = S_OK;
IMulti* p1 = NULL;
IShellLink *psl=NULL;
hr = ::CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, IID_IShellLink, (LPVOID*) &psl);
ASSERT(SUCCEEDED(hr));
hr = CoCreateInstance(CLSID_Multi, NULL, CLSCTX_INPROC_SERVER, __uuidof(IMulti), (void**)&p1);
ASSERT(SUCCEEDED(hr));
p1->Release();
psl->Release();
::CoUninitialize();
The problem is that the call to
hr = ::CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, IID_IShellLink, (LPVOID*) &psl) fails when CoInitializeEx has been called with the COINIT_MULTITHREADED parameter
Any help will be greatly appreciated
Christian Skovdal Andersen
|
|
|
|
|
I Everybody,
I try to use WTL to create an list control with callback Items but it does not work !
My parent window does'nt receive the LVN_GETDIPINFO message.
Any Idea?
Thanks for help
Vincent Daron.
|
|
|
|
|
I'm going mad with this. I created an ATL object with a single Dual Interface. I use this from a C++ project using smartpointers... no problem. I have now added an events interface implementing IConnnetionPointeCOntainer etc following closely a numbe rof examples and my ATL Internals book. The component builds no problem however the client now gets the error C2787: 'IDispatch' : no GUID has been associated with this object. What is going on ?? Does anyone have a decent example of a simple ATL component that has one standard interface and another events interface and a C++ client that that implements both the standard dual interface and the event sink using the smart pointers.
Please help if you can..
|
|
|
|
|
Chris,
My 'DCOM D-Mystified' tutorial, here on The Code Project, might help. With it, you can get your feet wet at least doing up a simple client/server system using Connection Points and the works. I know its title says DCOM, but it can work for COM too -- just keep the server and client on the same computer!
Click here to start the tutorial!
Cheers,
Brian Hart
|
|
|
|
|
Thank you, Thank you Thank you. I've got it working at last. One of the problems I had with the error message was because I needed to include the atlbase.h header as well.
Chreers
|
|
|
|
|
I developed a system that is on the market more than one year and the last
version was updated on September/2000. The system is developed in Visual C++
(SP4) using client/server technology throw DCOM servers (with ATL). Everything
was correct until this week, when five costumers had the following
problem: "Class not registered" (HRESULT = 0x80040154). We have about ten servers
that are registered during the system's installation, but just one is having this
problem. In other machines everything is correct.
In these costumers, analyzing the registry, I just found two entries with the
name of the server (the server's name is MTEFGERADORS with just one interface
IMTEFGERADOR):
[HKEY_LOCAL_MACHINE\Software\CLASSES\CLSID\{B54FCA20-3470-11D3-84DE-0080AD19F504}
\InProcServer32]
@="C:\\WKRADAR\\PGMS\\FISCAL\\MTEFGERADORSPS.DLL"
"ThreadingModel"="Both"
[HKEY_LOCAL_MACHINE\Software\CLASSES\Interface\{B54FCA20-3470-11D3-84DE-
0080AD19F504}]
@="IMTEFGerador"
In fact, there are many other keys missing. The first effort was to registry
manually, using the commands "regsvr32 MTEFGERADORS.dll"
and "MTEFGERADORS.exe /RegServer", but the registry didn't changed.
The second effort was to reinstall DCOM with no success.
The third effort was to format the machine and just install Windows and the
system. But it didn't work either.
It happens on Windows 95, 98 e NT.
Would appreciate any help ..
|
|
|
|
|
1)check if you make every component version in the same project or diferents projects.
2) Unregister the component in the client a server ( write: regsvr32 "Mydll.dll" /u )
3) Make the ThreadingModel free (for concurrency).
4) register the project-dll
4) Check the project id in the server and client.
5) try again.
|
|
|
|
|
1)check if you make every component version in the same project or diferents projects.
2) Unregister the component in the client a server ( write: regsvr32 "Mydll.dll" /u )
3) Make the ThreadingModel free (for concurrency).
4) register the project-dll
4) Check the project id in the server and client.
5) try again.
|
|
|
|
|
I have seen a similar problem before.
In our case what had happened was that the .rgs file in the project was incorrect!
That is it had different ID's to the actual interface! So when we registered it the
registry entries were wrong.
So, I suggest you check that the .rgs iids all match what the client is actually requesting. If there is not a match then I suggest you create a NEW project an add all
your code to it, then re-compile the client(s). If this is not an option then you need
to manually make sure that your server code has the iids that the client is asking for.
(Find in files *.* all matchs for the previous iids, just to make sure).
BTW: Really really make sure that the registry is clean, this is very important. So
you should :
Make sure that it is not running (or for DLL's not loaded).
Deregister it.
Then search the registry for old stuff (CLSID and Appid)
Let us know how you go.
|
|
|
|
|
Does anyone knows a window DLL which can help to detect wm_message of an active window. I also want to know how to make use of this DLL in VB ?
|
|
|
|