|
uuuuuuh,no.
I added an IDispEventImpl to inheritance list and it worked.Great help,thanks
|
|
|
|
|
Cool - glad I could help
|
|
|
|
|
hi all,
i need to migrate our vc6 atl service .exe from windows nt 4.0 to windows 2003.
i just register the service in windows 2003 without changing the existing code . After that, i gave the stop command in services tool for that service, it lead to a stopping for a long time and never it stops. So, I need to restart the server. Please suggest me any solution to stop the service ASAP.
Thanks.
Sumoon
|
|
|
|
|
Hi All,
I followed Michael Dunn's article on The Complete Idiot's Guide to Writing Shell Extensions - Part I[^], and created a pair of (two separate) extensions: one for creating file checksums; and a second for verifying. Reference: A File Checksum Shell Menu Extension Dll[^].
It is apparent these are mutually exclusive on Vista (I just retested on Windows 2000 - OK):
* Register both Create and Verify
- Only Create is available
* Register only Verify (unregister Create)
- Verify is available
Any ideas? I pasted part of the Registry Resource (to verify uniqueness of UUIDs). But I suspect it has to do with the way the handler registers. I verifed both are registered under HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers.
Jeff
The Ctx prefix was added below so that the items would 'stack' on the Context menu.
HKCR
{
NoRemove CLSID
{
ForceRemove {7E745006-3E3F-42F8-B806-E24D4133439C} = s 'CtxVerifyHash Class'
...
and
HKCR
{
NoRemove CLSID
{
ForceRemove {571077DC-F353-43C8-ACAC-4DE4B7EFC4E3} = s 'CtxCreateHash Class'
...
|
|
|
|
|
Hi All,
A fresh build using Visual Studio 2005 (new project, not a port) did not resolve the issue. I did copy and paste content. I suspect it is the IDL file... Also, the issue is confirmed in XP.
Jeff
|
|
|
|
|
Hello all,
I am trying to add toolbar using shared addin(C++/ATL) using VS 2003.
i have successfully done with VS 2005 but on same i am getting error like _Commandbar::add function does not 4 argument but it is running in 2005.
can anybody tell what should be problem behind that.
Thanks
bankey
|
|
|
|
|
I've been working on an application that uses OLE DB to read and store data from an ODBC source (currently an access file on the local machine). Up until today everything has been working perfectly when I made some changes to the database structure and several query functions. The odd thing is I haven't changed the code in this function or the connection setup code. In the example below, the SQL statement is something to the effect of "SELECT * FROM Sensor WHERE SensorVar='Temperature' ORDER BY -SensorID;" which is a query that worked yesterday.
<br />
HRESULT hRet;<br />
if(FAILED(hRet=m_Accessor.Open(m_Sess,sSQL,m_Propset)))<br />
{<br />
return FALSE;<br />
}<br />
The function values with a hRet value of 0x80040E21, which corresponds with "Multiple step OLE DB operation generated errors" or DB_E_ERRORSOCCURRED, depending on which google result one believes. Since the problem occurred after the database changes (the net effect being the addition of a table) I'm inclined to believe the problem lies there, but I've included the relevant code and I'm open to any suggestions
Thanks!
<br />
CDataSource m_Source;<br />
CSession m_Sess;<br />
CCommand <CAccessor<CSomeAccessor>> m_Accessor;<br />
CDBPropSet* m_Propset;<br />
<br />
<br />
..............<br />
<br />
<br />
if(m_Source.OpenFromInitializationString(A2OLE(szBuff),FALSE)!=S_OK)<br />
{<br />
m_Source.Close();<br />
return FALSE;<br />
}<br />
<br />
if(m_Sess.Open(m_Source)!=S_OK)<br />
{<br />
m_Sess.Close();<br />
m_Source.Close();<br />
return FALSE;<br />
}<br />
<br />
m_Propset=new CDBPropSet(DBPROPSET_ROWSET);<br />
m_Propset->AddProperty(DBPROP_IRowsetChange,true);<br />
m_Propset->AddProperty(DBPROP_CANFETCHBACKWARDS,true);<br />
m_Propset->AddProperty(DBPROP_CANSCROLLBACKWARDS,true);<br />
m_Propset->AddProperty(DBPROP_UPDATABILITY,DBPROPVAL_UP_CHANGE|DBPROPVAL_UP_INSERT|DBPROPVAL_UP_DELETE);<br />
<br />
szBuff is a ODBC connection string.
modified 12-Jul-20 21:01pm.
|
|
|
|
|
Hi,
I am trying to create an ActiveX control in an ATL project through code. I can create the control but the interface is not showing on the window created.
I am using the following line of code:
========================================================
CComPtr<iunknown> pControl;
GridPtr spGrid;
static const IID IID_Grid = { xxxxx.......};
AtlAxWinInit();
// Paste Grid(ActiveX) in the main window.
AtlAxCreateControl( L"Grid.Grid.1",
hChild,
NULL,
0x00
);
// Get the interface on the grid
AtlAxGetControl( hChild, &pControl );
pControl->QueryInterface( IID_Grid, (void **)&spGrid );
==========================================================
Please suggest what can be the problem .
Regards,
Arjun
Arjun Marwaha
|
|
|
|
|
try this:
ShowWindow(hChild, SW_SHOW);
IMO is more easy to create an activex control with the CAxWindow class, because you can pass style, position on create method.
[]'s
Clebson
|
|
|
|
|
I wrote a prog that parses files in certain format,
extracting some UTF8 strings (language may be
arbitrary) out of these files
and placing these strings in Window.Forms controls
like RichEdit and ListBox. This program was written
originally in C#.NET, and the strings were correctly
drawn in the corresponding controls via using
GetString() method of System.Text.Encoding.UTF8.
Now I'm translating the prog from .NET to WTL.
The problem is that I failed to make WTL controls
(derived from CListViewCtrl and CRichEditCtrl templates)
to correctly interpret extracted multibyte UTF8 strings.
The compiler settings for the project are default:
"Use multibyte characters" (_MBCS).
Besides, I set explicitly code page to CP_UTF8 writing
"_setmbcp(CP_UTF8);" in the .OnCreate() handler in MainFrame.cpp.
However it produces no effect: instead of, say, cyrillic strings
of size N there is drawn an abracadabra
of size 2N, i.e. the corresponding controls interpret the string as
the sequence of ordinary bytes instead of the sequence of UTF8 characters
2 bytes wide each.
The attempt to convert UTF8 strings to Unicode with MultiByteToWideChar()
failed as well. Though the resulting strings are correct unicode strings,
substituting them into controls (with LPCTSTR cast -- otherwise source
failed to compile) leads to drawing the first char only for ordinary ASCII
symbols and to drawing an abracadabra (of different kind than that without
unicode conversion). If one substitutes in the controls
CString(UnicodeString) instead of pure Unicode string, then ASCII
strins are represented correctly, but in place of cyrillics stand
a sequence of "?" (of correct length N).
So the question is: do there exists a way to compile the project
with _MBCS option (instead of _UNICODE -- which produces a big number of
error messages all over the code and I would not like to rewrite the whole
code) and to draw, nevertheless, the strings correctly inside WTL controls?
|
|
|
|
|
Windows doesn't use UTF-8 internally. 9x uses the ANSI code page, and NT uses UTF-16. Your choices are:
Do an MBCS build and convert from UTF-8 to the ANSI code page. This can lose data if the code page doesn't contain a character in the input. This is your only choice on 9x.
Do a Unicode build and convert from UTF-8 to UTF-16. You can then pass those strings to APIs and controls.
If you don't care about 9x support, doing a Unicode build is the way to go.
|
|
|
|
|
Thanks for Your kind answer!
Michael Dunn wrote: Your choices are:
Do an MBCS build and convert from UTF-8 to the ANSI code page. This can lose data if the code page doesn't contain a character in the input.
Well, this chice is bad for me: UTF8 strings extracted
from files can correspond to arbitrary ANSI code pages
or even to some mixture of them. I wonder only why
the choice of the "universal" code page CP_UTF8
has no effect on the visualization of strings in WTL controls.
Michael Dunn wrote: This is your only choice on 9x.
Eh, well. I'm not worried about 9x compatibility too much, if at all
Michael Dunn wrote: Do a Unicode build and convert from UTF-8 to UTF-16.
That's exactly what I've done yesterday. It took me not more
than 40 minutes to react on several dozens of compiler errors,
arising while compiling with _UNICODE,
replacing char*'s and ordinary string manipulation routines by their
"wide" versions. Now everything's great
|
|
|
|
|
Hello all,
I am making a simple ATL Project and in which i am adding a ATL Simple Object.
i have to register this object as word addin.
anybody have idea, how it is possible?
please share with me.
Thnaks
bankey
|
|
|
|
|
Hi,
I currently have a working BHO that receives several events fired from its browser through a SINK_MAP, but Im missing an event, an event fired from a change of focus. IE events ID contained in IWebBrowser2 dont seem to have an event for that. The closest thing I managed to extract form the Browser pointer was the window object which has window.blur and window.focus methods, and which events are usually handled in JavaScript. My question: can I handle these envents in C++ and if so whats the interface DIID and event that I want to look for.
|
|
|
|
|
How can ATL be used for non COM applications. What particular aspect of it is being contributed to the non COM application eg. a win32 app.
|
|
|
|
|
The windowing classes in ATL don't require COM. There is also WTL if you need a GUI library with more features.
|
|
|
|
|
What does the following code do?
PROCESS_INFORMATION procinfo;<br />
STARTUPINFO stinfo;<br />
<br />
if ( CreateProcess(NULL, chCmdLine, NULL, NULL, FALSE, 0, NULL, NULL, &stinfo, &procinfo) != 0)<br />
{<br />
ULONG i;<br />
while ( i=0, GetExitCodeThread(procinfo.hProcess, &i) && i == STILL_ACTIVE)<br />
{<br />
_sleep(1000);<br />
}<br />
}
|
|
|
|
|
[Edit]As Mike Dunn correctly says, STARTUPINFO isn't correctly initialised - edited the example code to initialise correctly [/Edit]
Starts a new process, then waits until it terminates - checking once per second.
It's not a great example of that sort of code - this is rather more idiomatic in Windows:
<font>PROCESS_INFORMATION procinfo;
STARTUPINFO stinfo = { sizeof(STARTUPINFO), 0 };
if ( CreateProcess(NULL, chCmdLine, NULL, NULL, FALSE, 0, NULL, NULL, &stinfo, &procinfo) != 0)
{
if (WaitForSingleObject(procinfo.hProcess, INFINITE) == WAIT_OBJECT_0)
{
ULONG i;
GetExitCodeThread(procinfo.hProcess, &i);
}
}</font>
Rather than polling, it uses a kernel wait.
Last modified: 11hrs 47mins after originally posted --
|
|
|
|
|
It passes garbage in the STARTUPINFO struct, so the CreateProcess() call may fail.
|
|
|
|
|
What is the simplest way to create a simple dialog in an ATL application? Should one use CAxDialog or WTL. Which one is used in what situations?
|
|
|
|
|
CDialogImpl and CAxDialogImpl are both ATL classes. CAxDialogImpl is used for dialogs that contain ActiveX controls.
|
|
|
|
|
Hi all,
Can anyone give me idea how i can implement a download progress bar. I want to create a new thread for downloading (which can work either blocking/nonblocking mode). It should be cancelable. More precisely i want to create a downloader notification class which i can use later also. i want to pass parameters (url, destination, blocking|nonblocking) and it will create a thread. Downloading a file is done, i just want to show the progress info.
I tried with CWindowImpl/CDialogImpl but failed.
any idea/suggesstion?
thanks in advance.
Arif
|
|
|
|
|
See URLDownloadToFile function does helpfuls?
|
|
|
|
|
Checking the function. thanks for your reply.
|
|
|
|
|
I think it will be solve your problem.;)
|
|
|
|
|