|
Hi All,
Can anyone tell me the changes I need to make in the IDL file to add a new ATL Object to an existing project which already has one ATL Object?
Thanks and Regards,
Anil
|
|
|
|
|
You can just use the wizard. In MSVC6 select "Insert->New ATL Object...".
Steve
|
|
|
|
|
I have an activeX control in a htmal page (say second.htm), when I try to open this page from another htm page (say first.htm) and do some process in ActiveX and close the second.htm. This causes the first.htm also closed. is it due to a crash? I have added debug print in destructor of control, and found that the object is succesfully destroyed!
htm code:
window.open("second.html", "myPage");
What proble forceing the parent page to close?
|
|
|
|
|
It can be helpful for us to solve the problem showing the code fragment you wrote to close second.htm.
I guess the code for closing have influences the main process..
Michael
|
|
|
|
|
Hi guys,
Im having difficulty in getting a ListView to rearrange its icons when dragged.
This is what ive done:
1> Added an ATL control to my existing project.
2> Declared my ListView class as follows:
template <class T, class TBase = CListViewCtrl, class TWinTraits = CListViewCtrlTraits>
class ATL_NO_VTABLE CListViewCtrlImpl: public ATL::CWindowImpl<T, TBase, TWinTraits>,
public CListViewImpl<T>,
public CSortListViewImpl<T>
3> Derived my existing class (called CGridCtrl) from:
public CComControl<CGridCtrl, CListViewCtrlImpl<CGridCtrl> >,
4> Filled in the Create handler to create the listctrl and add some dummy data.
Now the list works fine, no problems. When I try and drag an icon nothing happens. To make sure it was receiving events I added a CONTEXT handler and it got called fine. I then added some handlers that changed the view and they also worked.
My question is, is this supported without additional code? Its documented in the MSDN as supported.
I also tried creating an MFC dialog project with a listctrl on it to see if it worked, but it didnt (even after playing with every possible style and extended style combination).
Thanks.
-- Raj
|
|
|
|
|
Problem sorted.
Handled the messages myself. Wasn't very difficult.
|
|
|
|
|
Suppossing I have an ocx file, is there any way to determine if this control has been signed?
I'm using mozilla, so maybe I'll need some c++ API.
Can someone help
Thanks,
Kishor
|
|
|
|
|
|
Thanks for your reply.
MSDN says "The WinVerifyTrustEx function is available for use in the Microsoft Windows 2000 and Windows XP operating systems. It may be altered or unavailable in subsequent versions."
Is this the case with WinVerifyTrust() too?
Also all I need to know is whether a file has been signed. I came across this function
fResult = CryptQueryObject(CERT_QUERY_OBJECT_FILE,
szFileName,
CERT_QUERY_CONTENT_FLAG_PKCS7_SIGNED_EMBED,
CERT_QUERY_FORMAT_FLAG_BINARY,
0,
&dwEncoding,
&dwContentType,
&dwFormatType,
&hStore,
&hMsg,
NULL);
if (!fResult)
{
_tprintf(_T("CryptQueryObject failed with %x\n"), GetLastError());
[Does it mean that file was not signed?]
__leave;
}
When this call is made on unsigned code, it has always failed. Is this sufficient for concluding that the code was unsigned.
Hope to get a reply from you
Thanks
KK
|
|
|
|
|
I guess - try it out on some files and see what results you get (and search newsgroups too, someone must have already solved this problem)
[edit]I just tried it with a couple files, and CryptQueryObject() is returning true for signed EXEs.[/edit]
--Mike--
Visual C++ MVP
LINKS~! Ericahist | NEW!! PimpFish | CP SearchBar v3.0 | C++ Forum FAQModified on: Friday, February 24, 2006 1:15:15 AM -- CryptQueryObject test
|
|
|
|
|
Thanks for your reply
I found following link http://www.totalblowhole.com/new-857613-3604.html
Here GetLastError() returns same error code either if the crypto dlls are corrupt or file is unsigned.
I think first executing API on a known signed file to determine if crypto system is OK and then using this error code after first step is successful to conclude that file is unsigned could be a solution.
|
|
|
|
|
How to do communication between Activex on HTML and
CGI server. I want to write my ActiveX using C++/MFC.
How my ActiveX will get IP address or name of CGI server.
Please Help
|
|
|
|
|
Hi,
I am facing a typical problem,in storing the application value. Here
what i have done. I am using VC++ 6.0
I have created ComAddin ,in that i have created CommandButton on
Inspector window. And in the Button event(click event) i am used to display
a dialog box.
Let us take ComAddin - class :CAddin
Interface :IAddin
For Dialog Box(which is derived from CAxDialogImpl) class --
CSample.
i have created a Edit box and a Button on that Dialog. My Objective
is when that dialog button click event occurs, the text which is edit have
to append to the current mail(the mail is in HTML format). Actually this
functionality is implemented in that CAddin with in a method take as
"ADD_TEXT".
in this ADD_Text method i used CComPtr<
Outlook::_Application>m_application variable and Active_Inspector to get
the current working Inspector windows. And useing this we can add the text
at the end the mail text. this task has been completed.
But when i call this method from CSample (dialog class) in button
click event by creating instance for CAddn class,it does not works. When i
researched for the cause. the application varianble(m_application) value
becomes null ,when that method calls from this CSample method.?
Here how can make it works, the CAddin method is called
from button click event of Dialog blass
--
Regards,
RamakoteswaraRao Koti
spend every minute for success
|
|
|
|
|
hi,
i have created on simple object for ATL application, by using ATL Object wizard ,named is Addin(class name CAddin,Interface IAddin). This class has a method(for example add),which is added to CAddin class not Interface.
And i have created a dialog box implementd from CAxDialogImpl. In this dialog box. In a dialogbox click event ,i want to use that "add" method.
How can i use that ?
Spend every minute for success
|
|
|
|
|
CComObject<CAddin>* pCAddin;<br />
CComObject<CAddin>::CreateInstance(&pCAddin);<br />
pCAddin->Add();
rgds..mil10
|
|
|
|
|
Mil's suggestion is sound but you'd have to take care the object is destroyed properly. He's the code he posted:
CComObject<CAddin>* pCAddin;<br />
CComObject<CAddin>::CreateInstance(&pCAddin);<br />
pCAddin->Add();
There's a trap here - the object is created with a reference count of zero. Since objects destroy themselves when the reference count is descremented to zero calling Release doesn't destory the object (since it decrements the reference count to -1). Using this code you would have to destroy the object as follows:
pCAddin->AddRef();
pCAddin->Release();
He's how I'd do it however:
CComObject<CAddin>* pCAddin;<br />
CComObject<CAddin>::CreateInstance(&pCAddin);<br />
pCAddin->AddRef();<br />
pCAddin->Add();<br />
pCAddin->Release();
Steve
|
|
|
|
|
Perfect Steve. I forgot the fact that CComObject instances are zero reference counted.
rgds..milton.
|
|
|
|
|
I have ATL COm dll, Now I want to convert it to ATL EXE, But when I removed the DLL main stuff to Winmain... It still assumes, its dll. When I try to execute it on cmd-shell, it gives me error messsage, " Not valid Win32 application"
Any Soultion.
cheers
Balkrishna Talele
|
|
|
|
|
You'll also need to change the project output settings on the link page from DLL to EXE ...
Why not create a new EXE project and cut/paste your code if you cannot figure it out?
:..::. Douglas H. Troy ::..
Bad Astronomy |Development Blogging|Viksoe.dk's Site
|
|
|
|
|
Mr Douglas H. Troy
Its not that simple, after all stunt, I have posted this question. Simply copy/cut/paste and changing the o/p to EXE dosent work. The entry point is itself dllmain. AND I WANT TO EXECUTE THAT EXE. do you understand
cheers
Balkrishna
|
|
|
|
|
The Exe project will give you a valid entry point (e.g. main()). Douglas did probably not mean to copy DllMain verbatim to your Exe project.
|
|
|
|
|
it gave me exe as per ur discussion, but during execution it said not vaild win 32, and my project is not of 2 or 3 files its massive project
|
|
|
|
|
Per my original recommendation, I did not mean for you to outright copy the centire contents of your DLL into a new executable project; there are obviously DLL specific implementations in a DLL ... you would need to make the determination yourself as to what can go/stay. However ... based off your following remark:
Balkrishna Talele wrote: and my project is not of 2 or 3 files its massive project
... why not just create a "stub" EXE that calls your DLL and that EXE becomes your primary application executable?
Balkrishna Talele wrote: AND I WANT TO EXECUTE THAT EXE. do you understand
Another thing: I'm trying to help/suggest things you may/not have tried to resolve your problem. Do not "yell" (aka All caps) at people who are trying to help you, or you'll find you get a big fat nothing back.
:..::. Douglas H. Troy ::..
Bad Astronomy |Development Blogging|Viksoe.dk's Site
-- modified at 13:01 Friday 17th February, 2006
|
|
|
|
|
Good day,
Suppose that I have completely developed a MFC dialog base application. At design time, I didn't want it to support Automation and I didn't check Automation support in AppWizard.
So now, how can I make it support Automation? What changes must be made to my current application?
Thank you in advance,
Have a good time!
KEMI
|
|
|
|
|
The easiest way to make this determination is to just create a new Dialog based MFC project and check the Automation support check box, then compare the source files to see what's been added ... basically, there are a couple of additional calls: CoInitialize() and CoUninitalize() are two that come to mind ...
If you're project is too big already, just create two new dialog projects; one with automation support and one without, then do a diff.
-done-
:..::. Douglas H. Troy ::..
Bad Astronomy |Development Blogging|Viksoe.dk's Site
|
|
|
|