|
|
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?
|
|
|
|
|
KB320082 BUG: HTREEITEM May Cause TypeLoadException in a Managed C++ Application.
IMAGELIST is the same.
|
|
|
|
|
The ActiveX control created with ATL/WTL failed to be used in other develop tools, such as VB, PB. The system warning that "Failed to save the binary data of the object", I don't usderstand what it mean. do you know why?
|
|
|
|
|
The control probably failed to persist (or doesn't support persistance).
|
|
|
|
|
I thought the interface template IPersistStreamInitImpl had implemented the persistence. I overwirite the load and save methods, it is OK now!
Thanks a lot!
|
|
|
|
|
When used dynamicaly in a composite ActiveX control, the member funcion "create" of CDateTimePickerCtrl failed (the HWND returned is NULL).
Any advice will be appreciated, and Thak you in advance!
|
|
|
|
|
|
I have called InitCommonControls(), but create failed yet, do you have other advice,
thank you anyway!
|
|
|
|
|
Hi,
I had the same problem with the "cool" control ( comboBoxEx and DateTimePicker), I solve it in this way:
// ----
// Trying to register Combo box Ex
INITCOMMONCONTROLSEX iccex = { sizeof(INITCOMMONCONTROLSEX), ICC_USEREX_CLASSES };
InitCommonControlsEx(&iccex);
InitCommonControls(); // Obsolete remove if not necessary
// ----
It seems that InitCommonControlsEx works better
HTH
Braulio
|
|
|
|
|
Except do as you say, I have to copy the comctrl32.dll to the working derectory,
Thank you anyway!
|
|
|
|
|
Hi everyone,
First, I'd like to say that I'm new to both ATL and Shell Extension programming, and I'm running into a brick wall the last three day. I would like to ask for your expertise of the topic.
Currently, I'm working on a UI design of an ATL project. On one the UI, I have an embedded Window Explorer. Thanks a little trick from Matthijs Hollemans's Windows Explorer wildcard selection shell extension article, I was able to get the hold of the right-hand side window, which is a list view, of the embedded explorer. However, when I try to used the API function SHGetPathFromIDList trying to get the path of the list view item pidl (i.e: item.LPARAM), it always returns that path to the desktop. For example, if the selected file is C:\Test.txt, the API function would return C:\Documents and Settings\CurrentUserID\Desktop\Test.txt. It doesn't matter what directory you navigate to, the returned path is always the desktop. Two questions raised for me:
1. Is there a way to just query for the directory path of the embedded window explorer?
2. How and what are the steps do I need to take to resolved the extension issues in this specific scenario?
Thanks so much for your help
Here is the class I used to create the embedded Window Explorer
class CDirFileView : public CWindowImpl<cdirfileview, caxwindow="">
{
public:
DECLARE_WND_SUPERCLASS(NULL, CAxWindow::GetWndClassName())
BOOL PreTranslateMessage(MSG* pMsg)
{
if((pMsg->message < WM_KEYFIRST || pMsg->message > WM_KEYLAST) &&
(pMsg->message < WM_MOUSEFIRST || pMsg->message > WM_MOUSELAST))
return FALSE;
// give HTML page a chance to translate this message
return (BOOL)SendMessage(WM_FORWARDMSG, 0, (LPARAM)pMsg);
}
BEGIN_MSG_MAP(CDirFileView)
END_MSG_MAP()
// Handler prototypes (uncomment arguments if needed):
// LRESULT MessageHandler(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
// LRESULT CommandHandler(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
// LRESULT NotifyHandler(int /*idCtrl*/, LPNMHDR /*pnmh*/, BOOL& /*bHandled*/)
BOOL DestroyWindow()
{
return CWindowImpl<cdirfileview, caxwindow="">::DestroyWindow();
}
};
|
|
|
|
|
I have a non-MFC project using std::string that is compiled into a library (Confetti.lib). My main project is an MFC project that uses this library. I get the following linker errors:
msvcprtd.lib(MSVCP70D.dll) : error LNK2005: "public: __thiscall std::basic_string<char,...>::~basic_string<char,...>(void)" (??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ) already defined in Confetti.lib(ParticleSystem.obj)
msvcprtd.lib(MSVCP70D.dll) : error LNK2005: "public: __thiscall std::basic_string<char,...>::basic_string<char,...>(char const *)" (??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@PBD@Z) already defined in Confetti.lib(ParticleSystem.obj)
Can anyone tell me why this is happening and how to fix it?
Also, if I ignore msvcprtd.lib, then I get lots of dll import/export errors for std::basic_string.
|
|
|
|
|
What's your code generation for both? Multithreaded, singlethreaded, dll, etc?
Steve S
|
|
|
|
|