|
It keeps getting better Thanks!
|
|
|
|
|
I have an MFC Extension-DLL which includse various controls I'd like to use in various places.
When I use it in MFC applications it works.
When I use it in ATL-Dlls it works, the wizard replaces several core methods in the Dll (DllCanUnload, etc) create a CWinApp object and all is well.
It seems like I can't use my beloved MFC-Extension-DLL in an ATL Executable project.
Excerpt:
Executable (EXE)
Select to create a local out-of-process server. This option does not allow support for MFC or COM+ 1.0. It does not allow for the merging of proxy/stub code.
Why is this ?
Is there a way to get pass this limitation ?
|
|
|
|
|
Hi,
I was developing an ActiveX control that is to be embedded in IE. While trying to implement, I ran into this problem: I thought capturing the WM_DROPFILES message should be sufficient for providing drag and drop support of files (from file explorer) to the ActiveX control. While this works if the control is embedded in a thick client (say a VB form), it doesn't work when the control is embedded inside IE. IE's default handling of dropped files kicks in and it tries to open the file!
I tried to look for help from the usual sources (MSDN, google etc) but most of them deal with MFC drag and drop support while I am using ATL and can't use any of those. Any help here would be greatly appreciated!
Thanks,
KR Nathan
|
|
|
|
|
Hi
To have drop capabilities, a control must implement IDropTarget interface and regiter itself as a drop target using the RegisterDragDrop function.
Fabian
|
|
|
|
|
Thanks for this info. However, looking at the IDropTarget, it looks like much more sophisticated than what I require. When files are dragged from explorer and dropped, I just need to know the filenames of the dropped files so that I can show them in a list inside my control. WM_DROPFILES does exactly same but doesn't seem to be working when the control is placed inside IE.
Thanks for your help.
|
|
|
|
|
Hi,
I have created a ATL component in a MFC application with Add Class wizard. Now i will instantiate an object from this component in a thread, and i have included component header file in that thread's .cpp file however the compiler generate error for unknown IID and i do not know which file must be included that solve my problem?
Alireza
|
|
|
|
|
Hi
I am a beginer VC++ programmer. I have a question:
What is ATL and how can use its.
Are you know the meaning of "MARZOGH"?
If YES,Please send for me.
|
|
|
|
|
i am in need of a good tutorial on installscript,working with scripts,extensibility, custom dialogs for working on
dev studio 9 on a installshield project.
But on web it seems no good tutorials are available.everything points to books from installshield.com
Advise.
Thanks
Suman ray
|
|
|
|
|
I need to be autentificated by a server before I can download a file from this site. I dont know how.
The server adress that auentificate me is like this:
http://www.xxxx.com/user=xx&psw=xx
when my browser gets to this url is redirected to other page that give me the links to the files I want to downlaod.
Im trying to use the method URLDownloadToFile to get this files, but I need to autentificate my self first and I dont know how, can some body help me plz tks.
|
|
|
|
|
Hi all,
I have to pass a safearray to my DLL COM server. the method must size the array, and then fill with data. After that the client must use the data the server has inserted. I suspect my passed array is a copy of the one sent by the VB client, so my VB client does not access the data. how I have to modify my MIDL lines in order to have the safearray shared?
I am using:
[id(1), helpstring("method GetPosition")] HRESULT GetPosition(VARIANT arrayPosition);
arrayPosition is a vector of double like this:
Dim arrayPosition as Double (0 to 9)
Dim a As New RunTimeAx
a.GetPosition arrayPosition
Debug.Print arrayPosition (0)
Debug.Print arrayPosition (1)
Debug.Print arrayPosition (2)
Debug.Print arrayPosition (3)
Could you pls help me?
Thanx in advance
|
|
|
|
|
You probably want
HRESULT GetPosition([in, out] VARIANT* pArrayPosition); or even, if the caller won't ever pass anything interesting in:
HRESULT GetPosition([out, retval] VARIANT* pArrayPosition); In the second case, you would transform your VB code to
Dim arrayPosition As Variant
Dim a As New RunTimeAx
arrayPosition = a.GetPosition
Debug.Print arrayPosition (0)
' etc (You might need to use Set , I haven't used VB for a while).
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
Thanx a lot Mike,
when you come in Italy I'll offer you a beer.
Thanx again.
|
|
|
|
|
Consider the following code.
Consider the following code
byte[] message = new byte[40];
message[4] = (byte)'S';
message[5] = (byte)'S';
message[6] = (byte)'T';
message[7] = (byte)'A';
message[8] = (byte)'R';
message[9] = (byte)'T';
message[10] = (byte)'C';
message[11] = (byte)'S';
int retval = myStream1.Write(message);
This code is a C# code myStream1 is an object of a COM component, What would be equivalent code in VC++,
Byte seems like cannot be a bstr datatype in VC++.
I'll write a suicide note on a hundred dollar bill - Dire Straits
|
|
|
|
|
int retval;<br />
HRESULT hr = myStream->Write(CComBSTR(L"SSTARTCS"), &retval); or
hr = myStream->Write(_bstr_t(L"SSTARTCS"), &retval); depending on if you are using ATL or MFC prior to VS.NET/ATL7 (CComBSTR was an exclusive ATL thing in ATL3).
Mr.Prakash wrote:
Byte seems like cannot be a bstr datatype in VC++.
I'm not a .NET rocket scientist, but you are doing to that poor COM object seems to be dangerous. A BSTR string is a length descriptor followed by a sequence of characters. I thought .NET marshalled .NET strings as BSTR strings automatically between .NET and COM...? Why not just stuff an ordinary string into Write()?
--
Booohoo!
|
|
|
|
|
Click[^]
I figured out that byte[] array from C# is not a BSTR in COM.
No i am not even a Car scientist of C#
|
|
|
|
|
Hi all,
I made my first ATL w/ Visual C++ 6.0 project and it (almost) perfectly works in Debug Config, when I try to compile in Release MinDependecy I get the following link error:
inking...
Creating library ReleaseMinDependency/cnitfc.lib and object ReleaseMinDependency/cnitfc.exp
LIBCMT.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
ReleaseMinDependency/cnitfc.dll : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
What's goin'on?
Please help me.
thanx a lot.
Regards,
Andrea
|
|
|
|
|
Remove '_ATL_MIN_CRT' from the list of pre-processor defines. You've used part of the C run-time library that pulls in the initialisation part of the library. This looks for _main, which isn't defined if _ATL_MIN_CRT is defined.
HTH
Stuart Dootson
'Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p'
|
|
|
|
|
|
Hi,
In IBM open class library,we have a class called IKeySet which has to be replaced by map in STL as per IBM migration guide.But in eh IKeySet we have a provision to add an elelemnt with key as well as an element.(this feature it inherited from ICollection class which is equivalent to list or deque in STL). I am trying in vain to have this type with map also but dint succeed.
Can you guys give some idea as how to implement this.That would pull me out of this soup..
Thanks
Sasi
|
|
|
|
|
Explain what you meant by "add an elelemnt with key as well as an element."
Kuphryn
|
|
|
|
|
Infact IKeyset inherited the feautures of ICollection( which is like list) and IAKeySet(its like map).SO we can add the elements of both with key (like in map)as well as just the element(liek in list). Hope this will suffice.Please look at the code below
#include <iostream>
#include
#include <deque>
#include <utility>
#include <string>
using namespace std;
typedef const string& CIR;
typedef enum { IEArgString, IEArgNumber, IEArgSpecial } IEArgType;
class IEArg {
public:
//* Element name and value and embedded datatype.
string name;
string value;
IEArgType dataType;
//* Default constructor given name and value.
IEArg(CIR n, CIR v) : name(n), value(v) { dataType = IEArgString; }
IEArg(CIR n, CIR v, IEArgType t) : name(n), value(v), dataType(t) { }
friend bool operator<(const IEArg& lhs, const IEArg& rhs);
};
inline bool operator<(const IEArg& lhs, const IEArg& rhs)
{
if (lhs.name == rhs.name && lhs.value == rhs.value)
return FALSE;
else
return TRUE;
}
typedef map<string,iearg> IEArgList;
inline CIR key(const IEArg& iea) { return iea.name; }
typedef deque < IEArg > IEOArgList;
typedef deque < IEOArgList > SUMMARY;
main()
{
int days=10;
IEArgList al;
string where;
string nam="1235";
string val="12";
// Maps and multimaps deal with pairs
typedef pair<string,iearg> entry;
entry p0("Time",IEArg("1100","A"));
entry p1("Time",IEArg("1234","A"));
entry p2("Transaction",IEArg("4567","D"));
entry p4("xransaction",IEArg("2345","B"));
entry p3("ResultCode",IEArg("5678","C"));
al.insert(p0);
al.insert(p1);
al.insert(p2);
al.insert(p4);
al.insert(p3);
/********
I want add just IEArgList just liek a collection with out key
********/
IEArgList::iterator iter;
for (iter = al.begin(); iter != al.end(); iter++) {
cout<<"values are:"<<(*iter).first<<":"<<(*iter).second.value<<":"<<(*iter).second.name<
|
|
|
|
|
Essentially, you want to store an into sorted container, correct? In your example, you are storing it inside a map and requires key/value. One solution is a set.
Kuphryn
|
|
|
|
|
I can't understand what your code is supposed to be doing. Why not describe your basic data structures and what this collection is supposed to be used for? You obviously cannot make a map or a set of a type and then store things that are not actually instances of that type in the map or set.
FWIW when you reply with code if you check the little box after the text box it will display the template definitions directly and not require us to 'view source' and generally mess about.
Paul
|
|
|
|
|
CPU usage increases for list view for same app under XP
-------------------------------------------------------
I've been working on an application for several years which uses MS ListView controls to display large grids of data (perhaps 50 lines by 100 columns).
background: The application displays market data, amongst other things, from electronic exchanges.
The application updates individual cells relatively rapidly.
I handled the CustomDraw events to provide formatting such as colors.
The list view is in virtual mode.
All was well on Win2000. CPU usage was reasonable. However, when I open the same window under XP, the CPU usage seems to increase dramatically.
I used the ATLControls.h list view wrapper as a thin wrapper around the control, and compiled under VC6, SP5.
Does anyone have any clues?
Thanks in advance
Dan Hill
|
|
|
|
|
PS Am also using WTL MDI wrappers
|
|
|
|