|
Can I retrieve a pointer to the listbox of a combobox in CBS_DROPDOWNLIST style?
I'd like to change the dropped rect, but unfortunately there is no SetDroppedRect().
The thing is that the strings in the list are to long to display fully onto the screen. Therefore I am obliged to use the horizontal scrollbar. The problem is that the vertical height of the dropped list is adjusted to the count of items, when the total item-height is smaller than the created combobox height.
In case of 1 item (very large string) the horizontal scroll bar is invisible.
In case of 2 items the second item is covered by the scroll bar. This does not look nice!! It seems that the height of the horizontal scroll bar is not taken into account during the making of the Dropped list box.
Does anyone have a solution like retrieving a pointer to the listbox to adjust height. All help is welcome.
Toon Schellinck
|
|
|
|
|
Hi !
I'm wondering how a bool type is supposed to work regarding boolean operations :
If I do this :
bool a=true;
bool b=false;
b&=a;
It is working, but is it a coincidence (because & is a bitwise operation) ? Or am I supposed to do :
b&&=a;
or
b=b && a;
????
What do you think ?
Jerome
|
|
|
|
|
Jerome Conus wrote:
...because & is a bitwise operation) ?
And a bool type has 8 bits!
What exactly are you trying to accomplish?
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
Hi guys,
I would like to know how to extract the differents formats provided in an icon?
ExtractIconEx just extract the icon but you have no control on its formats. I want for example to extract the 16x16 256Colors format of a given icon (if such format is defined in the icon). How to do that? Can any body show me the sample code for doing this? Icon editors can do this, so I guess there is a trick for that!
Thanks.
Bouli.
|
|
|
|
|
|
Thanks, it's helpfull...
I thought it was easier for doing this, but the code is awfull... I'm going to study this sample.
thanks again
bouli.
|
|
|
|
|
My pleasure
And all the girlies say I'm pretty fly for a white guy
|
|
|
|
|
hello,
i have prepared a software.i m in windows 2000 professional ...the executable file is here. how do i install in another machine remotely .the remote m/c is either windows2000 or win 98/95 ???
if anybody have code (in C++,VC++,MFC,win32) or links please inform.
please suggest some function (win32) to do that.
skpanda
|
|
|
|
|
If the file is a single executable, one option is just to copy it over. If you need to make registry settings (like add your program to start-up or save it's settings during the installation), then perhaps you could utilize a Remote Desktop connection ?
Otherwise I think the best solution would be to just walk over and install the program manually. Network installations are always tricky, mostly due to firewalls and other protection schemes. No matter the mechanism, the target computer's owner should be allowed to decide whether to install the program or not.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
I am trying to get handle of Edit box of Login Window of Yahoo. FindWindowEx is failing.
if(strcmpi(ClassName,"YahooBuddyMain")==0)
{ HWND hwndChildAfter,hChild;
HWND hYahooLogin = FindWindow("#32770","Login");
hChild = FindWindowEx(
hWndYahoo, // handle to parent window
hYahooLogin, // handle to a child window
"EDIT", // pointer to class name
NULL // pointer to window name
);
}
Cheers!!!!!!!!
Siddharth
|
|
|
|
|
Where are you writing this code ?
in the HOOK Handler ?
Then it is possible that the login dialog is not created Yet .
Instead Wait for the creation of
#32770 (Dialog)
if you find one then check whether its parent is YahooBuddyMain
Hope it Helps
Live as if your were to die tomorrow. Learn as if you were to live forever.
-Mahatma Gandhi
|
|
|
|
|
Perfect. Mission accompalished. Thanx a lot frm bottom of my heart.
Cheers!!!
Siddharth
|
|
|
|
|
My pal had created a property sheet and added few pages to it. Well every thing works fine and so on.
There are three buttons Ok, Cancel & Apply. my problem is that these buttons dont have short cut keys,
so my question is how do i set a shortcut keys to those buttons.
I Touched Osama Bin Ladens Bushy Beard
|
|
|
|
|
I've been considering purchasing the VS NET but i have a couple of questions before i commit.
1. Am I missing out if I don't purchase VS NET particularily if I program in C++ (MFC/ATL/WTL) as opposed to C++ in VS 6.0?
2. Is there a difference between VC++ NET Standard and the professional version when it comes to MFC/ATL/WTL programming?
I would greatly appreciate any advice.
|
|
|
|
|
Perhaps I can offer some answers..
As for the first question, the VS .NET version, especially the 2003 which I have, offer a much more flexible and working integration systems that simplify coding quite much. For example, the clumsy ClassWizard has been removed, and instead, every MFC class is considered a standard C++ class, and there is a 'properties' bar for it from which you can override virtual functions, create Windows message and event maps and so on. Generally speaking, my coding time has improved some and I can now focus more on the content itself as I don't need to worry about buggy CW files or missing virtual functions, which was a common error during the VS 6.0 times. I was constantly deleting and remaking the CW files.
Also, the VS .NET is much more flexible. The Class Bar has improved a lot, making it possible to e.x. add your own classes to the list of MFC base classes. Like, if you were to derive a custom control and would like to derive again from this control, you can move the files in question to a special directory, and then you can create descendants, override virtual functions and do custom implementation easily by using the Class View and it's properties-page.
For the second question, no, not really. The MFC/ATL/WTL libraries shipped with either the Standard or Professional editons are the same, version 7. The biggest source of differencies comes from the functionality of the IDE and the optimization/customization options of the compiler/linker. The Professional version compiler, for example, is capable of doing much greater level of optimization routines and compile-time code manipulation than the Standard version one.
As a final note, if you have enough money to invest, I suggest you go for the Professional, or even better, the Architect version. You can read more about the differences between seperate versions from the VS .NET homepage located in here[^].
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Hi,
Does any one know what is a TBCD ( Telephonic Binary Coded Decimal ) field, and how we can decode it. I have a TBCD field of length 5 in a binary file, and would like to decrypt it.
Best Regards
Jagadeesh
"A robust program is resistant to errors -- it either works correctly, or it does not work at all; whereas a fault tolerant program must actually recover from errors."
|
|
|
|
|
Hello guys,
I have just moved into W32's serial communication, it is to be written to talk to a printer device via standard RS232. I have used basic functions such as CreateFile(), ReadFile() and WriteFile(). It all seems to be straight-forward when the communication will always be firstly WriteFile() to the device and then expect getting a response using ReadFile(). The tranmission from the device will always end with an EOT (0x04) so I'd use while loop on the ReadFile() until the EOT is received. By doing this, I somehow need a 'timeout' implementation within (say the loop breaks and gives an timeout error message after 3 seconds) otherwise it is possible the loop goes forever...Now the problem is I could not think of a way to go about inserting a timeout. Could it be done using SetTimer() etc?
BTW, I have placed the whole serial communication stuff in a separate worker thread so it does not interrupt the front GUI.
Can anyone help me with this?
Would be very much appreciated.
Thanks
|
|
|
|
|
You could, for example, create a global-level boolean variable, if you're not using classes. Then create a timer for the thread, and in the thread's message processing function, handle the WM_TIMER event. When the timer event is launched, the boolean is set to TRUE, which causes the while loop to exit.
Another option would be to use the Sleep function. This function will cause a thread to suspend until the time is elapsed, then continue the program execution from the next line of code. You could create a local variable, say an integer, which would go from 0 to 3, and during each while-loop iteration, the port is tested, then the thread sleeps for 1 second and increases the integer. The while-loop will automatically exit after 3 seconds.
The latter implementation only attempts to read the port at 1 second intervals, so it is not entirely reliable. If you need a more reliable system, decrease the sleep time and increase the iteration amount. An amount of going from 0...100 would already offer you the possibility to check the port at 30 ms intervals, if you aim for a 3 second time-out.
The advantage of the sleep function is the lack of the timer: there will be no extra message-processing needed. Know, however, that during the sleep time, the thread will not process any messages at all.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Antti Keskinen wrote:
Another option would be to use the Sleep function.
Thnaks for the suggestions, Antti.
the sleep function came upon my head as well but I am not entirely sure if the function works in multi-threaded application? But from your answer, it looks like if the sleep is placed in the thread process call, it then will only suspend the thread process, not entire program, correct? In addition, I could not seem to locate sleep() or usleep() functions in my MFC apps? they give me undeclared identifier.
Finally, it is not really Visual C++ related. But how do I test my serial comm program is working using only the PC? Should I be able to see the sending string on HyperTerminal, if the program WriteFile() to the specified port (given it's done correctly)?
Thanks again
|
|
|
|
|
According to the MSDN reference:
The Sleep function suspends the execution of the current thread for at least the specified interval.
So, yes, it works in a multi-threaded application: it suspends the execution of the thread from which it is called. As for the reason of why you were unable to call the function from your programs: make sure you are calling the function Sleep() , not sleep() . The first one exists, the latter one doesn't. You must also include windows.h header file and link with Kernel32.lib library.
The serial ports are connectionless: they do not care to where they are connected, as long as a connection exists and the software using the communications configures the ports correctly. So, I believe the most easiest way is to utilize two serial ports. Most computers nowadays have two serial ports. Just obtain a cross-connected serial link cable (or do one yourself), then interconnect two of your computer's serial ports. Make your comms program write to the first port, and put some terminal program, e.x. HyperTerminal, to listen on the receiving end. Just remember to set the terminal program's port attributes correctly, otherwise you might get no results at all.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Thank you again Antti,
they are the perfect answers. Really appreciated.
|
|
|
|
|
Use Mutex object.Although it is bit heavy interms of speed. But it is reliable and U will have control on it
|
|
|
|
|
Thanks SiddharthAtw,
I will have a look that as well.
|
|
|
|
|
How return the system menu ID when chlick and select "move" or "Size" or "Close" of the system menu?Please write some code for me, thanks!!
|
|
|
|
|
Look for WM_SYSCOMMAND , SC_MOVE , SC_SIZE , and SC_CLOSE .
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|