|
Hi all,
I would like to know what the following does (does it operate like an if statement or something):
m_bIsConnected = ret == SQL_SUCCESS || ret == SQL_SUCCESS_WITH_INFO;
Many Thanks
Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
Programm3r wrote: does it operate like an if statement or something
Yes, something like that. In fact, the expression ret == SQL_SUCCESS 'returns' a boolean (true if they are equals, false if they are different). The same with the || operator. Thus, the complete expression returns a boolean, which is stored in m_bIsConnected.
|
|
|
|
|
|
hi all masters
i use sleep(5); in vc++(MFC) but error is that undeclared identifier
is there any other way to declare it
|
|
|
|
|
p_ wrote: is there any other way to declare it
Maybe by using the correct function ? Use Sleep instead of sleep
|
|
|
|
|
|
Use this define
#define 5 1+1+1+1+1
codito ergo sum
|
|
|
|
|
Hi all,
I have a binary file. I want to read as it is(i mean ones and zeros), and at the same time need to store in an array. Here is the code I used to read the file.
<br />
ifstream file( "G00046_002_01.srf" ) ; <br />
file >> noskipws ;<br />
typedef bitset< numeric_limits<unsigned char>::digits > bitset ;<br />
unsigned char byte ;<br />
<br />
if(filebin.is_open())<br />
{<br />
while( file >> byte )<br />
{<br />
cout << bitset(byte) ; <br />
filebin << bitset(byte) ;<br />
}<br />
filebin.close() ;<br />
}<br />
Can you guys tell me how store those zeros and ones on an array. I confusing that working with dynamic data and arrays. Tried, but failed.
Hi all....
|
|
|
|
|
|
Thanks,
Actually I want to store that read bits on an array. That's the place I'm wired.
Hi all....
|
|
|
|
|
I have to check whether cts pin is on or off I tried the below code but no use
if(GetCommModemStatus(m_hPort,&dwCommStatus))
{
if(dwCommStatus & MS_CTS_ON)
TRACE("cts on \n");
if(dwCommStatus & MS_DSR_ON)
TRACE("dsr on \n");
if(dwCommStatus & MS_RING_ON)
TRACE("ring on \n");
if(dwCommStatus & MS_RLSD_ON)
TRACE("rlsd on \n");
else
TRACE("pins no response\n");
}
I am getting pins no response.
Any help is welcome
S.Yamini
|
|
|
|
|
Did you check that your CTS signal is high ? (with a voltmeter or an oscilloscope)
|
|
|
|
|
I checked before I connected the serial port cable to my computer.It showed +9v in the voltmeter and then i connected the serial cable but I am not getting any response or value.
S.Yamini
|
|
|
|
|
Then I don't really see... Are you sure that you the port is opened correctly (with CreateFile) and that you open the same port ?
|
|
|
|
|
Yes I am able to send Text and receive text but not able to monitor the cts pin
S.Yamini
|
|
|
|
|
If I remember right, RS232 uses a voltage feed of +-12V. And I know, from my own experience, that an open connector can give any state, it depends how the hardware is designed.
The question is: Do you get antoher result when you have a negative voltage on the cts pin?
Maybe you can try with a real modem, if you set DTR high/active, then RTS, the modem should respond with setting CTS high/active.
Again, if I remember right, "high/active" really means a negative voltage on the pin in question. But I might be wrong here, so you'd better check that piece of information.
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
What is the value of dwCommStatus ?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi Everyone,
Am new to VC++.Am using list control(report type) to represent my data obtained from serial port.Am able to select the data in the list control but not able to copy. Should i need to write any code for copying data from control list.I don't want to copy the data to any other controls with in the project.What i need is to select the data in control list, press ctrl+c and copy the data to notepad/word.Please help me out.
Thanks in advance
|
|
|
|
|
shir_k wrote: Should i need to write any code for copying data from control list
yes you have to write the code for implement same. look this code for copying data in to clipboard memeory http://www.codeproject.com/clipboard/archerclipboard1.asp[^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
HI,
I went through the link u have sent that doesn't matches with my requirement.First thing is am using control list box and am not having any button to copy.What i need is
1) Select the data in the control list by using mouse
2)copy by pressing ctrl+ C
3)pasting in a notepad or word document(outside the project).
Thanks
|
|
|
|
|
Use accelerator for Ctrl + C. Thus you will get the event (Ctrl+C press) and follow as ThatsAlok said
- NS -
|
|
|
|
|
Could u plz tell me how to use accelerator for Ctrl+c
|
|
|
|
|
From within the IDE, press Ctrl+R and select Accelerator from the list of types. Click the New button. Double-click the newly added accelerator item. Check the Ctrl checkbox. Type a C in the Key combobox. Press Enter. You should now have a Ctrl+C accelerator key. Check out the LoadAccelerators() function.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
you have to handle WM_KEYDOWN message for ctrl+c and there you have to read the text from listctrl and copy that into clipboard.. which can be copied anywhere using ctrl+ v
|
|
|
|
|
Hi Guys,
Can u ppl please explain step by step how to do it.Sorry for the trouble.
Am writing code in MFC Application.
Thanks for the help i was able to do it.
-- modified at 1:33 Wednesday 12th September, 2007
|
|
|
|