|
Hi.
I'm writing a small Windows CE ActiveX app using an ActiveX container class "based on a Button" (generated by the Wizard). This "CMyButton" class has a CContainedWindow member, m_ctlButton, and I am overriding the OnDraw() method to hand-draw the button with rounded corners. CMyButton also handles WM_LBUTTONUP and WM_LBUTTONDOWN to do some other special stuff. This all works fine, however....
I'm accepting input from an alternate source (a controlwheel) and want to controlwheel press handler to force a button click down to my ATL button class. Problem is, I need the actual m_ctlButton (the contained ATL button control) to receive the button click message so it does it's normal button-ish stuff and then passes WM_LBUTTONUP/DOWN up to the container. Here's where I'm stuck.
One thing I tried was to create a COM interface in CMyButton that the controlwheel handler calls. This works. Then I thought in that interface method I could just force the contained CContainedWindow member to "click". So in the CMyButton::ButtonPress interface method I've tried things like:
::SendMessage(m_ctlButton, WM_LBUTTONDOWN);
SendDlgItemMessage(controlID, WM_LBUTTONDOWN);
PostMessage(WM_LBUTTONDOWN);
Problem is, all of these just post the message to the container. It's not like the contained ATL button actually gets presses. So my question is, how can I cause the actual contained button to click? If I can do that, the normal button-ish stuff will happen, the contained button will pass WM_LBUTTONDOWN up to the CMyButton container, and everyone will be happy (me included!). Can someone give me some advice here?
Thanks,
Mark.
Mark Malin
Software Developer
GE Healthcare
|
|
|
|
|
hi all,
I have a series of JPEG file coming from a source. I have to create a MPEG file from the series of JPEG file, which can be played in Media Player. How can I do this. What algorith i have to use or else i have to use COM and ActiveX control for the same. Can u give any idea regarding this.
Thanks and Regards
Yudhisthira Attry
|
|
|
|
|
hi. I create a web form with c# asp.net but I cant locate mouse position with c#. please help me.
|
|
|
|
|
Hi All,
I need to write some Composite control in my ATL project.
My question is how i control the GUI ?
What I mean is - in MFC i define some control variable that i can control the GUI control in easy why - can i do it also in Composite control ?
Until now i use "ListView_SetColumn" or those command to change/add/find something in my list Control - but this way is not the simple way - does there is some simple way to use the control ?
I also could not do casting from the control the list view type.
Thanks for any help.
|
|
|
|
|
ListView_SetColumn is how things were done in C. I thought ATL offered some wrapper classes for UI ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Can you please explain ?
How its can be done in ATL ?
I realy need help with that.
Thanks.
-- modified at 4:57 Wednesday 28th March, 2007
|
|
|
|
|
I am trying to display data from a list box and an entry field in list box. how do i do that?
|
|
|
|
|
Wow Use a vector
#include <vector>
std::vector<vbidiot> _vbidiots;
_vbidiots.push_back( denilda82);
My code assumes vbidiot has a copy constructor... it must
led mike
|
|
|
|
|
hi everyone,
i created a custom COM component (.exe) which is used by another .dll. i compiled the both components fine, including the code snippet below; but i get a runtime access violation error on line of exe->Dummy() after CoCreateInstance returns S_OK. it gives different addresses for each different method of the .exe component i try.
this code is inside a method of the .dll component
HRESULT hr = 0;<br />
ATLVERIFY(SUCCEEDED(CoInitialize(NULL)));<br />
ATL::CComPtr<ISomething> exe; <br />
hr = exe.CoCreateInstance(CLSID_Something,NULL,CLSCTX_LOCAL_SERVER);
ATLASSERT(SUCCEEDED(hr) && exe != NULL);<br />
ATLVERIFY(SUCCEEDED(exe->Dummy()));
exe.Release();
My .exe component is non-attributed just like the .dll (not sure if it makes any difference), i have built and registered the proxy-stub class fine, and also my .exe file is registered with "exe /RegServer".
i think there is one more thing to be done but just couldn't find out what. if it were the registry script or something, i shouldn't be getting an instance of the .exe component. any ideas ? please have some !!
-- modified at 14:18 Thursday 22nd March, 2007
edit: i converted the .exe interface to be non-dual (it was a dual interface before) and this time exe->Dummy() returns "A null reference pointer was passed to the stub."
|
|
|
|
|
CComPtr is a template and its argument is the interface it should contain, e.g. CComPtr<IDispatch> . It looks like you have omitted the interface UUID. It could be a posting error and that "<" and ">" were interpreted as HTML tags.
Have you tried using the DLL version as an inproc server?
If you haven't, please do so and tell us what happens.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
i created another project whose proxy-stub is merged and now the problem is resolved into another one:
i use HKEY in some of the functions as in and out parameters (they use registry keys), and my IDL file thinks HKEY is void *, contrary to the caller class, which sees HKEY as struct HKEY__* (as it should). i think this causing inconsistency between the client and the server, since i get "bad variable type" (or something similar) from CoCreateInstance only when there is a method with a parameter typed HKEY in the server.
i tried redeclaring HKEY in IDL file,including winnt.h but no luck. any hope here?
|
|
|
|
|
I'm confused about what you're doing. If you're doing what I think you are, in my opinion you've complicated things more than necessary.
In your first post you said that the interface was originally a dual interface. This means that it inherits from IDispatch, but a client would have the ability to call the interface methods through vtable calls. There are two major benefits from using an interface that inherits from IDispatch: (a) a wide variaty of clients can use it such as IE and (b) you can rely on typelib marshalling so you don't have to distribute your own proxy-stub DLL.
Both (a) and (b) requires that your interface is automation compatible, i.e. the oleautomation attribute is added to the interface declaration in the IDL file.
This also implies that you can only use data type that conforms to automation, i.e. data types that can be represented by a VARIANT . A HKEY cannot be represented in a VARIANT , thus you cannot use it; it won't even make it through the MIDL compiler.
Another thing that bothers me is more a design issue.
Originally you're creating a out-of-process server. Why would you open a registry key in one process and simply hand it over to another process? I have no idea what the server should do with the registry key, but I suggest that whatever it is it should be given a path where the modifications should be done and open the registry solely.
Suppose that the exe-server is distributed to another machine, then it wouldn't even be the same registry.
So I guess it's about two questions:
1. What is the server supposed to do with the registry?
2. What are the limitations of the server in the aspect of automation and distribution?
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
i'm trying to create a broker process for an internet explorer toolbar to work on windows vista.
internet explorer (only in vista) puts the toolbar on low registry profile on most of the web pages (all except those in trusted zone), which gets things complicated. you open a trusted site and toolbar tries to read from HKCU, you open another site and it tries to read from HKLM\Software\Microsoft\InternetExplorer\LowRegistry... something.
so what i'm doing is to use an executable file (which will always work on low profile) to do the trick. toolbar just says "save the setting", and turn away. executable will always save these settings to the LowRegistry key.
this is what i understood on msdn articles, did i simply misunderstood them?
|
|
|
|
|
I don't get why the server has to be an out-of-process server.
Do you have any links to the articles that describe this?
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
sure, here it is
http://msdn.microsoft.com/library/en-us/ietechcol/dnwebgen/protectedmode.asp
|
|
|
|
|
ajitatif angajetor wrote: did i simply misunderstood them?
Maybe. The article seems to say that depending on the IL the process "write" operations are restricted. However the lowest IL level has write access to HKEY_CURRENT_USER\Software\LowRegistry key so I would believe all higher IL's would as well. It seems that is what you need write access for (based on your post) and therefore you do NOT need a broker process with elevated IL access... if I understand your posts correctly.
led mike
|
|
|
|
|
nice touch,
but the moment you ask for HKEY_CURRENT_USER in a low integrity process, windows vista will give you the HKEY_CURRENT_USER\Software\LowRegistry key. so the low integrity process will read/write to a position like HKEY_CURRENT_USER\Software\LowRegistry\<user_id>\Software\LowRegistry
|
|
|
|
|
Ok but I don't understand why that is a problem.
led mike
|
|
|
|
|
Hi, folks.
I'm creating an edit control via superclassing in CWindowImpl, which works fine. However, though I can type in the control and get the fetch, I get none of the other control behavior niceties I'm used to getting for free. I've had to manually create the caret, the caret doesn't go to the end after typing each character, highlighting doesn't appear when I try to select text, etc.
I figure either I've done something boneheaded to hose the control (all too believable), or for some reason you have just to manually implement all this with ATL / CWindowImpl. Being an old MFC guy, I'm used to banging out a quick CEdit and it just works, so I'm not sure where things are going south.
Anyone have any thoughts on this?
Thanks,
|
|
|
|
|
Hi,
I'm working on an ATL COM project. The most of the DLL's function is to retrieve and send objects with the software that uses it and do the required job(as in business layer of the 3-layer architecture in object oriented development).
I did have many obstacles while learning this strange library. But now all was gone. I'm good enough to develop what I thought at the beginning. But I have some questions about improving the quality of the written code. When accessing the DLL all code is simple enough to understand and develop. But when accessing an object within another object some strange stuff come in sight.
To explain it simply, I'm gonna give an example which I gave in my another question as well. Take the Course, Department and Student classes again.
Student have attributes as name, surname and these can be accessed with the following methods out of the DLL.
<br />
STDMETHODIMP CStudent::get_name(BSTR* pVal)<br />
{<br />
CComBSTR bstStr(this->name);<br />
*pVal=bstStr.Detach();<br />
return S_OK;<br />
}<br />
<br />
STDMETHODIMP CStudent::put_name(BSTR newVal)<br />
{<br />
_stprintf(this->name, _T("%s"), (LPCTSTR) newVal);<br />
return S_OK;<br />
}<br />
There is nothing strange in this code when accessing Student class from outside of the DLL as below in C#
<br />
Student s = new Student();<br />
s.name = "MyName";<br />
String s = s.name;<br />
But what if I send this class' instance to one of the methods of the Department class as below.
<br />
STDMETHODIMP CDepartment::processSomething(IStudent* std)<br />
{<br />
BSTR stdName;<br />
std->get_name(&stdName);<br />
...<br />
...<br />
return S_OK;<br />
}<br />
or when accessing an class' attribute which is another class.
<br />
...<br />
ICourse* course;<br />
std->get_course(&course);<br />
BSTR courseName;<br />
course->get_name(&courseName);<br />
...<br />
I mean defining variables and/or creating instances of the classes is taking long. I tried another way to make the code easier and shorter. First I define extra methods for each method to access the object's attributes simply as below.
<br />
STDMETHODIMP CStudent::get_name(BSTR* pVal)<br />
{<br />
*pVal = this->getName();<br />
return S_OK;<br />
}<br />
<br />
BSTR CPatient::getName()<br />
{<br />
CComBSTR bstStr(this->name);<br />
return bstStr.Detach();<br />
}<br />
<br />
STDMETHODIMP CStudent::put_name(BSTR newVal)<br />
{<br />
this->putName(newVal);<br />
return S_OK;<br />
}<br />
<br />
void CPatient::putName(BSTR newVal)<br />
{<br />
_stprintf(this->name, _T("%s"), (LPCTSTR) newVal);<br />
return bstStr.Detach();<br />
}<br />
Thus there is two way to access the required method. One for inside of the DLL and one for outside of the DLL. So that when accessing the member of this class within another class is so easy as below
<br />
STDMETHODIMP CDepartment::processSomething(IStudent* std)<br />
{<br />
CStudent* cstd = static_cast<CStudent*>(std);<br />
BSTR stdName = cstd->getName();;<br />
...<br />
BSTR courseName = cstd->getCourse()->getName();
...<br />
return S_OK;<br />
}<br />
Of course one can access the attributes changing them as public instead of private. But we don't want it, do we?
With ICourse the attributes and methods of the class cannot be accessed directly. To access CCourse must be used.
My questions are
*Is casting the ICourse to the CCourse with the static_cast appropriate?
*I searched the web and looked the ATL DLL projects that I found. But I cannot find any example like this. Is the method of accessing the members and writing more methods for them appropriate also?
*Is there any other way to access the attributes of the class?(Without using DLL functions like get_name or get_course)
*Is there any other way to assign IStudent to CStudent to access the attributes of the Student class?
P.S. : I mean sensible not semantically right with appropriate
These post really long. I hope someone patient read it
Thanks to everybody who share ideas about this post.
|
|
|
|
|
We attempt to create new instance of Internet Explorer(6.0/7.0) as a separate process.
We have tried CoCreateInstance,ShellExecute and ShDocVw.
But in all these cases,the new browser is launched as part of an existing IE process.
How do we open the new window as a separate process?
Is there some registry or meta-data settign which enables each IE instance to open as a separate process?
|
|
|
|
|
Hi all
I will going to develop a project like a server application that is one or more client applications will request the data from the database.But database may be in same machine of the server application or other one. I want my application is act as a server application between the client application and database.Now i am using visual studio 2005.So,please help me that which is the best one like ATL or .....?
thanks in advance.....
|
|
|
|
|
Are you asking for technology to prefer in this scenario ? If yes, then opt for web services.
|
|
|
|
|
yah i want to know the technology? can you send any basic tutorial for web services.Right now i know only vc++,i didn't know vc++ .net. So, please explain that should be know the .net technology while creating web service oriented application?
|
|
|
|
|
Start with this[^] article.
|
|
|
|