|
You are talking about MFC functions, right ?
If you want to paste object from clipboard then use CreateFromClipboard, otherwise CreateFromData.
All the CreateFromClipboard is doing is getting data object from the clipboard and passing it to "CreateFromData".
Edward.
|
|
|
|
|
Thanks for the response.
Yes I am talking about mfc functions.
What I want to do is,display the .xls file in the container without using CreateFromFile().I want to read the file with CreateFile() and then send that data to display in the container.I hope u got my problem.
|
|
|
|
|
Hi everybody,
How do I support COM+ services (not the old version, MTS) in an ATL 3.0 project?
I don't plan to use ATL 7.0 or Visual Studio .NET.
Regards,
Roozbeh.
Dear friends!
I mean which libraries, I must include in my project. for example when you create an ATL 3.0 project with the server type of 'Dynamic Link Library' you have the 'Support MTS' option and choosing it, causes to include proper libraries in the project. But I want to include new COM+ libraries instead of the old version MTS libraries.
thanks.
|
|
|
|
|
When you say 3.0, I assume you mean VC6?
Should be no problem. You can optionally implement additional interfaces like IObjectConstruct etc so you can see things like constructor strings, but it's not really any more difficult than writing COM components. However, you might want to look closely at your design, to see where you can benefit from stateless objects and JIT activation.
Steve S
|
|
|
|
|
(I dunno, these people that edit questions afterwards...)
AFAICR, 'use MTS' just adds some mts related libs (mtx,mtxguid and a delayload for mtxex.dll), does an mtxrereg of your DLL after a build.
I believe MTS only supports apartment threading, but someone who knows these things will be along to correct me in a while), whereas COM+ can handle free threaded stuff quite happily, and in fact, apartment threading will cause bottlenecks.
There are no libs per se (and yes, where I am, we have lots of COM+ stuff written using VS6...)
Steve S
|
|
|
|
|
I want to expose a user defined data type (struct) to clients using ATL. I also wanted this struct to be a parameter to one of my methods. Is there a way in which I could do this?
SDE
|
|
|
|
|
If your class is foo and the structure is public or accessible to the calling object:
class foo
{
public:
struct myStruct
{
int a;
int b;
} myStruct;
void UseFooStruct(myStruct s);
}
class bar
{
public:
void UseFooStruct(foo::myStruct s);
}
|
|
|
|
|
I think I must have phrased it wrong. I know what you mean. But what I wanted is to expose the struct to one of my interfaces, then be able to pass the struct from Visual basic to My VC++ COM object. Is this possible?
SDE
|
|
|
|
|
Yes. You can define a user defined structure (a Type ) in VB which corresponds to your C++ structure. That way, you can pass the structure back and forth. Look in the MSDN on how to do this: Passing User-Defined Types to a DLL Procedure. Of course, your Type declaration in VB must be equivalent to the C++ version.
|
|
|
|
|
Hi all,
Wondering if anyone knows why I'm getting this error when i try to build certain DirectShow samples from the DX9SDK. Here's what i get compiling a debug
<br />
------ Build started: Project: PlayWnd, Configuration: Debug Win32 ------<br />
<br />
Linking...<br />
playwnd.obj : error LNK2019: unresolved external symbol "long __stdcall ATL::AtlWinModuleInit(struct ATL::_ATL_WIN_MODULE70 *)" (?AtlWinModuleInit@ATL@@YGJPAU_ATL_WIN_MODULE70@1@@Z) referenced in function "public: __thiscall ATL::CAtlWinModule::CAtlWinModule(void)" (??0CAtlWinModule@ATL@@QAE@XZ)<br />
playwnd.obj : error LNK2001: unresolved external symbol "class ATL::CAtlBaseModule ATL::_AtlBaseModule" (?_AtlBaseModule@ATL@@3VCAtlBaseModule@1@A)<br />
.\Debug/PlayWnd.exe : fatal error LNK1120: 2 unresolved externals<br />
There are certain samples (with names ending in ASF) that require the Windows Media SDK and a certificate. But PlayWnd isn't one of them. (PlayWndASF is.)
I'm working on a full screen video player, the other relevant samples that play video also give me the same error. "Windowless" for example.
I know it's something stupid...
|
|
|
|
|
This is using ATL7.0, I assume.
Is the source from an MS sample? It may be that it was originally written to use ATL3, and you need to make some (hopefully) minor changes.
What's your ATL specific set of includes?
Steve S
|
|
|
|
|
It's the PlayWnd sample as found in \DX90SDK\Samples\C++\DirectShow\Players\PlayWnd. I'm using VC7 (.NET 2003) so i assume it's ATL 7? Dunno, i've been away from this stuff for a few years...
Steve S wrote:
What's your ATL specific set of includes?
//------------------------------------------------------------------------------
// File: PlayWnd.cpp
//
// Desc: DirectShow sample code - a simple audio/video media file player
// application. Pause, stop, mute, and fullscreen mode toggle can
// be performed via keyboard commands.
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//------------------------------------------------------------------------------
#include <dshow.h>
#include <commctrl.h>
#include <commdlg.h>
#include <stdio.h>
#include <tchar.h>
#include <atlbase.h>
#include "playwnd.h"
|
|
|
|
|
This machine only has vs6 on it;
Steve S
|
|
|
|
|
I am trying to write a Browser Helper Object, but I am having a problem making it recognisable as a BHO. Following the instructions in Dino Esposito's MSDN article, using VC++6 I generate a standard ATL Com AppWizard project, selecting .DLL as the server type. I then insert an ATL Object, selecting an Internet Explorer Object, leaving all the defaults (appartment threading, dual interface, aggregation, no errorInfo, Connection Points or Free Threaded Marshaller). I then simply add the extra registration into the .RGS file to put the CLSID into HKLM|software|microsoft|windows|Current Version|explorer|Browser Helper Objects. I do not add any extra code, but just build the project. It registers OK, and the CLSID appears in the registry as expected. However, when I run BHODemon (www.definitivesolutions.com), it does not see the new helper, nor, as far as I can tell, does Internet Explorer. I have compared my software with working BHOs such as IEhelper and Dino Esposito's HTMLEdit, but can find nothing to explain my difficulty. Can anyone help?
Dave
|
|
|
|
|
|
You know that in the RGS file there are 2 CLSID's right? Did you select the correct one?
|
|
|
|
|
Well spotted. An excellent bit of remote diagnosis. That's exactly what I didn't do. I selected the wrong one. Thanks.
Dave
|
|
|
|
|
I made a generic purpose windows class as follows.
template< class CExtBaseWnd = CWnd>
class CChartWndParent : public CExtBaseWnd
{
....
CMyClass m_classX;
}
But I also wanna use my custom class m_classX as a member variable.
This class is unfortunate separated with h/cpp, so failed to compile..
Is there any way of compiling this class?
|
|
|
|
|
You should be able to use it by adding a forward declaration of CMyClass above the definition of the CChartWndParent class.
<br />
class CMyClass;<br />
<br />
template< class CExtBaseWnd = CWnd><br />
class CChartWndParent : public CExtBaseWnd<br />
{<br />
....<br />
CMyClass m_classX;<br />
}<br />
|
|
|
|
|
This wouldn't work. If you want to use forward declarations, you must declare m_classX member as pointer to CMyClass .
(A stupid question: Why you cannot include the header file, where CMyClass is defined?)
Robert-Antonio
Love, truth and electric traction must gain victory over hate, lie
and diesel traction.
|
|
|
|
|
Hi All!
Are there D3D templates for WTL?
P.S. I'm lazy to write it
|
|
|
|
|
I learn to create ActiveX project to use in C#. I want to use mciSendString create some procedure same as Open, Play , Stop.
somebody can help me write this code step by step, or send to me your code.
thanks.
Nho'c Ti`
|
|
|
|
|
Some time ago, I tried using a vector to read from a file as follows:
vector<float> vec;
vec.reserve( 256 );
vector<float>::iterator it = vec.begin();
_read( m_FH, reinterpret_cast<unsigned char*>(it), 256 );
Unfortunately, vec.size() = 0, even though the elements could be accessed using vec[] or vec.at(). At the time, I couldn't find a way around this problem. vec.resize(256) didn't work because this calls size() and all the elements are reinitialised to 0.0.
Other than vec.assign(256), can this problem be resolved - or is this just a bad idea in the first instance?
John
|
|
|
|
|
|
Hello everyone
I have a wtl(VC6.0 and wtl7.1) project and a mfc dll.(not UNICODE)
in the mfc dll,
LPSTR a;
a = new TCHAR(nLen + 1);
memcpy(a, otherstr, nLen * sizeof(TCHAR));
a[nLen] = _T('\0');
in the wtl project, I want to free it as the following:
delete a;
but the program is died.
Could you tell me how to free it?
Thank you.
-Freehawk
|
|
|
|