|
Shog9 wrote:
The toolbar control is a single window. There are (by default) no child controls created. What look like buttons are drawn (and the behavior controlled) by the toolbar control itself - no relation to pushbuttons, radiobuttons, etc
This is what I was looking for. That explains everything.
Shog9 wrote:
I'm gonna caution you from the outset
Thanks for the advice. Now that you mention this, I seem to remember hearing this, or something similiar in the past.
Thanks for you help.
Tim
|
|
|
|
|
Hi everybody. This is the most frustrating issue I've ever come across since I'm working with Visual C++. I made this DLL and I'm trying to send a WM_SETTEXT message from it to a VB application but the VB Application never receives the message!! If I send WM_SETTEXT from another VB application to my main VB application, it works. If I send WM_SETTEXT from the application itself to it, it works. I subclassed the window of the VB application so that I can take a look at all messages that go through.
If I send WM_USER from VC++ to VB, it works. If I send WM_SETTEXT from VC++ to VB, it doesn't. What COULD BE GOING ON THERE??????????? I'm totally confused and I don't understand why such a simple thing doesn't work! I tried all sorts of variants but NOTHING works!!!!!
SendMessage(hwndToTheSubclassedVBWindow, WM_SETTEXT, NULL, *"Annoying\0");
SendMessage(hwndToTheSubclassedVBWindow, WM_SETTEXT, NULL, *"Annoying");
<br />
char *c = "";<br />
c = (char*)malloc(256);<br />
c = "This is annoying";<br />
SendMessage(hwndToTheSubclassedVBWindow, WM_SETTEXT, NULL, *c);<br />
Before you say anything. The hwndToTheSubclassedVBWindow is CORRECT. I checked it 100 times.
WM_SETTEXT annoyance table:
same VB -> VB -> works
other VB -> VB -> works
C++ -> VB -> doesn't work
WM_USER annoyance table:
same VB -> VB -> works
other VB -> VB -> works
C++ -> VB -> -> works
Now. If *ANYBODY* has a clue about this, he/she has a gold medal from me! 'Cause I asked in other 2 or 3 forums and nobody knows anything.
-= E C H Y S T T A S =-
The Greater Mind Balance
|
|
|
|
|
Axonn Echysttas wrote:
...but the VB Application never receives the message!!
How are you verifying this?
Axonn Echysttas wrote:
char *c = "";
c = (char*)malloc(256);
c = "This is annoying";
SendMessage(hwndToTheSubclassedVBWindow, WM_SETTEXT, NULL, *c);
How about:
char *c = (char *) malloc(256);
strcpy(c, "This is annoying");
SendMessage(hwndToTheSubclassedVBWindow, WM_SETTEXT, NULL, (LPARAM) c);
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Hi David. First things first: I was verifying using my using my own WindowProc that I subclassed from the VB Application. The VB Application had in its own code in a module my WindowProc and I had a message box there to notify me when I get WM_SETTEXT messages. ALSO, I used Spy++ as a last line of defense in case my code was wrong. But my code was ok.
Second things second:
*SHOCKED*
*laugh*
*applause*
You did it!! : D. I can't beleive it!!! You did it! I knew it! This WAS a VC++ issue.
I am sorry, but I am still a beginner in VC++. I jumped directly in Hooking, subclassing instead of starting with the basics. David, you really deserve a gold medal, thanks a lot. This was a huge issue. Now I'm one more step closer to success. Remember me : D. I'll soon finish my freeware software and you'll be in the "thanks to" list, like all the other people from the Code Project and other places that helped me.
I'm very happy that this issue is fixed, but still... WHAT *WAS* my mistake?? Why didn't the messasge get sent?? Was it because I didn't cast to LPARAM? Was it because I... can you explain how you fixed this so easily?
Thanks you VERY much! Wow am I happy to get this out of my hair or what! Pfiu! This issue killed my day and my last night.
Axonn out, going to sleep, it's late and tomorrow I gotta keep pushing ahead. I gotta go to work and when I'll be back home I'll keep working at my freeware soft : D. I can't wait to finish it so I can present it to all you people. This is the first internet place where I'll make it public : ).
-= E C H Y S T T A S =-
The Greater Mind Balance
|
|
|
|
|
Axonn Echysttas wrote:
Was it because I didn't cast to LPARAM?
Yep. The message was expecting the address of a string. You were passing the value of the first character of the string. These are not the same.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Now I understand why sometimes when I was sending a WM_USER message with some text parameters, in Visual Basic I grabbed an "84" from those parameters. Probably it sent the ASCII code of the first leter in the string.
Hm. Well, don't worry. I learned a lot these past two days.
Thanks a lot to all of you : ). I may finally continue work.
-= E C H Y S T T A S =-
The Greater Mind Balance
|
|
|
|
|
I want to create a bitmap that has text on it. The text will be different everytime the program is executed. The bitmap will then be set as the wallpaper in Windows. I am working with Visual C++ 6. I have found various guides online but none of them seem to work for me. I've been playing around with CBitmaps, GDI, and DCs but I have become completely lost. Can anyone show me a complete example of how to put text into a bitmap and save it?
|
|
|
|
|
See if this article helps.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
This is very helpful but where did u get the value of pDC from?
|
|
|
|
|
It's passed to the view's OnDraw() method.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
I want to take the real part from a decimal number for example if i have 3,13 take only the 3. I remenber that there is something to do it but i dont remenber yet Thanks
|
|
|
|
|
#include <math.h>
int nFloor = (int)floor(3.13);
Pssst. You see that little light on your monitor? That's actually a government installed spy camera. Smile and wave to big brother!
|
|
|
|
|
Try:
double d = 3.13;
int n = d;
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Of course at this point you should have already realized that what you want is not the "real" part of a number but the integer...
someone suggested
double d = 3.13;
int n = d;
this will actually produce a warning regarding possible loss of data. Try instead
double d = 3.13;<br />
int n = int(d);
|
|
|
|
|
From MSDN:
double modf(
double x,
double *intptr
);
Splits a floating-point value into fractional and integer parts.
This function returns the signed fractional portion of x. There is no error return.
x : Floating-point value.
intptr : Pointer to stored integer portion.
The modf function breaks down the floating-point value x into fractional and integer parts, each of which has the same sign as x. The signed fractional portion of x is returned. The integer portion is stored as a floating-point value at intptr.
...cmk
Save the whales - collect the whole set
|
|
|
|
|
Hi
I am trying to develop a new CButton sub-class that has the following behaviour:
- when the user clicks and holds the button, and event is fired
- when the user releases the button, another, different event fires.
In other words, I want to know when they press (and hold) the button and I want to know when they release the button.
With CButton, I only get 1 event: a WM_COMMAND when the button is released.
Any help would be appreciated. Thanks.
Tim
|
|
|
|
|
See here and here for examples.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
thanks very much for your quick reply. That should be enough information.
|
|
|
|
|
What is the difference between CSocket and WinSock.
Be FaithFull To Your Work.
|
|
|
|
|
42, of course.
(Smells like homework).
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
The latter is an API, while the former is a class that encapsulates this API.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Hello All,
I have been working on a DLL (Regular DLL with MFC statically linked) that contains a CDialog that I would like to run as modeless. In order to reset the CWinApp's ref to the Dialog to NULL when the Dialog closes, I am trying to store a pointer to the CWinApp so that I can m_pApp->setMyDlgNull(). It seems as if this should work, but whenever I try to add the pointer into my CDialog class, the compiler acts like it does not know what my CDLLApp is. I am not sure what is going on as I have #included my CWinApp's header and I can get the popup with my setMyDlgNull() function when using CDLLApp:: (does not happen when i do not #include).
I am sure that I have made the most idiotic mistake so go easy on me
|
|
|
|
|
Can anyone tell me if MSDN .NET 2003 is available for download? I remember a 4 Gbyte DVD version was available a few months back, but I was hoping that I could get something that I can put on normal CDs because I do not have a DVD in my computer. I ran a few searches online but I cannot find anything. I am just wondering if it is available at all?
// Afterall, I realized that even my comment lines have bugs
If the sun were to blow up, it would take us 7-8 minutes to realize it.
|
|
|
|
|
|
Thank you for the ingenious idea. Have you applied for the Nobel Prize recently in the area of critical thinking? If you haven’t please don’t let you ingenuity go to such a waste.
// Afterall, I realized that even my comment lines have bugs
If the sun were to blow up, it would take us 7-8 minutes to realize it.
|
|
|
|