|
Hi,
Actually the data received from the server is not fixed and is dynamic.
Can you give me any code of using a CprogresCtrl
|
|
|
|
|
what does the handle types exactly means...
|
|
|
|
|
it is a unique identifier for an object that the OS can manage/handle... hence its name
|
|
|
|
|
Reference : MSDN web pages
The [handle] attribute specifies a user-defined or "customized" handle type.
User-defined handles permit developers to design handles that are meaningful to the application. A user-defined handle can only be defined in a type declaration, not in a function declarator.
A parameter of a type defined by the [handle] attribute is used to determine the binding for the call and is transmitted to the called procedure.
|
|
|
|
|
manju23reddy wrote: what does the handle types exactly means...
A handle only makes sense to the module that created the handle.
Any client must not interpret the value of the handle, it's only use is to identify something that the library is operating on.
This is not specific to MFC or any other framework/library.
The data type HANDLE is usually a typedef'ed void* , which means that it is as wide as the processor architecture it executes in. An explicit type cast can be made inside the library without losing precision or bits to e.g. int .
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Windows OS keeps track of resorces (Menus/windows) by giving them a unique number this numer is called a handle. to play with any resourse u need to refer that handel just like to post a latter u need an address.
|
|
|
|
|
You already got couple of good explanations about handle. As an add-on information, have a look at this article - Give Me a Handle, and I'll Show You an Object[^]. It will give you more info about handles.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Hi,
I have created the setup package using Inno Setup.But i need to install a driver before the exe file execution. Is it possible?
Thanks & Regards
Anitha
|
|
|
|
|
What do you mean by "install a driver"? Is there a separate installer for the driver? You may execute it from within your setup then. Inno supports registering type libraries, DLLs, and OCX files, allows you to create registry entries and shortcuts, etc.,
What exactly is your need? A little more clarity, may be?
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
Inno Setup does not include a driver installation feature.
If the driver includes its own installer, you can run that from within your Inno Setup install using the Exec() function in script.
If the driver doesn't include its own installer, you will need to write a DLL that uses the Setup API to install your driver.
|
|
|
|
|
Hello everyone,
Just two bacis questions about how to program in an elegant way.
1. About string.find, whether using string::npos or -1 to check no match find is more elegant?
2. About string.substr, whether checking return value is null or not is an elegant way to know if substr method is successful?
thanks in advance,
George
|
|
|
|
|
1. About string.find, it would be elegant to use string::npos instead of -1.
2. About string.substr, Actually it return basic_string and this class has a function called empty which returns true if the string object contains no characters; false if it has at least one character. I guess this would be good practice.
Regards,
Pankaj Sachdeva
There is no future lies in any job but future lies in the person who holds the job
|
|
|
|
|
Thanks Karismatic,
1.
Karismatic wrote: 1. About string.find, it would be elegant to use string::npos instead of -1.
Why? More words please?
2.
I have performed more experiments, is it more correct to handle out of range exception? I found if the parameter is not legal, out of range exception will be thrown. I am surprised why each possible exception from substr method is not documented in MSDN?
regards,
George
|
|
|
|
|
"Elegance" has nothing to do with your questions. You need a choice between several syntactically correct choices before you can start thinking about coding "elegance".
1. string::npos is correct, -1 is wrong.
2. string::substr throws an exception if it fails. It will never return NULL (assuming your STL implementation isn't broken).
|
|
|
|
|
Thanks markkuk,
1.
Why -1 is wrong? From definition it should be the same as npos, any comments?
2.
About the exception, I am surprised why each possible exception from substr method is not documented in MSDN? Where could we find what exceptions will be thrown in a specific STL method?
regards,
George
|
|
|
|
|
Good afternoon!
lets assume that my computer has following ports
COM1, COM2, ....COM11, COM12, .. COM20.
now i have connected a Pendrive in COM1, a Printer in COM11.
so how can i get list of all other free ports such as COM2,COM3 ...Com10
COM12, COM13...COM20 programmatically?
|
|
|
|
|
You can find it here[^]">
Regards,
Rane
|
|
|
|
|
Can u please suggest some simple ways or some msdn library functions
that will do the work , i need them in visual c++.
-thanks
|
|
|
|
|
What's wrong with Rane's suggestion?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
I understand your question as "the ports are physically there but how can I know if they are in use", which is quite different from listing the ports present in the system.
I've understood your question correctly, the answer is that you cannot do what you desire, based on simple logic:
In case of real RS232-UARTs the system doesn't know if you have attached something in the other end of a serial device since no communication is done until you open an application and tell it that you want to communicate with a certain port. The user have to keep track of which port he/she has connected the device to.
In case of the port being a virtual COM port such as a USB device, the COM port assigned to the device will not be present in the system until the device is attached. Then you have the same situation as with real COM ports; you use an application that opens the port with ::CreateFile() .
Any application can open a port provided that the device name is known and for this you may enumerate the ports present in the system and for which you've already been given an answer.
From the machine's perspective a "free port" in the sense I've interpreted your question does not exist.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Hai !
Currently i am working with ::CreateFile()
in the following format
I am sending name of each COM port and Testing whether it is avilable or not
m_ihandle = CreateFile(Port, GENERIC_READ | GENERIC_WRITE,
0, 0,OPEN_EXISTING, 0, 0);
//if the handle value is -1, that means you got an error....
if(m_ihandle == -1)
AfxMEssageBox("open COM port failed");
else
//write success log
AfxMessageBox("opened successfully!");
But my requirement is different, without testing in this format, i simply want to load only avilabe ports to my combobox rather than picking each port from combobox and testing it!!
|
|
|
|
|
kapardhi wrote: But my requirement is different, without testing in this format, i simply want to load only avilabe ports to my combobox rather than picking each port from combobox and testing it!!
As I said; you cannot do that since the system doesn't keep track of devices that are currently in use.
Compare it with opening a file, even the name of the function suggests that the comparison makes sense. You cannot determine whether the file is currently in use or not prior to trying to open it. If the file is in use and is opened with exclusive access, you'll get a sharing violation and the call to ::CreateFile() fails the same way it would fail when trying to open a COM port if the port is in use by another application.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
what is difference between "StretchBlt and BitBlt".
If i am try to zoom in the image in SDI application (in Visual Studio 2008) through bitBlt, the image is not zooming. Same code i just replace the "StretchBlt" instead of "BitBlt" then the image in the window is zooming correctly.
could anyone explain why it happen.
|
|
|
|
|
from documentation
StretchBlt
The StretchBlt function copies a bitmap from a source rectangle into a destination rectangle, stretching or compressing the bitmap to fit the dimensions of the destination rectangle, if necessary. The system stretches or compresses the bitmap according to the stretching mode currently set in the destination device context.
BitBlt
The BitBlt function performs a bit-block transfer of the color data corresponding to a rectangle of pixels from the specified source device context into a destination device context.
I hope it helps.
Regards,
Sandip.
|
|
|
|
|
Hi ,
So it is not possible to zoom the image through BitBlt in mfc 9.0 ?
|
|
|
|