|
|
In ATL, you have CWindow which wraps most of the Win32 functionality in an easy to use class. Would that work for you?
George Mileka
|
|
|
|
|
must use _Module.Init(NULL, hInstance); in dllMain?
|
|
|
|
|
I quick search through the ATL source for "_Module" got 155 hits - so yeah you should call _Module.Init .
Steve
|
|
|
|
|
these code what action?
HRESULT hRes = ::CoInitialize(NULL);
ATLASSERT(SUCCEEDED(hRes));
::DefWindowProc(NULL, 0, 0, 0L);
AtlInitCommonControls(ICC_BAR_CLASSES);
hRes = _Module.Init(NULL, hInstance);
ATLASSERT(SUCCEEDED(hRes));
......
_Module.Term();
::CoUninitialize();
|
|
|
|
|
|
I am using an ocx in my asp.net project but as I am recompiling my ocx code, it stops working in my asp.net page where I am using it even though I am making the registry entry again.
The same recompiled code works in html page. Is there any kind of security setting which we have to set or some other king of thing. I am totally stuck!
Kindly help...
padma gahlot
|
|
|
|
|
ocx is stopped in the way of instancing or initiating (construction/initiation)?
Can you give me a clue for guessing where it stopped?
Mike
|
|
|
|
|
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.
|
|
|
|