|
Are there any rules for notification messages of custom controls?
(i.e. for windows messages, there is "use WM_USER..WM_APP-1 for custom control specific messages, and WMAPP... for applciation-specific stuff". Is there something similar for Notification codes?)
I'd like to use "normal" WM_NOTIFY messages with custom notification codes, if that's an option.
Flirt harder, I'm a coder.
mlog || Agile Programming | doxygen
|
|
|
|
|
Hi Everyone!
I'm running WinXP and I have made a project in Win32 C++.
The problem is when I subclass a control(any control).
(In windows 98 I don't have this problem)
My subclass code is :
// IDC_NUM edit control ID
WNDPROC OldEditControl; // as a global
OldEditControl = (WNDPROC)SetWindowLong(GetDlgItem(hwnd, IDC_NUM), GWL_WNDPROC, (LONG)EditProc);
and the EditProc is :
LRESULT APIENTRY EditProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
// My messages
return (LRESULT)CallWindowProc(OldEditControl, hwnd, msg, wParam, lParam);
}
the compiler shows me this warning messages:
warning C4311: 'type cast' : pointer truncation from 'LRESULT (__stdcall *)(HWND,UINT,WPARAM,LPARAM)' to 'LONG'
warning C4312: 'type cast' : conversion from 'LONG' to 'WNDPROC' of greater size
What's wrong?
|
|
|
|
|
Dennis L wrote:
WNDPROC OldEditControl; // as a global
OldEditControl = (WNDPROC)SetWindowLong(GetDlgItem(hwnd, IDC_NUM), GWL_WNDPROC, (LONG)EditProc);
It seems you are doing funny things with the return value of the window-function. MSDN has the following information about SetWindowLong s return value:
<br />
If the function succeeds, the return value is the previous value of the specified 32-bit integer.<br />
<br />
If the function fails, the return value is zero. To get extended error information, call GetLastError. <br />
<br />
If the previous value of the specified 32-bit integer is zero, and the function succeeds, the return value is zero, but the function does not clear the last error information. This makes it difficult to determine success or failure. To deal with this, you should clear the last error information by calling SetLastError(0) before calling SetWindowLong. Then, function failure will be indicated by a return value of zero and a GetLastError result that is nonzero.
It simply is no WNDPROC value.
Who is 'General Failure'? And why is he reading my harddisk?!?
|
|
|
|
|
I'm getting this error in VC++ .Net 2003 in a project upgraded from VC++ 6:
LINK : fatal error LNK1104: cannot open file "msvcirtd.lib"
Anyone know how to fix this? I've found the VC++ 6 version of msvcirtd.lib, but it seems not to exist for VC++ .Net.
|
|
|
|
|
Rich edit control automatically break the line when the limit of maximum characters in a single line is reached. As such any new character is typed goes to next line. All this happens automatically if the multiline option is enabled.
I like to subclass the line break event of the control to add my custom feature. Which message is passed to the cotrol when it breaks line ? How to subclass it ?
|
|
|
|
|
You need to install a new EDITWORDBREAKPROC. To do this create your proc then send the EM_SETWORDBREAKPROC message to the rich edit control.
See MSDN example
'--8<------------------------
Ex Datis:
Duncan Jones
Merrion Computing Ltd
|
|
|
|
|
Hi
Is there any function in richeditctrl that i can use for adding a string as a line and then automatically next string in the next line and so on? I've used replacesel but i soesn't seem to work.
WBR
Edi
|
|
|
|
|
I use the ReplaceSel() method to add "lines" to a rich edit control. It works fine as long as nothing is already selected. Perhaps you could provide a code snippet of that which does not work.
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
Hi
I know embedded Visual C++ compiler do not accept return statements in this __try and __finally. but i need to return different conditions(values) at different parts of the __try / __finally block, how shall i go about doing it?
Need this help urgently.
Thanx
|
|
|
|
|
You should use the C++ RTTI.
These old SEH is residual waste from a time when there was no support for RTTI in the VC++ compiler.
Who is 'General Failure'? And why is he reading my harddisk?!?
|
|
|
|
|
Structured exception handling and and C++ exception handling are two totally different things and are solutions to two different problems. RTTI is something else all together.
In a C++ program try/catch is the way to go unless you are trying to catch OS exceptions such as access violations. For those cases you can use __try or use one of the many wrappers that will convert an SE to a C++ exception.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Yes, my fault. RTTI has nothing to do with exceptions. It is switched on the same page of the VC6 configuration dialogues, though.
What you said and I meant is written in MSDN as follows:
For C++ programs, it is recommended that you use the new C++ exception-handling mechanism
(try, catch, and throw statements).
Who is 'General Failure'? And why is he reading my harddisk?!?
|
|
|
|
|
Sorry, just to add in, i am using on embedded Visual C++, so that is why only __try and __except and __finally i can use.unless is using version 4, then i can use try and catch.. but that will have to recompile for a new window CE OS.
i can do without __finally, then i can use return statement; but since __finally is a cleanup code, so i thought can use...make the codes cleaner also.
so any suggestions?
what is RTTI actually?
|
|
|
|
|
IceBerG71 wrote:
what is RTTI actually?
Run Time Type Information.
It is the standard conformant way of determining a type at runtime.
The same is done in MFC with things like IsKindOf() , but with this approach all objects need to have the same base class (CObject ).
Who is 'General Failure'? And why is he reading my harddisk?!?
|
|
|
|
|
hi
i want the code about reading data from the modem actually i want to save the web page that a user is requesting on the LAN while i am on the proxy server how can i save that very page by all the information going to the user through the proxy server
tell me as soon as possible
regards
|
|
|
|
|
How to detect a new device was installed ? (What message/event?)
Basicly I've got an app that uses webcam(s).
When they unplug, I get a nice event that the device is unplugged.
But how can I detect that a (usb) device is being connected ?
I assume there's a windows-message indicating a new device connection,
but I don't have a clue where to find documentation about this.
(MSDN isn't always as clear as you'd like it to be )
Ciao,
Led
|
|
|
|
|
WM_DEVICECHANGE.
Tech.Support : Mam, is your pc running under windows?
Customer : No actually its close to the main door.
|
|
|
|
|
Thanks, exactly what I was looking for.
After 35 minutes I couldn't find anything,
and while you posted I found it myself.
Stupid me....
|
|
|
|
|
Hello all,
i'm developing a progarm which able to update the removable drive (disk size, etc..) information after some checking. Any suggestion of how to do it?? what should i look at first??
Thanks!!
|
|
|
|
|
Hi!
I have a small problem. I am using the win32 api and I am trying to create a database application with ado.
I am using the Filter to search some keyword in my dabase and it works fine. But how can the databse notify me when there is no match for that keyword?
Thank you very much for your future answers!
Well... I am a beginner ...
|
|
|
|
|
No Question...
Just Testing The Length Of The Subject.
|
|
|
|
|
t'es pas relou toi ;P
TOXCCT
|
|
|
|
|
Hi all. Do anyone know how to open two windows as soon as I open my application? One window is used to display some output during the running of the application and the other window is used for the user to open some image file. Does anyone know how to do this? Thank you.
|
|
|
|
|
Hi...
-----
If I understand your question (which I dont).
If you want your app to be with multi windows.
(*in you example 2 windows*)
You can call twice "CreateWindow(...)"
but then you use the same winproc
or
You can register 2 difrent classes for 2 diffrent window procs
and call "CreateWindow(...)" twice also,
but ONE for each registered class
=-=-=-=-=-=
The-Server
|
|
|
|
|
HI. Thank you for your reply. What I mean is that when I open my application, it will display two blank child windows (frames) instead of the usual one. Hope this is more clear.
|
|
|
|