|
|
I downloaded and installed WTL70.exe from Microsoft. I did a search on my HD afterwards, no atltypes.h.
|
|
|
|
|
No, not a WTL file, an ATL file, ie it comes with VC++.NET
It's in the vc7/atlmfc/include folder.
Steve S
|
|
|
|
|
|
i am using the machine generated Code for the MS Command button (ActiveX).
When developing under WinNT4.0 there was no problem in Setting the Picture Path in the Properties to a BMP File and é voila, the dialog showed up with a bitmap button.
Now i am developing under Win2k, and everytime the dialog with the buttons intialises, the code crashes. Without the Bitmaps it works perfectly. Checking the Source i would manually load the bitmaps to the buttons (hoping that this might work).. i would like to load bitmaps from an Resource ID.
My Problem right now is that it needs an IDispatch*. I guess that i need a CPicture Object (casting it to an IDispatch*), but i can't find any constructor which would take an id, or a CBitmap or sthing like that.
Can anybody help?
Thanks in advance,
Bernhard
"I'm from the South Bronx, and I don't care what you say: those cows look dangerous." U.S. Secretary of State Colin Powell at George Bush's ranch in Texas
|
|
|
|
|
See my article "PixView". You may be able to use some of the code I have in the pix.h header for the second part of your problem.
|
|
|
|
|
thanks.. this really helped.. never knew about the CPictureHolder Class.
"I'm from the South Bronx, and I don't care what you say: those cows look dangerous." U.S. Secretary of State Colin Powell at George Bush's ranch in Texas
|
|
|
|
|
Is the following safe?
{<br />
map<CComBSTR, CComBSTR> mp;<br />
<br />
{<br />
CComBSTR& bstrNew = mp[L"1"];<br />
bstrNew = "Hello";<br />
}<br />
<br />
wprintf(mp[L"1"]);<br />
}
Will bstrNew get destroyed, thus invalidating the "Hello" string?
Jeremy Pullicino
C++ Developer
Homepage
|
|
|
|
|
Yes, this is safe. A reference is an alias for an object that exists elsewhere - in the map, in this case. When a reference goes out of scope, the referenced object still exists and no destructor call is made. In this respect, references work like pointers.
Brad
|
|
|
|
|
Jeremy Pullicino wrote:
map<CComBSTR, CComBSTR> mp;
I'd be careful, mixing non standard-library components with standard components could be dangerous. If you can afford to convert and store std::string's / std::wstring's, or boost::shared_ptr's to BSTR's prefer that to using the microsoft wrappers.
From MSDN
CComBSTR::operator &
BSTR* operator &( );
Modern C++ Design (7.6) - Alexandrescu
"Overloading unary operator& makes the Smart Pointer unusable with STL containers."
He then goes on to suggest never overloading operator& for components that are going to be used generically.
If you can keep you head when all about you
Are losing theirs and blaming it on you;
If you can dream - and not make dreams your master;
If you can think - and not make thoughts you aim;
Yours is the Earth and everything that's in it.
Rudyard Kipling
|
|
|
|
|
|
Cool, thanks mike didn't even know it existed.
When did this get added? for .NET
If you can keep you head when all about you
Are losing theirs and blaming it on you;
If you can dream - and not make dreams your master;
If you can think - and not make thoughts you aim;
Yours is the Earth and everything that's in it.
Rudyard Kipling
|
|
|
|
|
|
How to resize the client rect of the control when designing?
The sample from the msdv is so complex that I can not understand, Thank you for the hlep!
|
|
|
|
|
I've been writing a DHTML control and have noticed it flickers a lot when resized with 'Show window contents while moving/resizing' on.
This happens even with the unmodified wizard-generated DHTML control (using vs.net, add atl control, dhtml control). The control works by using CAxWindow as an activex container window and creating a control (IWebBrowser2) inside it. For an example, create the dhtml control with the wizard, compile, then drop the control onto a form in vb/c# and make it fill the form. Then compile that and resize it.
Although I've read up a bunch about flicker, I'm not quite sure how I'm supposed to extend or modify CAxWindow to remove this flickering. Any ideas?
|
|
|
|
|
I think this is an issue with the DHTML control (MSHTML). I see the same problem in an app I'm working on which uses CHtmlView.
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|
|
not too sure about the WebBrowser activex control, but if you're using CWindow or it's classes, the following can help...
Insert a message handler as follows
MESSAGE_HANDLER(WM_ERASEBKGND, OnEraseBackground)
then implement the handler...
<br />
LRESULT OnEraseBackground(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)<br />
{<br />
return 1;<br />
}<br />
Ryan
|
|
|
|
|
Can't Register atl com in chinese(unicode) path!
How Can I do it?
ZHANGYIFEI
|
|
|
|
|
I remember I saw this problem back on the NAV team. Somewhere in the ATL registration code, some code walks the filename and there is a ++ instead of CharNext() , which breaks when it encounters DBCS characters. Sorry I can't be more specific than that.
--Mike--
Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber
Ericahist updated (again) Sep 6!
|
|
|
|
|
I have a program which works on an open process. I need a way to spot if the process the program is working on has terminated. So I setup a CWorkerThread and use AddHandle() with the handle of the open process. When the handle becomes signaled, I send a message to the main window of my app.
So what's the problem?
When the process terminates and the Execute() method fires, I have to remove the process handle from the thread or it will keep firing messages to the main window. But when I use RemoveHandle(), the thread blocks on the Refresh() method.
Why this is happening? Any suggestions on how to fix it?
Thanks.
|
|
|
|
|
Hi,
I did that using MFC, just create a Worker thread and the process and waitforsingle/multiple objects, I can try to find the source code , here you have one sample that I got from the net ( I remember I did something similar):
<br />
void main( VOID )<br />
{<br />
STARTUPINFO si;<br />
PROCESS_INFORMATION pi;<br />
<br />
ZeroMemory( &si, sizeof(si) );<br />
si.cb = sizeof(si);<br />
ZeroMemory( &pi, sizeof(pi) );<br />
<br />
if( !CreateProcess( NULL,
"MyChildProcess",
NULL,
NULL,
FALSE,
0,
NULL,
NULL,
&si,
&pi )
) <br />
{<br />
ErrorExit( "CreateProcess failed." );<br />
}<br />
<br />
WaitForSingleObject( pi.hProcess, INFINITE );<br />
<br />
CloseHandle( pi.hProcess );<br />
CloseHandle( pi.hThread );<br />
}<br />
HTH
Braulio
|
|
|
|
|
Hi, all:
I have a weird problem and need your help. I have a main app and DLL. In the main app I have my object pointer (CMyObj* pObj) that has method like:
HRESULT TranslateIDToName( long lID, LPSTR cBuff, UNIT dwBuffSize );
this TranslateIDToName then calls some methods in DLL.
In main, I have something like this:
const DWORD dwBuffSize = 128;
TCHAR cBuff[dwBuffSize];
pObj->TranslateIDToName( lID, cBuff, dwBuffSize );
When I compile both main app and DLL in RELEASE, (both uses Multithreaded DLL as Runtime DLL ). It works fine! However, if I compile both in Debug ( both uses Debug Multithreaded DLL ), I step through the code, The TranslateIDToName() fills up the cBuff correctly and then return from the function.
The problem comes when the function returns to the caller:
pObj->TranslateIDToName( lID, cBuff, dwBuffSize );
The pObj is trashed with either garbage in the pObj or pObj = NULL. In either case, the pObj address changes before calling the method and right after return from the method ( the Stack really messed up!!). Of course, the app crashes!
I tried all the stuff I can think of, and no more ideas about what could be wrong.
Any suggestion and help will be highly appreciated. Thanks in advance.
Dion
|
|
|
|
|
Are you sure the right DLL is being used? I mean, look in the working directory of the program, system directory etc. for your DLL, maybe by the DLL lookup rules a different version than you intended is being loaded.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I got the problem fixed. the problem is the array index out of range inside the function. thanks anyway.
|
|
|
|
|
Throw exception when start:
TypeLoadExeption: Can't find type: _IMAGELIST from assembly.....
Why?
|
|
|
|